Appearance
4swap Action
Swap
yaml
20 bytes: header
---
20~84 bytes: MMISG
16 bytes: fill_asset_id
1 byte : length of route_hash
N bytes: route_hash
8 bytes: minimum
In which,
headeris the header of the action,header.action=0x03.MMISGis the address of the user or the group who will receive the swap result asset.fill_asset_idis the asset id of the asset to be filled.route_hashis the hash_id of the route. The length of the hash is determined by the incoming byte.minimumis the minimum amount of the asset you expect to receive. When encoding, the number should be multiplied by 10^8 and then encoded as an integer.
@TODO: add the route hash implementation here
Add liquidity
yaml
20 bytes: header
---
20~84 bytes: MMISG
16 bytes: asset_id
8 bytes: slippage
2 bytes: timeout
In which,
headeris the header of the action,header.action=0x01.MMISGis the address of the user or the group who will receive the lp token.asset_idis the asset id of the asset to be added.slippageis the maximum slippage of the deposit. When encoding, the number should be multiplied by 10^8 and then encoded as an integer.timeoutis the timeout of the action, in seconds.
Remove liquidity
yaml
20 bytes: header
---
20~84 bytes: MMISG
In which,
headeris the header of the action,header.action=0x02.MMISGis the address of the user or the group who will receive the assets.