v1

latestOpenAPI 3.1.02026-07-173814.2 KB
crate::server

Example quote handler

This is an example quote handler that returns a hardcoded quote response

post/quote

Headers

X-API-KEYstring nullable

Optional API Key (if required by the webhook)

Request body

amountstring required
feeBpsinteger required

Fee in basis points to be charged by the Market Maker

protocol'v1' required
quoteIdstring required
quoteType'exactIn' | 'exactOut' required
requestIdstring required
suggestedPrioritizationFeesinteger nullable

If no taker is provided, the there will be no suggested fee This is the suggested compute unit price in micro lamports to be set when building the transaction MMs will have the option to ignore our suggested fee and provide their own when responding to this quote

takerstring nullable

Taker is optional here as there are times we want to just get a quote without user signing in When user signs in, we should try to requote again so the new quote request will have a taker

tokenInstring required
tokenOutstring required

Example request

{
  "amount": "250000000",
  "quoteId": "59db3e19-c7b0-4753-a8aa-206701004498",
  "requestId": "629bddf3-0038-43a6-8956-f5433d6b1191",
  "taker": "5v2Vd71VoJ1wZhz1PkhTY48mrJwS6wF4LfvDbYPnJ3bc",
  "tokenIn": "So11111111111111111111111111111111111111112",
  "tokenOut": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
}

Response

amountInstring required
amountOutstring required
makerstring required
prioritizationFeeToUseinteger nullable

Prioritization fee compute unit price in micro lamports to be set in the fill transaction It is estimated using https://docs.triton.one/chains/solana/improved-priority-fees-api 50th percentile, mean priority fee over the last 20 slots MMs to return us the fees they want to use either the suggested_prioritization_fees in the quote request or a custom amount

protocol'v1' required
quoteIdstring required
quoteType'exactIn' | 'exactOut' required
requestIdstring required
takerstring nullable

Taker is optional here as there are times we want to just get a quote without user signing in

tokenInstring required
tokenOutstring required

Example response

{
  "amountIn": "250000000",
  "amountOut": "1000000000",
  "maker": "8iJxVDtFxnWpdCvdrgNDSXigxHo9vLf7KCS1pNKrs5Nh",
  "quoteId": "59db3e19-c7b0-4753-a8aa-206701004498",
  "requestId": "629bddf3-0038-43a6-8956-f5433d6b1191",
  "taker": "5v2Vd71VoJ1wZhz1PkhTY48mrJwS6wF4LfvDbYPnJ3bc",
  "tokenIn": "So11111111111111111111111111111111111111112",
  "tokenOut": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
}
All 3 operations