Technical Guides
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 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
Routing
- POSTReturns the best route for the given trade pair
- 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.
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
- GETGet address of the vault of the given asset
- POSTBuild transaction to create vault for the given asset
- POSTBuild transactions to create pool of the given asset pair
- DELBuild transaction to withdraw liquidity from the pool of the given asset pair
- PATCHBuild transactions to provide liquidity to the pool of the given asset pair
Returns pre-built transactions for the given route. It is assumed that transactions will be signed and sent by the sender via wallet
curl --request POST \
--url https://backend.swap.coffee/v2/route/transactions \
--header 'Content-Type: application/json' \
--data '{
"sender_address": "UQCNTO0Nh0Z7QNyRW1BLWfk08f2dAOw4izrx9sO6OUPg4DoV",
"slippage": 0.05,
"referral_name": "tonkeeper",
"custom_fee": {
"fixed_fee": "<string>",
"percentage_fee": 123,
"min_percentage_fee_fixed": "<string>",
"max_percentage_fee_fixed": "<string>"
},
"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": [
{}
]
}
]
}'
{
"route_id": 123,
"transactions": [
{
"address": "EQCM3B12QK1e4yZSf8GtBRT0aLMNyEsBc_DhVfRRtOEffLez",
"value": "<string>",
"send_mode": 123,
"query_id": 123
}
]
}
Authorizations
Body
If the slippage is exceeded, the transaction will not be executed and intermediate tokens will be returned to the sender.
0 < x < 1
Value of this field is a response from route building endpoint
Result of the swap
fully_fulfilled
, partially_fulfilled
, unavailable
Result of the swap
fully_fulfilled
, partially_fulfilled
, unavailable
Result of the swap
fully_fulfilled
, partially_fulfilled
, unavailable
May be set whilst building transactions from B2B partnership products
If present, additional transaction for fees collection will be generated. Because of that, be careful with max_splits to not exceed wallet contract limits
Value in nanotons
Value in 1/1000000: 1 is 0.0001%, 1000000 is 100%. If present, can not be less than 10000000 (0.01 TON)
Value in nanotons. No less than this value may be withdrawn as a percentage_fee. Must be set if percentage_fee is present. Can not be less than 10000000 (0.01 TON)
Value in nanotons. If set, no more than this value may be withdrawn as a percentage_fee. Taken into account only if percentage_fee is present
Response
Unique identifier of the route used for tracking.
Amount of nanotons to be sent. Can be passed to TonConnect transaction.
Base64-encoded cell. Treated as a payload field in TonConnect transaction.
Internal message send mode. More: https://docs.ton.org/develop/smart-contracts/messages#message-modes
Unique identifier of the query used for tracking swap.coffee transactions among others
curl --request POST \
--url https://backend.swap.coffee/v2/route/transactions \
--header 'Content-Type: application/json' \
--data '{
"sender_address": "UQCNTO0Nh0Z7QNyRW1BLWfk08f2dAOw4izrx9sO6OUPg4DoV",
"slippage": 0.05,
"referral_name": "tonkeeper",
"custom_fee": {
"fixed_fee": "<string>",
"percentage_fee": 123,
"min_percentage_fee_fixed": "<string>",
"max_percentage_fee_fixed": "<string>"
},
"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": [
{}
]
}
]
}'
{
"route_id": 123,
"transactions": [
{
"address": "EQCM3B12QK1e4yZSf8GtBRT0aLMNyEsBc_DhVfRRtOEffLez",
"value": "<string>",
"send_mode": 123,
"query_id": 123
}
]
}