Skip to main content

Request Body

user
string
required
The wallet address of the user who will execute the trade.
baseToken
string
required
The address of the base token you want to trade (e.g. ETH address).
quote
string
required
The address of the collateral/quote token (e.g. USDC address).
leverage
number
required
The leverage multiplier (e.g. 10 for 10x leverage).
long
boolean|string
required
Set to true or "true" for a long position, false or "false" for a short position.
reduceOnly
boolean|string
required
Set to true or "true" to only reduce an existing position, false or "false" otherwise.
collateralAmount
number
required
The amount of collateral token to use for the position.
orderType
string
The type of order. Possible values: market, limit, stop_limit. Defaults to market.
openPrice
number
Required for limit and stop_limit orders. The trigger price for the order.
tp
number
Take Profit price. Must be valid based on direction (above open price for long, below for short).
sl
number
Stop Loss price. Must be valid based on direction (below open price for long, above for short).
amountRaw
number
Position size in raw token units. If not provided, calculated from collateral amount and leverage.
maxSlippageP
number
Maximum allowed slippage in percentage.
chainIds
array
Array of chain IDs to search for quotes (e.g. ["evm:42161", "evm:137"]). If omitted, searches all supported chains.
dexes
array
Array of DEXes to query. Supported values: gains, lighter. If omitted, queries all supported DEXes.
marginMode
number
Margin mode. Possible values: 0 (isolated) or 1 (cross). Only applicable for certain DEXes.
referrer
string
Referrer wallet address for fee sharing.

Response

data
object
Quote result containing execution payload.

Error Response

If the quote cannot be generated, the API returns a 500 error with:
message
string
Error message (e.g. “could not find quote”)
errors
array
Array of error strings from each DEX that was queried. Format: "dex - error message" or just "error message" if no DEX specified.