Prepare a TWAMM or DCA order
prepare_twamm_orderPrepare one or more TWAMM order splits with approvals and native value as one atomic batch. details.token_id is the order's id before anything is sent: keep it, because prepare_twamm_order_collection and prepare_twamm_order_stop are keyed by it and orders are not enumerable by owner. Start and end times must be multiples of 256 seconds near the present, widening in powers of 16 further out.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"chain_id": "<chain_id>",
"sender": "<sender>",
"sell_token": "<sell_token>",
"buy_token": "<buy_token>",
"orders": "<orders>",
"pending_timestamp": "<pending_timestamp>"
},
"name": "prepare_twamm_order"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| salt | No | Fixes the order's token id; omit to derive it from the request. Supply one only when identical orders need distinct ids (bytes32 hex) | |
| orders | Yes | ||
| sender | Yes | address | |
| chain_id | Yes | EVM chain ID | |
| buy_token | Yes | Token; zero address = native | |
| sell_token | Yes | Token; zero address = native | |
| deadline_seconds | No | ||
| pending_timestamp | Yes | decimal integer |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| execution_plan_reference | No | artifact_reference; pass unchanged |