Skip to main content

Good After Time Orders

Good After Time (GAT) orders are conditional trades that remain dormant until their startTime is reached, functioning as scheduled executions with optional price validation.

Core Mechanics

Time-Based Activation

Orders activate only after a specified timestamp and expire at an endTime. The system returns PollTryAtEpoch(startTime) if execution is attempted too early.

Balance Protection

The minSellBalance parameter ensures sufficient token availability, preventing execution after funds have been withdrawn or the order has already filled.

Dynamic Buy Amounts

The off-chain input accepts varying buyAmount values, meaning different buyAmount values create different orderUids, allowing multiple fills of the same order.

Price Validation

Optional Milkman price checkers validate that provided buy amounts meet minimum requirements. The acceptable minimum calculates as:
expectedOut * (10000 - allowedSlippage) / 10000
Where slippage uses basis points (100 bp = 1%).

Key Parameters

ParameterDescription
sellToken / buyTokenToken pair for the trade
receiverDestination address for purchased tokens
startTime / endTimeUNIX timestamps controlling order validity window
allowPartialFillWhether solvers can execute partial quantities
priceCheckerPayloadABI-encoded validation rules (optional)
minSellBalanceMinimum balance required to execute

Order Structure

The implementation uses GPv2Order.Data structures integrated with ComposableCoW’s conditional order framework, enabling sophisticated DeFi automation patterns with time-based constraints and price protections.
Last modified on March 4, 2026