Routing
Returns the best route for the given trade pair
Entity
- GETGet supported blockchains. Currently only TON is supported.
- GETReturns list of supported decentralized exchanges supported by the service in the given blockchain
- GETReturns information about the given decentralized exchange for the given blockchain
- GETReturns list of pools which correspond to the given params
- GETReturns trading metrics for pools
- GETReturns information about the given liquidity pool for the given blockchain
- GETReturns list of pools associated with given token
- GETReturns list of tokens supported by the service
- GETReturns information about the given token for the given blockchain
- GETReturns information about the given token by its symbol for the given blockchain
- POSTReturns prices for given tokens
Routing
- POSTReturns the best route for the given trade pair
- POSTReturns the best route for the given list of input tokens and output token
- POSTReturns pre-built transactions for the given route. It is assumed that transactions will be signed and sent by the sender via wallet
- POSTReturns pre-built transaction for the given unstake request. It is assumed that transaction will be signed and sent by the sender via wallet
- POSTReturns pre-built transaction for the given stake request. It is assumed that transaction will be signed and sent by the sender via wallet
- GETGet route transactions execution result
- GETGet route transactions execution result
Profile
Auth
Referral
Claim
Cashback
Contests
Strategies
- GETCheck whether strategies wallet exists for given account address.
- POSTGet pre-built transaction for strategies wallet creation.
- GETChecks whether user is eligible for using strategies
- GETGet list of supported from-tokens for strategies
- GETGet list of supported to-tokens for strategies for given from-token
- GETGet strategy orders
- GETGet strategy order
- POSTGet pre-built transaction for strategy order creation
- DELGet pre-built transaction for strategy order cancellation
- DELCancel strategy order by id. For internal usage only.
- DELCancel all strategy orders by proxy wallet. For internal usage only.
- DELCancel all strategy orders by given token pair. For internal usage only.
- DELCancel all strategy orders. For internal usage only.
- POSTMake a payout from strategy wallet to wallet's owner. For internal usage only.
Partnership
Staking
- GETGet all stakings
- GETGet staking transaction execution result
- GETGet aggregated information about staking
- GETGet aggregated information about staking for specific user
- GETGet user's staking points
- GETGet user's balances of staked tokens
- POSTBuild transaction to create new staking position
- POSTBuild transaction to extend existing position
- DELBuild transaction to close position and withdraw all money
DEX
LiquidityProvisioning
- GETReturn information about user's LP position in pool
- POSTBuild transactions to provide liquidity to the given pool
- DELBuild transaction to withdraw liquidity from the given pool
- GETReturns list of pools from which user may migrate tokens
- POSTBuild transaction to migrate LP to swap.coffee DEX
- GETReturns list of pools that are possible for migration of LP.
- GETReturns pool total supply
- GETReturns status of liquidity provisioning operation
Boosts
- GETReturns pool's aggregated APR
- GETReturns list of boosts for the pool
- GETReturns user's earned boosts in given pool
- POSTBuild transaction to create boost for pool in swap.coffee DEX
- GETGet detailed info about boost. Works for Coffee DEX pools only
- POSTBuild transaction to create stonfi farm position
- DELBuild transaction to close farm position in stonfi
- GETReturns status of new boost creation operation. Works for Coffee DEX pools only
Routing
Returns the best route for the given trade pair
POST
/
v1
/
route
curl --request POST \
--url https://backend.swap.coffee/v1/route \
--header 'Content-Type: application/json' \
--data '{
"input_token": {
"blockchain": "ton",
"address": "native"
},
"output_token": {
"blockchain": "ton",
"address": "native"
},
"input_amount": 1,
"output_amount": 1,
"max_splits": 4,
"max_length": 3,
"pool_selector": {
"blockchains": [
"ton"
],
"dexes": [
"dedust"
],
"max_volatility": 1
},
"mev_protection": true,
"additional_data": {
"sender_address": "UQCNTO0Nh0Z7QNyRW1BLWfk08f2dAOw4izrx9sO6OUPg4DoV",
"referral_name": "tonkeeper"
}
}'
{
"input_token": {
"address": {
"blockchain": "ton",
"address": "native"
},
"metadata": {
"name": "ARBUZ",
"symbol": "ARBUZ",
"decimals": 123,
"image_url": "<string>",
"listed": true
}
},
"output_token": {
"address": {
"blockchain": "ton",
"address": "native"
},
"metadata": {
"name": "ARBUZ",
"symbol": "ARBUZ",
"decimals": 123,
"image_url": "<string>",
"listed": true
}
},
"input_amount": 123,
"output_amount": 123,
"input_usd": 123,
"output_usd": 123,
"savings": 123,
"left_amount": 123,
"recommended_gas": 123,
"price_impact": 123,
"estimated_cashback_usd": 123,
"partner_commission_ton": 123,
"mev_protection_fee": 123,
"paths": [
{
"blockchain": "ton",
"dex": "stonfi",
"pool_address": "<string>",
"input_token": {
"address": {
"blockchain": "ton",
"address": "native"
},
"metadata": {
"name": "ARBUZ",
"symbol": "ARBUZ",
"decimals": 123,
"image_url": "<string>",
"listed": true
}
},
"output_token": {
"address": {
"blockchain": "ton",
"address": "native"
},
"metadata": {
"name": "ARBUZ",
"symbol": "ARBUZ",
"decimals": 123,
"image_url": "<string>",
"listed": true
}
},
"swap": {
"result": "fully_fulfilled",
"input_amount": 123,
"output_amount": 123,
"before_reserves": [
123
],
"after_reserves": [
123
],
"reason": "<string>",
"left_amount": 123
},
"recommended_gas": 123,
"average_gas": 123,
"next": [
{}
]
}
]
}
Authorizations
Body
application/json
Response
200
application/json
resulting route
The response is of type object
.
curl --request POST \
--url https://backend.swap.coffee/v1/route \
--header 'Content-Type: application/json' \
--data '{
"input_token": {
"blockchain": "ton",
"address": "native"
},
"output_token": {
"blockchain": "ton",
"address": "native"
},
"input_amount": 1,
"output_amount": 1,
"max_splits": 4,
"max_length": 3,
"pool_selector": {
"blockchains": [
"ton"
],
"dexes": [
"dedust"
],
"max_volatility": 1
},
"mev_protection": true,
"additional_data": {
"sender_address": "UQCNTO0Nh0Z7QNyRW1BLWfk08f2dAOw4izrx9sO6OUPg4DoV",
"referral_name": "tonkeeper"
}
}'
{
"input_token": {
"address": {
"blockchain": "ton",
"address": "native"
},
"metadata": {
"name": "ARBUZ",
"symbol": "ARBUZ",
"decimals": 123,
"image_url": "<string>",
"listed": true
}
},
"output_token": {
"address": {
"blockchain": "ton",
"address": "native"
},
"metadata": {
"name": "ARBUZ",
"symbol": "ARBUZ",
"decimals": 123,
"image_url": "<string>",
"listed": true
}
},
"input_amount": 123,
"output_amount": 123,
"input_usd": 123,
"output_usd": 123,
"savings": 123,
"left_amount": 123,
"recommended_gas": 123,
"price_impact": 123,
"estimated_cashback_usd": 123,
"partner_commission_ton": 123,
"mev_protection_fee": 123,
"paths": [
{
"blockchain": "ton",
"dex": "stonfi",
"pool_address": "<string>",
"input_token": {
"address": {
"blockchain": "ton",
"address": "native"
},
"metadata": {
"name": "ARBUZ",
"symbol": "ARBUZ",
"decimals": 123,
"image_url": "<string>",
"listed": true
}
},
"output_token": {
"address": {
"blockchain": "ton",
"address": "native"
},
"metadata": {
"name": "ARBUZ",
"symbol": "ARBUZ",
"decimals": 123,
"image_url": "<string>",
"listed": true
}
},
"swap": {
"result": "fully_fulfilled",
"input_amount": 123,
"output_amount": 123,
"before_reserves": [
123
],
"after_reserves": [
123
],
"reason": "<string>",
"left_amount": 123
},
"recommended_gas": 123,
"average_gas": 123,
"next": [
{}
]
}
]
}