Orkid

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

FieldTypeRequiredDescription
fromstringYesInput token symbol or address
tostringYesOutput token symbol or address
amountstringYesInput amount (human-readable)
chainstringYesbase, ethereum, arbitrum, or polygon
userstringYesThe swapper's wallet address
fromAddressstringRecommendedInput token contract address
fromDecimalsnumberRecommendedInput token decimals
toAddressstringRecommendedOutput token contract address
toDecimalsnumberRecommendedOutput token decimals
dryRunbooleanNoIf true, encode only — do not submit. Default false.
slippageBpsnumberNoMax slippage in basis points. Default 5.
permitobjectYesPermit2 PermitTransferFrom data (without spender)
signaturestringYes65-byte hex EIP-712 signature

The spender (TVMExecutor) must be in the signed message but is not included in the JSON permit object. 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/solve always returns this dry-run shape regardless of the dryRun value 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.

On this page