Get price for a swap
POST /api/v1/price
Use this API to quickly get the fee data for a cross-chain swap.
- application/json
Request Body required
- from string (chain:token) required
The initial chain and token type. See supported chains.
- to string (chain:token) required
The target chain and token type. See supported chains.
- amount string_of_number required
Amount of tokens to initialize the cross-chain swap.
- fromAddress address
The address on initial chain to initialize the cross-chain swap.
Responses
- 200
- 400
Successful operation
- application/json
- Schema
- Example (from schema)
- Example
Schema
result object
Fee data of this swap
serviceFee string_of_numberFee charged by Meson protocol
lpFee string_of_numberFee charged by liquidity providers on Meson
totalFee string_of_numberTotal fee to be charged
converted optional
For some swap routes (i.e.
arb:usdc
->merlin:btc
) token conversion is allowed.amount string_of_numberAmount of converted token to receive
token stringConverted token
{
"result": {
"serviceFee": "string",
"lpFee": "string",
"totalFee": "string",
"converted": {
"amount": "string",
"token": "string"
}
}
}
{
"result": {
"serviceFee": "0",
"lpFee": "0.005",
"totalFee": "0.005"
}
}
Error
- application/json
- Schema
- Example (from schema)
Schema
error object
code int32message stringdata object
code string
{
"error": {
"code": -1,
"message": "[error_message]",
"data": {
"code": "[error_code]"
}
}
}
Loading...