Get perp quote
Execution
Get Perp Quote
Get a non-binding quote for opening a perpetual position on a supported DEX (Gains Network, Lighter). Quotes do not authenticate the caller and are not used by the execution flow; they are purely informational and exposed to help clients pick a DEX, price, or slippage before building a real payload.
POST
Get perp quote
Documentation Index
Fetch the complete documentation index at: https://docs.mobula.io/llms.txt
Use this file to discover all available pages before exploring further.
Quotes are informational only. Execution uses the
/2/perp/payloads/<action> → /2/perp/execute-v2 flow. Use the quote endpoint to preview fills, fees, and which DEX would route best; then call /2/perp/payloads/create-order to build the actual signed payload you submit.Request Body
Wallet address of the trader. Used to scope the quote (e.g., Lighter account lookup).
Quote is unauthenticated. Unlike the payload endpoints,
/2/perp/quote does not take a signature field — only user is required. The quote endpoint is purely informational; nothing is signed or executed.Base token address, symbol, or Mobula asset id (e.g.,
ETH, 0x...).Quote token of the market. Semantics differ per DEX:
- Lighter — pass the ERC-20 collateral symbol (
USDC). - Gains — pass the synthetic quote (
USD).
marketId (e.g. gains-btc-usd, lighter-btc-usd) — the field is derived server-side from the market.Leverage multiplier (e.g.,
10 for 10x).true for long, false for short. String form ("true"/"false") is also accepted.true if the order should only reduce an existing position (never increase exposure).Collateral to commit, denominated in the
quote token units (e.g., 100 USDC).One of
market, limit, stop_limit. Default market.Trigger/limit price. Required for
limit and stop_limit.Take-profit price. Must be directionally valid (above open for long, below for short).
Stop-loss price. Must be directionally valid (below open for long, above for short).
Raw position size in base-token units. If omitted, derived from
collateralAmount * leverage.Max slippage in percent (e.g.,
0.5 = 0.5%).Routing hint, not a strict filter. If the matching market is not deployed on any of the requested chains, the router falls back to a chain that hosts it (e.g.
chainIds: ['evm:42161'] for a Base-only market silently returns chainId: 'evm:8453'). Always trust the response chainId. Omit to search all supported chains.Restrict routing to specific DEXs. Values:
gains, lighter. Omit to consider all.0 = cross, 1 = isolated. DEX-specific; ignored when not applicable.Referrer wallet address for fee sharing.
Response
Errors
| Status | When | message |
|---|---|---|
| 400 | Zod validation failed | zod validation failed |
| 500 | No DEX returned a quote | could not find quote |
errors field lists per-DEX failures, formatted as "<dex> - <error>".Body
application/json
Wallet address of the trader. Used to scope the quote (e.g., Lighter account lookup).
Base token address, symbol, or Mobula asset id.
Quote/collateral token (typically USDC).
Available options:
market, limit, stop_limit Available options:
gains, lighter