Parameters#
Everything quote takes, plus:
| Name | Type | Description |
|---|---|---|
account | address, required | The account that will sign the transactions and receive the output |
maxSlippageBps | number, default 50 | Worst acceptable fill against the quote, 1–1000; sets amountOutMinimum or amountInMaximum |
tokenForm | raw or wrapped, default raw | raw: the account holds or wants the xStock itself, which adds wrap or unwrap steps. wrapped: the ERC-4626 wrapper token |
deadlineSeconds | number, default 600 | Seconds until the swap reverts, 60–3600 |
Request#
curl -i "https://api.roundlot.0xo.in/v1/plan-trade?symbol=NVDA&side=buy&size=250&account=0xYourAddress"
Response#
Buying $250 of NVDA delivered as the raw token, planned on 25 Sep 2026 at 03:54 UTC (calldata shortened):
{
"chainId": 196, "network": "eip155:196",
"account": "0x5075FF68A0Efb54dB13423AD924bd680327D305E",
"symbol": "NVDA", "side": "buy", "tokenForm": "raw",
"steps": [
{ "index": 1, "kind": "approve", "to": "0x4ae46a509f6b1d9056937ba4500cb143933d2dc8", "data": "0x095ea7b3…", "value": "0",
"description": "Approve SwapRouter02 to spend USDG" },
{ "index": 2, "kind": "swap", "to": "0x4f0c28f5926afda16bf2506d5d9e57ea190f9bca", "data": "0x5ae401dc…", "value": "0",
"description": "Swap 250 USDG for at least 1.10567674963162354 wNVDAx" },
{ "index": 3, "kind": "unwrap", "to": "0xa8ddb5cd96b5222afe198316e9a57caa642850d5", "data": "0xba087652…", "value": "0",
"description": "Unwrap 1.10567674963162354 wNVDAx into 1.107557723381118755 NVDAx" }
],
"expected": { "pay": "250 USDG", "receive": "1.107557723381118755 NVDAx (any fill above the slippage floor stays as wNVDAx)" },
"limits": { "amountIn": "250", "amountOutMinimum": "1.10567674963162354", "maxSlippageBps": 50,
"deadline": "2026-09-25T04:04:51.000Z" },
"warnings": []
}
The steps#
Depending on side and token form, a plan is some of:
- approve: only when the account's allowance is too low; existing approvals are skipped.
- wrap: ERC-4626
depositof the raw token, when selling the raw form. - swap:
SwapRouter02.multicall(deadline, [exactInputSingle | exactOutputSingle]), so the swap reverts after the deadline. - unwrap: ERC-4626
redeem, when buying the raw form.
Each approve sits directly before the step that spends it. If the account holds too little of the first token spent, the plan still comes back, with a warning. How to run a plan is in Executing a plan safely.
The steps are mainnet transactions. Check each to, data and the limits before you sign, and sign them in order.
Errors#
| Code | HTTP | When |
|---|---|---|
invalid_input | 400 | A parameter is missing or malformed, including account; no payment is asked for |
unknown_symbol | 400 | The symbol isn't NVDA, SPY or TSLA |
insufficient_liquidity | 422 | The pool can't fill this size |
token_paused | 422 | The issuer has paused transfers |
multiplier_change_pending | 422 | A multiplier change activates within the deadline plus 60 s |
rate_limited | 429 | More than 60 requests a minute from your IP |
payments_unavailable | 503 | The facilitator isn't reachable; the free catalog still works |
upstream_error | 502 | X Layer RPC or OKX market data failed; try again |
None of these are charged.