GET
Get the best route

Authorizations

Authorization
string
header
required

From POST /v1/auth/verify; seven days by default, revocable. Required for financial operations. 60 requests/s, burst 120, shared by the user's sessions.

Query Parameters

funding
enum<string>
default:venue

venue: the linked account on from, withdrawing a shortfall from its margin. wallet: only the payer's wallet and available balance, in the escrow token; the master needs no account on from. Fixed for retries.

Available options:
venue,
wallet
from
string
required

The venue the taker pays on. A venue id from GET /v1/venues.

to
string
required

The venue the taker receives on. A venue id from GET /v1/venues.

destination
enum<string>

wallet prices a wallet delivery on to: no deposit minimum, minimum_received set. Where a take delivers on to: venue, into the taker's account linked there; wallet, by plain transfer to recipient's address on to's escrow chain, in that chain's wallet token (chain.wallet in GET /v1/venues; on Polygon native USDC converted from pUSD), to any address a wallet delivery accepts.

Available options:
venue,
wallet
amount_in
string
required

Most the taker pays, in from base units. Decimal base units of the venue's token (decimals in GET /v1/venues), below 2^256: with 6 decimals, "1000000" is 1 token.

Pattern: ^[0-9]{1,78}$
min_out
string

Least the taker receives for amount_in, in to base units: the worst price it takes. A smaller amount is held to the same price, in proportion. Decimal base units of the venue's token (decimals in GET /v1/venues), below 2^256: with 6 decimals, "1000000" is 1 token.

Pattern: ^[0-9]{1,78}$
max_fee_bps
integer

The highest taker fee the takes would accept: each leg is priced at its pair's fee, a leg whose fee is higher left out, as the take would refuse it. Without it, legs pay no fee, as takes without max_fee_bps do. Basis points; the escrow refuses more than 100.

Required range: 0 <= x <= 100
all
boolean
default:false

Ignored.

Response

The route.

destination
enum<string>
required

Where a take delivers on to: venue, into the taker's account linked there; wallet, by plain transfer to recipient's address on to's escrow chain, in that chain's wallet token (chain.wallet in GET /v1/venues; on Polygon native USDC converted from pUSD), to any address a wallet delivery accepts.

Available options:
venue,
wallet
minimum_received
object | null
required

For a wallet destination, the least its recipient receives of the wallet token for amount_out; null for a venue.

from
string
required

A venue id from GET /v1/venues.

to
string
required

A venue id from GET /v1/venues.

amount_in
string
required

What the first take pays, in from base units.

Pattern: ^[0-9]{1,78}$
capped
boolean
required

True when the route spends less than the request beyond rounding: what it leaves buys a base unit of output or more per part.

amount_out
string
required

What the last take delivers, in to base units.

Pattern: ^[0-9]{1,78}$
legs
object[]
required

The takes in order. Of two, the first delivers on the intermediate venue, from where the second pays; its amount_in is less than the first's amount_out by the Lighter account's transfer fee and rounding.

Required array length: 1 - 2 elements
funding
enum<string>
default:venue

venue: the linked account on from, withdrawing a shortfall from its margin. wallet: only the payer's wallet and available balance, in the escrow token; the master needs no account on from. Fixed for retries.

Available options:
venue,
wallet