POST /api/v1/solve
Sign a Permit2 message and execute a gasless swap.
Execute a swap by providing a signed Permit2 PermitTransferFrom message. The solver uses the signature to pull the input token and routes the swap through Tycho's pool graph.
Request
POST https://orkidlabs.xyz/api/v1/solve
Content-Type: application/json
X-ORKID-API-Key: <key>
{
"from": "USDC",
"to": "WETH",
"amount": "25.0",
"chain": "base",
"user": "0x...",
"fromAddress": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
"fromDecimals": 6,
"toAddress": "0x4200000000000000000000000000000000000006",
"toDecimals": 18,
"dryRun": false,
"slippageBps": 5,
"permit": {
"permitted": {
"token": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
"amount": "25000000"
},
"nonce": "123...",
"deadline": "1725561600"
},
"signature": "0x..."
}Parameters
| Field | Type | Required | Description |
|---|---|---|---|
from | string | Yes | Input token symbol or address |
to | string | Yes | Output token symbol or address |
amount | string | Yes | Input amount (human-readable) |
chain | string | Yes | base, ethereum, arbitrum, or polygon |
user | string | Yes | The swapper's wallet address |
fromAddress | string | Recommended | Input token contract address |
fromDecimals | number | Recommended | Input token decimals |
toAddress | string | Recommended | Output token contract address |
toDecimals | number | Recommended | Output token decimals |
dryRun | boolean | No | If true, encode only — do not submit. Default false. |
slippageBps | number | No | Max slippage in basis points. Default 5. |
permit | object | Yes | Permit2 PermitTransferFrom data (without spender) |
signature | string | Yes | 65-byte hex EIP-712 signature |
The
spender(TVMExecutor) must be in the signed message but is not included in the JSONpermitobject. See Permit2 signing.
Success response
{
"ok": true,
"quote": {
"amountIn": "25.000000",
"amountOut": "0.010184",
"amountOutRaw": "10183963710975259",
"volumeUsd": 25,
"rate": "0.000407 WETH/USDC",
"protocol": "aerodrome_slipstreams",
"priceImpactBps": 9.66
},
"transaction": {
"txHash": "0x...",
"to": "0x60AB9E090abF9B6BcFbA16017eE18AEf5f2c2289",
"data": "0x...",
"value": "0",
"chain": "base"
},
"computeMs": 142
}Dry-run response
When dryRun is true, the solver does not submit the transaction. It returns the same transaction object minus txHash:
{
"ok": true,
"transaction": {
"to": "0x60AB9E090abF9B6BcFbA16017eE18AEf5f2c2289",
"data": "0x...",
"value": "0",
"chain": "base"
}
}In the sandbox,
/api/v1/solvealways returns this dry-run shape regardless of thedryRunvalue you send. See Sandbox.
Below the gasless minimum
If the swap is below the chain's minimum notional, the response carries gaslessEligible: false and the solver returns encode-only calldata. The client submits the transaction itself (the user's wallet pays gas).
To count that settled volume toward rebates, call POST /api/v1/confirm after the tx is mined. See Reporting endpoints.