Skip to content

API ReferenceSwap

Endpoints

Swap

Quote a swap and get back a simulated, ready-to-sign transaction.

Base URLhttps://api.lane.markets/v1local instance: http://localhost:3000/v1

Best route, exact quote and a simulated swap transaction

GET/v1/quote

Finds the best route (up to 3 swaps across V2/V3/V4, and up to 3 pool-disjoint split legs), quotes it exactly on-chain through Executor.quote, builds Executor.swap calldata and simulates it from sender. Send approval first when it is not null. Never send tx when simulation.ok is false.

Query parameters

  • intoken idrequired

    ERC20 address, or HYPE for native

  • outtoken idrequired

    ERC20 address, or HYPE for native

  • amountuint stringrequired

    Input amount in base units

  • recipientaddressrequired

    Receives the output

  • senderaddress

    Signer of the tx, used for the simulation (default: recipient)

  • slippageBpsanydefault 50

    Tolerance applied to amountOut to get minOut (0-5000), or auto for slippage.recommendedBps

  • permit2"true"

    ERC20 input only: return Permit2 typed data instead of requiring an approve to the Executor

  • signaturestring

    Permit2 signature (65 bytes hex), 2nd call of the Permit2 flow

  • permit2Nonceuint string

    Nonce from the 1st call's typedData

  • permit2Deadlineuint string

    Deadline from the 1st call's typedData

Responses

200Quote and transaction

  • amountInuint string

  • amountOutuint string

    Expected output, net of router fee and measured token taxes

  • minOutuint string

  • feeBpsinteger

  • priceImpactBpsinteger | null

  • taxBpsinteger

    Measured sell tax of in + buy tax of out

  • routerAmountOutuint string

    amountOut before token taxes

  • venue"launchpad"

    Present only when the bonding curve beat the aggregator

  • warningsstring[]

  • amountOutUsdnumber | null

  • slippageobject

  • slippage.bpsinteger

  • slippage.autoboolean

  • slippage.recommendedBpsinteger

  • savingsobject | null

    Our output minus the exact quote of the best single-pool route (null if no direct pool)

  • savings.vsBestSinglePooluint string

  • savings.usdnumber | null

  • savings.bestSinglePoolobject

  • savings.bestSinglePool.amountOutuint string

  • savings.bestSinglePool.protocolstring

  • savings.bestSinglePool.poolstring

  • scannedobject

  • scanned.poolsinteger

  • scanned.routesinteger

  • scanned.quotedinteger

  • gasobject

  • gas.estimateuint string

  • gas.costInTokenOutuint string

  • splitsobject[]

  • splits[].amountInuint string

  • splits[].routeobject[]

  • splits[].route[].protocol"v2" | "v3" | "v4" | "wrap" | "launchpad"

  • splits[].route[].poolstring

  • splits[].route[].factorystring | null

  • splits[].route[].tokenInaddress

  • splits[].route[].tokenOutaddress

  • splits[].route[].feeinteger

    Pool fee in hundredths of a bp (3000 = 0.3%)

  • wrappedNativestring | null

    WHYPE used to wrap/unwrap native HYPE

  • txobject

  • tx.fromaddress

  • tx.toaddress

  • tx.datastring

  • tx.valueuint string

  • tx.chainIdinteger

  • tx.warningstring

    Present when the simulation failed. Do not send.

  • approvalobject | null

    ERC20 approve to send before tx (null if the allowance is enough)

  • approval.toaddress

  • approval.datastring

  • permit2object | null

  • permit2.typedDataobject

    EIP-712 PermitTransferFrom to sign with eth_signTypedData_v4

  • simulationobject

  • simulation.okboolean

  • simulation.gasuint string

  • simulation.errorstring

  • blockuint string

400Invalid input

404No route between the two tokens

422Output token is a honeypot (can be bought, not sold)

429Too many requests; see the retry-after header

503Indexer still backfilling, or Executor not configured

Request
curl "https://api.lane.markets/v1/quote?in=HYPE&out=0x7D29d8047B905000459c0E80c34a26CeedcB47b2&amount=1000000000000000000&recipient=0xYourAddress"
lane.markets · Make the most of every move.