Skip to content

GET /quote

What a buy or sale gets right now. Sends nothing.

GET https://marketmayhem.co/api/v1/quote
NameInRequiredMeaning
tokenqueryyesThe token
sidequeryyes
amountqueryyesWhole units of the exact side
exactqueryDefault in
slippageBpsqueryDefault 50
FieldTypeRequiredMeaning
tokenobjectyesThe token traded
token.addressstringyesA 0x address
token.symbolstringyes
token.poolstringyesA 0x address
token.feeTierintegeryes
token.pairobjectyes
token.pair.addressstringyesThe pair currency’s contract (WBNB for BNB)
token.pair.decimalsintegeryesIts decimals
token.pair.symbolstringyesIts symbol, e.g. BNB
sidebuy · sellyesbuy: pay the pair currency, get the token; sell: the reverse
exactin · outyesin: pay is fixed; out: receive is fixed
slippageBpsintegeryesThe tolerance the limit is set from
payobjectyesWhat is spent
pay.amountstringyesA decimal amount in whole units, as a string: “0.05”
pay.weistringyesThe same amount in the smallest unit, an integer as a string
pay.symbolstringyesThe currency, e.g. BNB or the token’s ticker
receiveobjectyesWhat comes back, at the price now
receive.amountstringyesA decimal amount in whole units, as a string: “0.05”
receive.weistringyesThe same amount in the smallest unit, an integer as a string
receive.symbolstringyesThe currency, e.g. BNB or the token’s ticker
limitobjectyesThe floor (or ceiling) written into the trade: it reverts rather than fill worse
limit.amountstringyesA decimal amount in whole units, as a string: “0.05”
limit.weistringyesThe same amount in the smallest unit, an integer as a string
limit.kindminReceive · maxPayyes
siteFeeobjectyesThe site fee this trade pays
siteFee.amountstringyesA decimal amount in whole units, as a string: “0.05”
siteFee.weistringyesThe same amount in the smallest unit, an integer as a string
siteFee.symbolstringyesThe currency, e.g. BNB or the token’s ticker
siteFee.bpsintegeryesIts rate, in basis points
priceImpactPctnumberyesHow far this trade moves the price, in per cent

Captured from BSC testnet, exactly as the API sent it (long calldata shortened).

{
"token": {
"address": "0x136bfd5f42250a568ce06ed1b145729b400e391c",
"symbol": "BRNT",
"pool": "0x0c779f6d50f5d27df85a84e8fc15e66202076e6d",
"feeTier": 10000,
"pair": {
"address": "0xae13d989dac2f0debff460ac112a837c89baa7cd",
"decimals": 18,
"symbol": "BNB"
}
},
"side": "buy",
"exact": "in",
"slippageBps": 50,
"pay": {
"amount": "0.001",
"wei": "1000000000000000",
"symbol": "BNB"
},
"receive": {
"amount": "3548145.668617171169913355",
"wei": "3548145668617171169913355",
"symbol": "BRNT"
},
"limit": {
"kind": "minReceive",
"amount": "3530404.940274085314063788",
"wei": "3530404940274085314063788"
},
"siteFee": {
"amount": "0.00001",
"wei": "10000000000000",
"symbol": "BNB",
"bps": 100
},
"priceImpactPct": 0.7534
}

Every error is { "error": { "code", "message", "fix"? } }. This endpoint can answer: