Pair
Transaction
Provide Liquidity
Send user’s assets to a Dezswap contract in order to provide liquidity.
Note
- You should increase your allowance of the token before providing liquidity.
- Please read provide initial liquidity carefully so that you can recognize the minimum liquidity deduction if you’re the initial provider for the pair.
The asset can be both a CW20 token and a native token(including IBC token) and the key under info
: token
and native_token
distinguish them.
{
"provide_liquidity": {
"assets": [
{
"info" : {
"token": {
"contract_addr": "<Addr>"
}
},
"amount": "10"
},
{
"info" : {
"native_token": {
"denom": "axpla"
}
},
"amount": "10"
}
],
"receiver": "<Addr>", // optional, LP token receiver
"deadline": 123123, // optional, unix epoch
"slippage_tolerance": "0.005" // optional
}
}
Swap
Swap between the given two tokens. It can be considered as trade.offer_asset
is your source asset and to
is a destination address to receive, which is optional.Base64()
means that this JSON message should be encoded into Base64.
{
"swap": {
"offer_asset": {
"info" : {
"native_token": {
"denom": "axpla"
}
},
"amount": "10"
},
"belief_price": 0.1, // optional
"max_spread": 0.1, // optional
"to": "<Addr>", // optional
"deadline": 123123 // optional, unix epoch
}
}
{
"send": {
"contract": "<Addr>",
"amount": "10",
"msg": Base64({
"swap": {
"offer_asset": {
"info" : {
"token": {
"contract_addr": "<Addr>"
}
},
"amount": "10"
},
"belief_price": 0.1, // optional
"max_spread": 0.1, // optional
"to": "<Addr>", // optional
"deadline": 123123 // optional, unix epoch
}
})
}
}
Query
Pool
{
"pool": {}
}
Pair
{
"pair": {}
}
Simulation
{
"simulation": {
"offer_asset": {
"info" : {
"token": {
"contract_addr": "<Addr>"
}
},
"amount": "10"
}
}
}
Reverse Simulation
{
"reverse_simulation": {
"ask_asset": {
"info" : {
"token": {
"contract_addr": "<Addr>"
}
},
"amount": "10"
}
}
}