Memos
Aggregator Memos
Swap Memo (from here)
In order to support SwapOut DEX Aggregation feature, a few more fields added into the swap memo.
SWAP:ASSET:DESTADDR:LIM:AFFILIATE:FEE:DEXAggregatorAddr:FinalTokenAddr:MinAmountOut|
Parameter | Nodes | Conditions |
---|---|---|
| The whitelisted aggregator contract. | Can use the last x characters of the address to fuzz match it. |
| The final token (must be on 1INCH Whitelist) | Can be shortened |
| The parameter to pass into AmountOutMin in AMM contracts. | Handled by the aggregator, so: 1) Can be 0 (no protection). 2) Can be in any decimals. 3) Can be in % or BasisPoints, then converted to a price at the time of swap by the aggregator. |
If you include a vertical pipe (|) at the end of the memo, any data following it will be sent as an outbound memo to the specified outbound address. This feature enables developers to send generic data to contracts cross-chain.
Additional ObserveTxIn field
In order to support SwapOut Dex Aggregation feature safely , a few more fields have been added into tx out item
Also the same fields have been added to ObservedTx
so MAYANode can verify that bifrost did send out the transaction per instruction, use the aggregator per instructed , and pass target asset and target limit to the aggregator correctly
How to swap out with dex aggregator?
If i want to swap CACAO to random ERC20 asset that is not list on MAYAChain , but is list on SushiSwap for example
Note:
Swap asset is
ETH.ETH
2386f3848
is the last nine characters of the aggregator contract address0x0a44986b70527154e9F4290eC14e5f0D1C861822
is the final asset addressKeep in mind SwapOut is best effort, when aggregator contract failed to perform the requested swap , then user will get ETH.ETH instead of the final asset it request
Last updated