Flash

Request a quote for a Flash swap. Returns pricing, fee breakdown, asset amounts, market quality indicators, and source-chain signing actions. Cross-chain market orders are supported by setting targetChain and contraChain to different values and providing recipientAddress. Same-chain quotes for market, limit, and twap orders may attach a take-profit / stop-loss pair via attachedBracket — the response then carries a second signing payload and any funding actions for the received asset under attachedBracket.

post/quote

Request

  • Base URL
    https://flash.definitive.fi/v1
  • Auth
    API key in header x-definitive-api-key

Request body

targetChain'arbitrum' | 'avalanche' | 'base' | 'bsc' | 'ethereum' | 'optimism' | 'polygon' | 'solana' | 'hyperevm' | 'plasma' | 'monad' | 'robinhood' | 'ink' | 'arc' | 'elysium' required

Chain of the target (traded) asset. May differ from contraChain for a cross-chain market order.

contraChain'arbitrum' | 'avalanche' | 'base' | 'bsc' | 'ethereum' | 'optimism' | 'polygon' | 'solana' | 'hyperevm' | 'plasma' | 'monad' | 'robinhood' | 'ink' | 'arc' | 'elysium' required

Chain of the contra (counter) asset. May differ from targetChain for a cross-chain market order.

targetAssetstring required

Address of the target (traded) asset.

contraAssetstring required

Address of the contra (counter) asset — spent on buys, received on sells.

side'buy' | 'sell' required

direction of the order

qtystring required

Amount of the asset being spent (sold), as a decimal string in the asset's normalized units. For buy orders this is in contraAsset units; for sell orders this is in targetAsset units.

orderType'market' | 'limit' | 'twap' | 'stop' | 'stop-loss' | 'take-profit' | 'bracket' | 'trailing-stop' | 'trailing-stop-limit' required

Order type. Cross-chain orders support market only.

quickTradeboolean

Execution mode for sniping newly launched tokens (exclusive to same-chain market swaps; not supported cross-chain). Reach out to the Definitive team to find out whether QuickTrade is a good fit for your use case.

maxSlippagestring

Slippage tolerance as a decimal (e.g. 0.05 = 5%). When omitted, our engine sets a slippage at order admission.

maxPriceImpactstring

Maximum price impact as a decimal (e.g. 0.05 = 5%). When omitted, our engine applies the order-type-specific default at admission.

limitNotionalPricestring

USD limit price for the traded (targetAsset) asset. Required for limit orders unless limitCrossPrice is set; optional for twap, stop, stop-loss, and take-profit (trigger orders are promoted to the corresponding LIMIT variant).

limitCrossPricestring

Pair-rate limit price — how many contraAsset units one targetAsset unit is worth. Frame is the same on buy and sell. Mutually exclusive with limitNotionalPrice; either satisfies the limit-price requirement.

funderAddressstring

Wallet that funds the spent asset on the source chain. The source is contraChain for buys and targetChain for sells.

recipientAddressstring

Address that receives funds on the destination chain. Required when targetChain and contraChain differ.

evmUsePermit2boolean

EVM only. When true, forces the Permit2 signing flow instead of the Flash settlement contract flow. When false, forces the Flash settlement contract flow: no Permit2 data is returned, and approveTx targets the Flash settlement contract when its allowance is short. When omitted, the server picks the flow from the funder's on-chain state — typically the Flash settlement contract flow, but Permit2 when the funder is already set up for it. Recommended when forceMinimalAllowance is set. Reach out to the Definitive team to discuss whether to populate this flag.

forceMinimalAllowanceboolean

When true, ERC-20 approvals or Permit2 permits to FlashAllowance and Solana SPL delegations use the cumulative amount required for this quote and outstanding orders at quote acquisition (concurrent quotes do not reserve allowance). Existing authorization is reused only when it exactly equals the cumulative amount; otherwise a replacement approval, permit, or delegation sized to that amount is returned, so unlimited or oversized grants are revoked on the next order. ERC-20 approval to Permit2 remains unlimited. Recommended with evmUsePermit2 on EVM; see Minimal authorization. Defaults to false. With attachedBracket, the pair's authorization on the received asset is sized to its signed maximum plus the funder's other open orders on that asset.

svmUseNativeSOLboolean

Quote-only Solana native-SOL intent. When true, a spent So11111111111111111111111111111111111111112 asset is treated as native SOL and the quote returns instructions to wrap the full spend amount into wSOL before signing/submitting. When false or omitted, So11111111111111111111111111111111111111112 is treated as an ordinary wSOL SPL token balance.

flashIntegratorFeeBpsstring

Integrator fee in basis points (100 = 1%). Maximum 1000 (10%).

expireTimestring date-time

ISO-8601 expiry. Optional for LIMIT and trigger orders (omit for good-til-cancelled).

startTimestring date-time

TWAP only. ISO-8601 scheduled execution start. durationSeconds is measured from this time.

durationSecondsinteger

TWAP only. Required for TWAP; minimum 300 (5 minutes).

twapBucketCountinteger

TWAP only. Number of equal-time buckets. Omit to let the server auto-derive.

Example request

{
  "targetChain": "ethereum",
  "contraChain": "ethereum",
  "targetAsset": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
  "contraAsset": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
  "side": "buy",
  "qty": "1.5",
  "orderType": "market",
  "limitNotionalPrice": "4000",
  "limitCrossPrice": "4000",
  "flashIntegratorFeeBps": "100",
  "expireTime": "2026-05-12T00:00:00Z",
  "startTime": "2026-05-12T00:00:00Z",
  "durationSeconds": 1800,
  "twapBucketCount": 12,
  "triggers": [
    {
      "notionalPrice": "1800",
      "crossPrice": "1800",
      "limitPrice": "1774"
    }
  ],
  "trailingStop": {
    "trailPercent": "0.05",
    "activationPrice": "4000"
  },
  "attachedBracket": {
    "takeProfit": {
      "notionalPrice": "1800"
    },
    "stopLoss": {
      "notionalPrice": "1800"
    },
    "expireTime": "2026-06-12T00:00:00Z"
  }
}

Response

Quote generated successfully

quoteIdstring required
bridgeQuoteIdstring nullable

Cross-chain bridge quote identifier. When non-null, pass it as bridgeQuoteId on POST /order.

orderType'market' | 'limit' | 'twap' | 'stop' | 'stop-loss' | 'take-profit' | 'bracket' | 'trailing-stop' | 'trailing-stop-limit' required

bracket is a standalone take-profit / stop-loss pair on an asset the funder already holds: side: "sell", exactly two triggers with opposite triggerType, a fixed qty, and an optional limitPrice per leg (no order-level limit price). A funder may hold any number of brackets on an asset, each with its own qty.

trailing-stop and trailing-stop-limit follow the market with a trailingStop block instead of triggers: a sell trails the high-water mark and fires when the price falls trailPercent below it, a buy trails the low-water mark and fires when the price rises trailPercent above it. trailing-stop executes at market when it fires; trailing-stop-limit rests a limit at the effective trigger price. Neither takes a client limit price.

side'buy' | 'sell' required
targetAssetstring required
contraAssetstring required
estimatedPriceImpactstring nullable required

Estimated price impact as a decimal (e.g. 0.0042 = 0.42%). Null when the quote produced no estimate. Can exceed the request's maxPriceImpact, which applies at fill time.

recommendedSlippagestring nullable

Recommended slippage tolerance based on the quote, as a decimal (e.g. 0.01 = 1%). Set on market-order quotes (including QuickTrade); null for limit, trigger, and TWAP quotes.

setupTxsstring[] nullable

Unsigned pre-trade setup transactions (account creation, native wrap, allowance), fully assembled server-side. Sign each with the funder wallet and submit via POST /setup-transaction in order, waiting for a confirmed status before the next. Solana quotes carry one base64 transaction bundling every step; EVM quotes carry one or two 0x-hex transactions at consecutive nonces. Null when no setup is needed.

Example response

{
  "quoteId": "q_abc123",
  "targetAsset": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
  "contraAsset": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
  "fees": {
    "estimatedFeeNotional": "1.50"
  },
  "estimatedPriceImpact": "0.0042",
  "recommendedSlippage": "0.01",
  "wrap": {
    "nativeAsset": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
    "wrappedAsset": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2"
  }
}

Changes

    • info

      added the new elysium enum value to the request property ////

    • info

      added the new elysium enum value to the request property

    • warning

      added the new trailing-stop enum value to the response property for the response status

    • warning

      added the new trailing-stop-limit enum value to the response property for the response status

    • info

      added the new optional request property

    • info

      added the new trailing-stop enum value to the request property ////

    • info

      added the new trailing-stop-limit enum value to the request property ////