curl --request POST \
--url https://flash.definitive.fi/v1/quote \
--header 'Content-Type: application/json' \
--header 'x-definitive-api-key: <api-key>' \
--data '
{
"targetChain": "base",
"contraChain": "base",
"targetAsset": "0x4200000000000000000000000000000000000006",
"contraAsset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
"side": "buy",
"qty": "100",
"orderType": "market",
"funderAddress": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
"maxSlippage": "0.01"
}
'import requests
url = "https://flash.definitive.fi/v1/quote"
payload = {
"targetChain": "base",
"contraChain": "base",
"targetAsset": "0x4200000000000000000000000000000000000006",
"contraAsset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
"side": "buy",
"qty": "100",
"orderType": "market",
"funderAddress": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
"maxSlippage": "0.01"
}
headers = {
"x-definitive-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-definitive-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
targetChain: 'base',
contraChain: 'base',
targetAsset: '0x4200000000000000000000000000000000000006',
contraAsset: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913',
side: 'buy',
qty: '100',
orderType: 'market',
funderAddress: '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045',
maxSlippage: '0.01'
})
};
fetch('https://flash.definitive.fi/v1/quote', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"quoteId": "q_abc123",
"orderType": "market",
"side": "buy",
"targetAsset": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
"contraAsset": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
"from": {
"asset": "target",
"amount": "<string>",
"notional": "<string>"
},
"to": {
"asset": "target",
"amount": "<string>",
"notional": "<string>"
},
"fees": {
"estimatedFeeNotional": "1.50"
},
"estimatedPriceImpact": "0.0042",
"wrap": {
"nativeAsset": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
"wrappedAsset": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
"evmTx": {
"to": "<string>",
"data": "<string>",
"value": "<string>"
},
"svmInstructions": [
{
"programId": "<string>",
"accounts": [
{
"pubkey": "<string>",
"isSigner": true,
"isWritable": true
}
],
"data": "<string>"
}
]
},
"evm": {
"approveTx": {
"to": "<string>",
"data": "<string>"
},
"permitTypedData": "<string>",
"orderTypedData": "<string>"
},
"svm": {
"ataSetupIxs": [
{
"programId": "<string>",
"accounts": [
{
"pubkey": "<string>",
"isSigner": true,
"isWritable": true
}
],
"data": "<string>"
}
],
"delegateIx": {
"programId": "<string>",
"accounts": [
{
"pubkey": "<string>",
"isSigner": true,
"isWritable": true
}
],
"data": "<string>"
},
"sponsoredDelegateTx": "<string>",
"orderMessage": "<string>",
"nonce": "<string>",
"deadline": "<string>"
},
"bridgeQuoteId": "<string>",
"recommendedSlippage": "0.01",
"attachedBracket": {
"evm": {
"approveTx": {
"to": "<string>",
"data": "<string>"
},
"permitTypedData": "<string>",
"orderTypedData": "<string>"
},
"svm": {
"orderMessage": "<string>",
"nonce": "<string>",
"delegateIx": {
"programId": "<string>",
"accounts": [
{
"pubkey": "<string>",
"isSigner": true,
"isWritable": true
}
],
"data": "<string>"
}
},
"salt": "<string>",
"deadline": "<string>",
"signedMaxFromAmount": "<string>"
},
"setupTxs": [
"<string>"
]
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": null
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": null
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": null
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": null
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": null
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": null
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": null
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": null
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": null
}
}Get a quote
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.
curl --request POST \
--url https://flash.definitive.fi/v1/quote \
--header 'Content-Type: application/json' \
--header 'x-definitive-api-key: <api-key>' \
--data '
{
"targetChain": "base",
"contraChain": "base",
"targetAsset": "0x4200000000000000000000000000000000000006",
"contraAsset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
"side": "buy",
"qty": "100",
"orderType": "market",
"funderAddress": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
"maxSlippage": "0.01"
}
'import requests
url = "https://flash.definitive.fi/v1/quote"
payload = {
"targetChain": "base",
"contraChain": "base",
"targetAsset": "0x4200000000000000000000000000000000000006",
"contraAsset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
"side": "buy",
"qty": "100",
"orderType": "market",
"funderAddress": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
"maxSlippage": "0.01"
}
headers = {
"x-definitive-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-definitive-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
targetChain: 'base',
contraChain: 'base',
targetAsset: '0x4200000000000000000000000000000000000006',
contraAsset: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913',
side: 'buy',
qty: '100',
orderType: 'market',
funderAddress: '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045',
maxSlippage: '0.01'
})
};
fetch('https://flash.definitive.fi/v1/quote', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"quoteId": "q_abc123",
"orderType": "market",
"side": "buy",
"targetAsset": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
"contraAsset": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
"from": {
"asset": "target",
"amount": "<string>",
"notional": "<string>"
},
"to": {
"asset": "target",
"amount": "<string>",
"notional": "<string>"
},
"fees": {
"estimatedFeeNotional": "1.50"
},
"estimatedPriceImpact": "0.0042",
"wrap": {
"nativeAsset": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
"wrappedAsset": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
"evmTx": {
"to": "<string>",
"data": "<string>",
"value": "<string>"
},
"svmInstructions": [
{
"programId": "<string>",
"accounts": [
{
"pubkey": "<string>",
"isSigner": true,
"isWritable": true
}
],
"data": "<string>"
}
]
},
"evm": {
"approveTx": {
"to": "<string>",
"data": "<string>"
},
"permitTypedData": "<string>",
"orderTypedData": "<string>"
},
"svm": {
"ataSetupIxs": [
{
"programId": "<string>",
"accounts": [
{
"pubkey": "<string>",
"isSigner": true,
"isWritable": true
}
],
"data": "<string>"
}
],
"delegateIx": {
"programId": "<string>",
"accounts": [
{
"pubkey": "<string>",
"isSigner": true,
"isWritable": true
}
],
"data": "<string>"
},
"sponsoredDelegateTx": "<string>",
"orderMessage": "<string>",
"nonce": "<string>",
"deadline": "<string>"
},
"bridgeQuoteId": "<string>",
"recommendedSlippage": "0.01",
"attachedBracket": {
"evm": {
"approveTx": {
"to": "<string>",
"data": "<string>"
},
"permitTypedData": "<string>",
"orderTypedData": "<string>"
},
"svm": {
"orderMessage": "<string>",
"nonce": "<string>",
"delegateIx": {
"programId": "<string>",
"accounts": [
{
"pubkey": "<string>",
"isSigner": true,
"isWritable": true
}
],
"data": "<string>"
}
},
"salt": "<string>",
"deadline": "<string>",
"signedMaxFromAmount": "<string>"
},
"setupTxs": [
"<string>"
]
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": null
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": null
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": null
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": null
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": null
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": null
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": null
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": null
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": null
}
}Authorizations
Your Definitive API key.
Body
Chain of the target (traded) asset. May differ from contraChain for a cross-chain market order.
arbitrum, avalanche, base, bsc, ethereum, optimism, polygon, solana, hyperevm, plasma, monad, robinhood, ink, arc "ethereum"
Chain of the contra (counter) asset. May differ from targetChain for a cross-chain market order.
arbitrum, avalanche, base, bsc, ethereum, optimism, polygon, solana, hyperevm, plasma, monad, robinhood, ink, arc "ethereum"
Address of the target (traded) asset.
1"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2"
Address of the contra (counter) asset — spent on buys, received on sells.
1"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"
direction of the order
buy, sell "buy"
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.
"1.5"
Order type. Cross-chain orders support market only.
market, limit, twap, stop, stop-loss, take-profit, bracket "market"
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.
Slippage tolerance as a decimal (e.g. 0.05 = 5%). When omitted, our engine sets a slippage at order admission.
Maximum price impact as a decimal (e.g. 0.05 = 5%). When omitted, our engine applies the order-type-specific default at admission.
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).
"4000"
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.
"4000"
Wallet that funds the spent asset on the source chain. The source is contraChain for buys and targetChain for sells.
Address that receives funds on the destination chain. Required when targetChain and contraChain differ.
EVM only. When true, forces the Permit2 signing flow instead of the Flash settlement contract flow. When false or omitted, the server picks the flow from the funder's on-chain state — typically the Flash settlement contract flow. Recommended when forceMinimalAllowance is set. Reach out to the Definitive team to discuss whether to populate this flag.
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.
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.
Integrator fee in basis points (100 = 1%). Maximum 1000 (10%).
"100"
ISO-8601 expiry. Optional for LIMIT and trigger orders (omit for good-til-cancelled).
"2026-05-12T00:00:00Z"
TWAP only. ISO-8601 scheduled execution start. durationSeconds is measured from this time.
"2026-05-12T00:00:00Z"
TWAP only. Required for TWAP; minimum 300 (5 minutes).
x >= 3001800
TWAP only. Number of equal-time buckets. Omit to let the server auto-derive.
2 <= x <= 256012
Price triggers. Each entry requires exactly one of notionalPrice (USD) or crossPrice (pair rate). Required for stop / stop-loss / take-profit (length 1) and bracket (length 2, opposite triggerTypes).
2Show child attributes
Show child attributes
Attach a take-profit / stop-loss pair to the order. The pair protects what the order receives: when a leg's trigger is reached it sells the received asset (at market, or at the leg's limitPrice), and the order stops filling. Supported for market, limit, and twap orders on same-chain quotes; requires funderAddress. The response then carries a second signing payload under attachedBracket.
Show child attributes
Show child attributes
Response
Quote generated successfully
"q_abc123"
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, no limit price. A funder may hold any number of brackets on an asset, each with its own qty.
market, limit, twap, stop, stop-loss, take-profit, bracket buy, sell "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2"
"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"
The spent leg. asset is contra on buys and target on sells.
Show child attributes
Show child attributes
The received (net, post-fee) leg. asset is target on buys and contra on sells.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
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.
"0.0042"
Set when the quote request spends the chain's native gas asset and a pre-trade wrap is needed. On EVM, the spent side is quoted as the wrapped-native token and wrap.evmTx must be sent before submit. On Solana, quotes with svmUseNativeSOL=true include wrap.svmInstructions that wrap the full spend amount into wSOL before signing/submitting. Null otherwise.
Show child attributes
Show child attributes
EVM funding and signing actions. Present when the spent (source) asset is on an EVM chain; null when it is on SVM.
Show child attributes
Show child attributes
SVM funding and signing actions. Present when the spent (source) asset is on Solana; null when it is on EVM.
Show child attributes
Show child attributes
Cross-chain bridge quote identifier. When non-null, pass it as bridgeQuoteId on POST /order.
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.
"0.01"
Signing payload and funding actions for the attached take-profit / stop-loss pair. Present only when the request carried attachedBracket.
Show child attributes
Show child attributes
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.