Intent Solver solve#
POST /solve#
Receives an auction and returns one or more solutions.
The response includes the objective value of the best solution(s) the solver can find, but does not include calldata. After Autopilot determines the winner, it will call the /settle endpoint to instruct the winning solver to execute its solution.
Notes#
- Solvers should respond quickly: multi-order auctions require a response time of ≤ 8s, and single-order auctions require ≤ 2s. Timeouts are treated as forfeiting that auction round (network latency included).
- Autopilot will call this endpoint at most once for the same auction ID.
- If an RWA single-order auction cannot be solved in the first round, the unsolved orders will be batched together with other normal orders in the next round.
http
POST /solve
Content-Type: application/json
Request Parameters (SolveRequest)#
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
| chainIndex | String | Yes | Chain ID | 1-eth |
| auctionId | String | Yes | Unique auction ID | 12345 |
| settlementContract | String | Yes | Settlement contract address used to settle this auction | 0xabcd... |
| deadline | Timestamp | Yes | Deadline timestamp by which a response is expected | 172120120102 |
| stressTest | Boolean | No | When true, the order is a stress test order. Skip simulation validation for /solve and return results in solutions | true |
| orders | Array<Order> | Yes | Solvable orders included in this auction | — |
| ┗ orderUid | String | Yes | Unique order identifier (56 bytes, 0x-prefixed hex) | 0x30cff40d...76a6 |
| ┗ owner | String | Yes | Order owner address | 0x1234...5678 |
| ┗ fromTokenAddress | String | Yes | Sell token address | 0xa0b8...eb48 |
| ┗ toTokenAddress | String | Yes | Buy token address | 0xdac1...1ec7 |
| ┗ fromTokenAmount | String | Yes | Sell amount (in smallest units) | 1000000000 |
| ┗ toTokenAmount | String | Yes | Buy amount (in smallest units) | 990000000 |
| ┗ swapMode | String | Yes | Order kind: exactIn / exactOut. OKX currently only supports exactIn | exactIn |
| ┗ partiallyFillable | Boolean | Yes | Whether partial fills are allowed. OKX currently does not support partial fills | false |
| ┗ validTo | String | Yes | Order expiry (Unix timestamp, seconds) | 1737400518 |
| ┗ appDataHash | String | Yes | App data hash (32 bytes, 0x-prefixed hex) | 0x0000...0000 |
| ┗ signature | String | Yes | Signature (0x-prefixed hex) | 0x1234... |
| ┗ signingScheme | String | Yes | Signing scheme: eip712 / ethsign / presign / eip1271 | eip712 |
| ┗ receiver | String | Yes | Receiver address | 0x1234...5678 |
| ┗ createTime | String | Yes | Order creation time (epoch seconds) | 1737396918 |
| ┗ commissionInfos | Array | No | Commission info list | — |
| ┗┗ feePercent | String | Yes | Up to 9 decimal places are allowed. If more decimals are provided, the system will round up automatically | 20000000 |
| ┗┗ feeAmount | String | No | Commission fee amount | 100000 |
| ┗┗ referrerWalletAddress | String | Yes | Commission recipient address | 0x1234... |
| ┗┗ feeDirection | Boolean | Yes | Fee side: true = charge fromToken, false = charge toToken | true |
| ┗┗ commissionType | String | Yes | Commission type: okx = OKX platform fee, parent = parent-node commission, child = child-node commission | okx |
| ┗┗ toB | Boolean | Yes | Order type: true = ToB, false = ToC | false |
| tokens | Array | Yes | Token data used in the auction (includes WETH price info) | — |
| ┗ address | String | Yes | Token address | 0x1234...5611 |
| ┗ price | String | No | Reference price (denominated in USD, up to 18 decimal places), used to calculate surplus | 1000000000000000000 |
| ┗ decimals | String | No | Token decimals | 18 |
| ┗ tags | Array | No | Token tag list | ["RWA_ONDO","RWA"] |
Response Parameters#
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
| solutions | Array | No | List of solutions | — |
| ┗ solutionId | String | Yes | Solution unique identifier (only needs to be unique within the current auction, not globally). Must be a numeric string with a maximum value of 2^63 - 1 | 1 |
| ┗ clearingPrices | Object | Yes | Mapping from token address to the uniform clearing price (price before fees are deducted) | — |
| ┗ submissionAddress | String | Yes | Address used to submit the solution for settlement | 0xaFe9...3596 |
| ┗ orders | Array | Yes | List of orders included in the solver's solution, including the solver's own JIT orders | — |
| ┗┗ orderUid | String | Yes | Unique order identifier (56 bytes, 0x-prefixed hex) | 0xb91949...46e |
| ┗┗ swapMode | String | Yes | Order kind: exactIn / exactOut | exactIn |
| ┗┗ fromTokenAddress | String | Yes | Sell token address | 0xc02a...6cc2 |
| ┗┗ toTokenAddress | String | Yes | Buy token address | 0xdac1...1ec7 |
| ┗┗ fromTokenAmount | String | Yes | Maximum amount allowed to sell | 1750000000000000 |
| ┗┗ toTokenAmount | String | Yes | Minimum amount allowed to buy | 3529500 |
| ┗┗ executedFromTokenAmount | String | Yes | Actual amount leaving the user's wallet (including all fees) | 1750000000000000 |
| ┗┗ executedToTokenAmount | String | Yes | Net amount the user actually receives (after all fees) | 3694070 |
| ┗┗ solverFeeInfo | Object | Yes | Solver fee information | — |
| ┗┗┗ feePercent | String | Yes | Up to 9 decimal places are allowed. If more decimals are provided, the system will round up automatically | 0 |
| ┗┗┗ feeAmount | String | Yes | Solver fee amount | 0 |
| ┗┗┗ solverAddress | String | Yes | Solver fee recipient address | 0xaFe9...3596 |
| ┗┗┗ feeDirection | Boolean | Yes | Fee side: true = charge fromToken, false = charge toToken | false |
| ┗┗ surplusFeeInfo | Object | No | Surplus fee information | — |
| ┗┗┗ feePercent | String | Yes | Surplus fee percentage | 0 |
| ┗┗┗ trimReceiver | String | Yes | Recipient address for the trimmed surplus | 0xaFe9...3596 |
| ┗┗ commissionInfos | Array | No | Platform fee & referral commission information | — |
| ┗┗┗ feePercent | String | Yes | Up to 9 decimal places are allowed. If more decimals are provided, the system will round up automatically | 3000000 |
| ┗┗┗ feeAmount | String | Yes | Commission fee amount | 11132 |
| ┗┗┗ referrerWalletAddress | String | Yes | Commission recipient address | 0x29e2...6925 |
| ┗┗┗ feeDirection | Boolean | Yes | Fee side: true = charge fromToken, false = charge toToken | false |
| ┗┗┗ commissionType | String | Yes | Commission type: okx = OKX platform fee, parent = parent-node commission, child = child-node commission | okx |
| ┗┗┗ toB | Boolean | Yes | Order type: true = ToB, false = ToC | false |
Request Example#
json
{
"auctionId": "16979924300771968",
"chainIndex": "1",
"deadline": "1773829092242",
"settlementContract": "0x1a34e1e604d8a55405172c0717b17f7631d5f265",
"orders": [
{
"appDataHash": "0xb44dd4943b8f671e3e555b6e0fb8a882fd4c81d2bf2fbe27bf2bc76794d6f1ce",
"commissionInfos": [
{
"commissionType": "okx",
"feeDirection": true,
"feePercent": "3000000",
"referrerWalletAddress": "0x6ea08ca8f313d860808ef7431fc72c6fbcf4a72d",
"toB": false
},
{
"commissionType": "child",
"feeDirection": true,
"feePercent": "1000000",
"referrerWalletAddress": "0x2c825edb17c2c04983a481ebd2da2a39424c7cb7",
"toB": false
},
{
"commissionType": "parent",
"feeDirection": true,
"feePercent": "500000",
"referrerWalletAddress": "0x3474fbbc6e43dcb0398e2eacbe1032cced806742",
"toB": false
}
],
"createTime": "1773828838",
"fromTokenAddress": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
"fromTokenAmount": "1000000000000000",
"orderUid": "0xac46fe143af2afc7e3614f96cfcf660b0e680ca8d9d8f59591b63fbdc4a871413474fbbc6e43dcb0398e2eacbe1032cced80674269ba81ed",
"owner": "0x3474fbbc6e43dcb0398e2eacbe1032cced806742",
"partiallyFillable": false,
"receiver": "0x3474fbbc6e43dcb0398e2eacbe1032cced806742",
"signature": "0xabe06f2376cd977d47179be4b055df4b4ebb140d48e585c9f742019760fe02f02655eec2b87ae159c7e1a510dfe3524799504c1f6175c5c2cdff35d0ad54b6131c",
"signingScheme": "eip712",
"swapMode": "exactIn",
"toTokenAddress": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
"toTokenAmount": "2262246",
"validTo": "1773830637"
}
],
"tokens": [
{
"address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
"price": "2333.904192377223440889",
"decimals": "18",
"tags": ["RWA_ONDO", "RWA"]
},
{
"address": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
"price": "0.99998",
"decimals": "6",
"tags": ["RWA_ONDO", "RWA"]
}
]
}
Response Example#
json
{
"code": 0,
"msg": "success",
"data": {
"solutions": [
{
"solutionId": "1",
"clearingPrices": {
"0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2": "471600415.188469753892516323455589889089688117",
"0xdac17f958d2ee523a2206206994597c13d831ec7": "1"
},
"submissionAddress": "0xaFe9d55A5a4e90bBBabBa0327BF72196B5683596",
"orders": [
{
"orderUid": "0xb919490fe85e27523f1732fcf09dc398a89deea8f7d9c5fb170cd4f6d6d3bbb729e27c8e9979b9879de65955f172f3623644692569abc46e",
"swapMode": "exactIn",
"fromTokenAddress": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
"toTokenAddress": "0xdac17f958d2ee523a2206206994597c13d831ec7",
"fromTokenAmount": "1750000000000000",
"toTokenAmount": "3529500",
"executedFromTokenAmount": "1750000000000000",
"executedToTokenAmount": "3694070",
"solverFeeInfo": {
"feeAmount": "0",
"feePercent": "0",
"feeDirection": false,
"solverAddress": "0xaFe9d55A5a4e90bBBabBa0327BF72196B5683596"
},
"surplusFeeInfo": {
"feePercent": "0",
"trimReceiver": "0xaFe9d55A5a4e90bBBabBa0327BF72196B5683596"
},
"commissionInfos": [
{
"referrerWalletAddress": "0x29e27c8e9979b9879de65955f172f36236446925",
"feeAmount": "11132",
"feePercent": "3000000",
"toB": false,
"feeDirection": false,
"commissionType": "okx"
},
{
"referrerWalletAddress": "0x29e27c8e9979b9879de65955f172f36236446925",
"feeAmount": "3710",
"feePercent": "1000000",
"toB": false,
"feeDirection": false,
"commissionType": "child"
},
{
"referrerWalletAddress": "0x29e27c8e9979b9879de65955f172f36236446925",
"feeAmount": "1855",
"feePercent": "500000",
"toB": false,
"feeDirection": false,
"commissionType": "parent"
}
]
},
{
"orderUid": "0xe2f6bd4af8ca930b391f321d8ec9d6f772748060aa4bf9b9576d97361af7724f29e27c8e9979b9879de65955f172f3623644692569abc471",
"swapMode": "exactIn",
"fromTokenAddress": "0xdac17f958d2ee523a2206206994597c13d831ec7",
"toTokenAddress": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
"fromTokenAmount": "5000000",
"toTokenAmount": "2340413279781192",
"executedFromTokenAmount": "5000000",
"executedToTokenAmount": "2347391066600608",
"solverFeeInfo": {
"feeAmount": "0",
"feePercent": "0",
"feeDirection": true,
"solverAddress": "0xaFe9d55A5a4e90bBBabBa0327BF72196B5683596"
},
"surplusFeeInfo": {
"feePercent": "0",
"trimReceiver": "0xaFe9d55A5a4e90bBBabBa0327BF72196B5683596"
},
"commissionInfos": [
{
"referrerWalletAddress": "0x29e27c8e9979b9879de65955f172f36236446925",
"feeAmount": "15000",
"feePercent": "3000000",
"toB": false,
"feeDirection": true,
"commissionType": "okx"
},
{
"referrerWalletAddress": "0x29e27c8e9979b9879de65955f172f36236446925",
"feeAmount": "5000",
"feePercent": "1000000",
"toB": false,
"feeDirection": true,
"commissionType": "child"
},
{
"referrerWalletAddress": "0x29e27c8e9979b9879de65955f172f36236446925",
"feeAmount": "2500",
"feePercent": "500000",
"toB": false,
"feeDirection": true,
"commissionType": "parent"
}
]
}
]
}
]
}
}