Documentation Index
Fetch the complete documentation index at: https://cowswap-mintlify-seo-audit-1777280932.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Trade Above Threshold API
This programmatic order automatically executes trades when a token balance surpasses a specified threshold, selling the entire balance at market rates.Key Parameters
| Parameter | Description |
|---|---|
sellToken / buyToken | Token pair for the exchange |
threshold | Balance minimum triggering execution |
validityBucketSeconds | Time window for order grouping |
receiver | Destination for trade proceeds |
appData | Associated metadata hash |
How It Works
ThegetTradeableOrder function checks if the owner’s balance meets the threshold requirement. When conditions are satisfied, it generates a market order selling the complete balance with a minimum buy amount of 1 token.
Key characteristics:
- Creates orders with
buyAmount = 1, meaning it will accept any price - Uses validity bucketing so orders queried within the same bucket return the same
orderUid - Reverts with
PollTryNextBlockerror if balance remains insufficient
Primary Applications
- Yield harvesting
- Treasury management
- Automated rebalancing
- Fee sweeping operations