Mayan Swap

Swap Payload

Following is the structure of payload for swapping tokens from evm based chains this payload will be used as the payload of VAA.
struct Swap {
// for swap this field is 1
uint8 messageType;
// Amount of input token
uint256 amountIn;
// Address of the output token
bytes32 tokenAddress;
// Chain ID of the output token
uint16 tokenChain;
// Address of the mayan swap program
bytes32 to;
// Chain ID of the index fund (currently it's always ETH)
uint16 toChain;
// fee of swapping
uint256 fee1;
// fee of transfering back tokens
uint256 fee2;
// first market address
bytes32 marketAddr1;
// second market address (optional)
bytes32 marketAddr2;
// minimum output token
uint256 amountOutMin;
// sequence of first vaa
uint64 sequence;
// deadline of swap
uint256 deadline;
In all of the payloads, every parameter is encoded in a big-endian manner and every address has been zero left padded to meet the 32 byte size.
Copy link