Skip to main content

4. Calculate exchange recv

Calculate exchange recv

Calculate the amount the user accepts based on the transfer currency, transfer amount, and receiving currency entered by the user.

POST
/openapi/order/calculate
Request
NameTypeRequiredDescription
exchange_modestringyesExchange mode [ float | fixed ]
from_abbrstringyesCoin name
from_chainstringyesChain name
from_quantityfloatyesQuantity (minimum: 1e-8)
to_addressarrayyesReceiving Address list
to_abbrstringyesReceive coin name
to_addressstringyesReceiving Address
to_chainstringyesReceiving chain name
to_group_ratiofloatyesReceiving group ratio( value>0 or value<= 1 )
to_ratiofloatyesReceiving ratio ( value>0 or value<= 1 )

Request

{
"exchange_mode": "float",
"from_abbr": "ARB",
"from_chain": "Arbitrum",
"from_quantity": 100,
"to_address": [
{
"to_abbr": "ETH",
"to_address": "****************",
"to_chain": "Arbitrum",
"to_group_ratio": 1,
"to_ratio": 1
}
]
}
Response
NameTypeDescription
codeintBusiness status code
dataobjectData Objects
min_from_quantityfloatMinimum order quantity
toarrayReceiving Address list
group_quantityfloatNumber of groups
to_abbrstringReceive coin name
to_addressstringReceiving Address
to_chainstringReceiving chain name
to_group_ratiofloatReceiving group ratio
to_quantityfloatReceive quantity
to_ratiofloatReceiving ratio
msgstringBusiness message

Example Response

{
"code": 0,
"msg": "success",
"data": {
"min_from_quantity": 7,
"to": [
{
"to_chain": "TRON",
"to_abbr": "TRX",
"to_ratio": 1,
"to_group_ratio": 1,
"to_address": "TLxozzoG3Vxy9AqDyiv9fcJZtbTYhAy2rQ",
"to_quantity": 3861.37545,
"group_quantity": 3861.37545
}
]
}
}