Endpoints
Swap
Quote a swap and get back a simulated, ready-to-sign transaction.
https://api.lane.markets/v1local instance: http://localhost:3000/v1Best route, exact quote and a simulated swap transaction
/v1/quoteFinds 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 idrequiredERC20 address, or HYPE for native
outtoken idrequiredERC20 address, or HYPE for native
amountuint stringrequiredInput amount in base units
recipientaddressrequiredReceives the output
senderaddressSigner of the tx, used for the simulation (default: recipient)
slippageBpsanydefault 50Tolerance applied to amountOut to get minOut (0-5000), or
autofor slippage.recommendedBpspermit2"true"ERC20 input only: return Permit2 typed data instead of requiring an approve to the Executor
signaturestringPermit2 signature (65 bytes hex), 2nd call of the Permit2 flow
permit2Nonceuint stringNonce from the 1st call's typedData
permit2Deadlineuint stringDeadline from the 1st call's typedData
Responses
200Quote and transaction
amountInuint stringamountOutuint stringExpected output, net of router fee and measured token taxes
minOutuint stringfeeBpsintegerpriceImpactBpsinteger | nulltaxBpsintegerMeasured sell tax of
in+ buy tax ofoutrouterAmountOutuint stringamountOut before token taxes
venue"launchpad"Present only when the bonding curve beat the aggregator
warningsstring[]amountOutUsdnumber | nullslippageobjectslippage.bpsintegerslippage.autobooleanslippage.recommendedBpsintegersavingsobject | nullOur output minus the exact quote of the best single-pool route (null if no direct pool)
savings.vsBestSinglePooluint stringsavings.usdnumber | nullsavings.bestSinglePoolobjectsavings.bestSinglePool.amountOutuint stringsavings.bestSinglePool.protocolstringsavings.bestSinglePool.poolstringscannedobjectscanned.poolsintegerscanned.routesintegerscanned.quotedintegergasobjectgas.estimateuint stringgas.costInTokenOutuint stringsplitsobject[]splits[].amountInuint stringsplits[].routeobject[]splits[].route[].protocol"v2" | "v3" | "v4" | "wrap" | "launchpad"splits[].route[].poolstringsplits[].route[].factorystring | nullsplits[].route[].tokenInaddresssplits[].route[].tokenOutaddresssplits[].route[].feeintegerPool fee in hundredths of a bp (3000 = 0.3%)
wrappedNativestring | nullWHYPE used to wrap/unwrap native HYPE
txobjecttx.fromaddresstx.toaddresstx.datastringtx.valueuint stringtx.chainIdintegertx.warningstringPresent when the simulation failed. Do not send.
approvalobject | nullERC20 approve to send before
tx(null if the allowance is enough)approval.toaddressapproval.datastringpermit2object | nullpermit2.typedDataobjectEIP-712 PermitTransferFrom to sign with eth_signTypedData_v4
simulationobjectsimulation.okbooleansimulation.gasuint stringsimulation.errorstringblockuint 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
curl "https://api.lane.markets/v1/quote?in=HYPE&out=0x7D29d8047B905000459c0E80c34a26CeedcB47b2&amount=1000000000000000000&recipient=0xYourAddress"