Reference
Gets a quote for a swap between two tokens given an amount. If a to address is provided, the swap execution data will be included in the response to be used to build the calldata to be executed on-chain. Make sure to not tamper with the arguments provided in the response as it can lead to loss of funds. Only possible to trade whitelisted tokens specified on the /tokens endpoint. Permissionless trading is coming soon. Native token (BERA) is specified as zero address (0x0000000000000000000000000000000000000000)
Input token address
0x0000000000000000000000000000000000000000Example: 0x6969696969696969696969696969696969696969Pattern: ^0x(.*)$Output token address
0x6969696969696969696969696969696969696969Example: 0x6969696969696969696969696969696969696969Pattern: ^0x(.*)$Amount of input token
1000000000000000000Amount of input token
0Amount of input token
1000000000000000000Recipient address, if not set, calldata cannot be generated
0x6969696969696969696969696969696969696969Pattern: ^0x(.*)$Slippage tolerance in decimal between 0 (0%) and 1 (100%), default 0.02 (=2%)
0.02Example: 0.01Slippage tolerance in decimal between 0 (0%) and 1 (100%), default 0.02 (=2%)
0Example: 0.01Slippage tolerance in decimal between 0 (0%) and 1 (100%), default 0.02 (=2%)
0.02Example: 0.01Specify which pool addresses to not use on path finding. Otherwise all will be used by default. Becareful as some pools share the same poolAddress and the blacklist will ignore multiple pools
0x6969696969696969696969696969696969696969Partner referral code
Partner referral code
0Partner referral code
GET /v1/swap?tokenIn=0x6969696969696969696969696969696969696969&tokenOut=0x6969696969696969696969696969696969696969&amount=1000000000000000000 HTTP/1.1
Host: mainnet.api.oogabooga.io
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"status": "Success",
"blockNumber": 1068258,
"tokenFrom": 1,
"tokenTo": 2,
"price": 280,
"priceImpact": -0.025,
"gasPrice": 100000,
"gas": 100000,
"tokens": [
{
"address": "0x6969696969696969696969696969696969696969",
"name": "HONEY",
"symbol": "HONEY",
"decimals": 18
}
],
"amountIn": "1000000000000000",
"amountOutFee": "1000000000000000",
"assumedAmountOut": "1000000000000000",
"hasExecutionParams": true,
"route": [
{
"poolAddress": "0x6969696969696969696969696969696969696969",
"poolType": "Classic",
"poolName": "KodiakV2 0.3%",
"liquiditySource": "KodiakV2",
"poolFee": 0.003,
"tokenFrom": 1,
"tokenTo": 2,
"share": 1,
"assumedAmountIn": "1000000000000000",
"assumedAmountOut": "1000000000000000"
}
],
"tx": {
"to": "0x6969696969696969696969696969696969696969",
"data": "0x095ea7b300000000000000000000000089fe079d1daea2db9cde973e5adaa8e2228938ea0000000000000000000000000000000000000000000000000000000000000001",
"value": "1000000000000000"
},
"routerAddr": "0x6969696969696969696969696969696969696969",
"routerParams": {
"swapTokenInfo": {
"inputToken": "0x6969696969696969696969696969696969696969",
"inputAmount": "1000000000000000",
"outputToken": "0x6969696969696969696969696969696969696969",
"outputQuote": "1000000000000000",
"outputMin": "900000000000000",
"outputReceiver": "0x6969696969696969696969696969696969696969"
},
"pathDefinition": "0x7f746573743200",
"executor": "0x6969696969696969696969696969696969696969",
"referralCode": 1,
"value": "1000000000000000"
}
}Get the list of tokens for trading on the Ooga Booga's Smart Order Routing
GET /v1/tokens HTTP/1.1
Host: mainnet.api.oogabooga.io
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
[
{
"address": "0x6969696969696969696969696969696969696969",
"name": "Honey",
"symbol": "HONEY",
"decimals": 18,
"tokenURI": "https://artio-static-asset-public.s3.ap-southeast-1.amazonaws.com/assets/honey.png"
}
]Last updated