Skip to main content
GET
/
2
/
perp
/
quote
Get perp quote
curl --request GET \
  --url https://demo-api.mobula.io/api/2/perp/quote
{
  "success": true,
  "data": {
    "dex": "<string>",
    "marketId": "<string>",
    "chainId": "<string>",
    "payloadStr": "<string>",
    "payload": null
  }
}

Query Parameters

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.
collateralAmount
number
required
The amount of collateral token to use for the position.
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).
tradeType
string
The type of order. Possible values: market, limit, stop_limit. Defaults to market.
amountRaw
number
Position size in raw token units. If not provided, calculated from collateral amount and leverage.
maxSlippageP
number
Maximum allowed slippage in percentage.
chainId
string
Chain ID to search for quotes (e.g. "evm:42161"). If omitted, searches all supported chains.
dex
string
DEX to query. Supported values: gains. If omitted, queries all supported 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.

Query Parameters

user
string
required
baseToken
string
required
quote
string
required
leverage
number
required
long
required
collateralAmount
number
required
openPrice
number
tp
number
sl
number
tradeType
enum<string>
Available options:
market,
limit,
stop_limit
amountRaw
number
maxSlippageP
number
chainId
string
dex
enum<string>
Available options:
gains
referrer
string

Response

200 - application/json

Perp quote response

success
boolean
required
data
object
required