> For the complete documentation index, see [llms.txt](https://docs.mayaprotocol.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.mayaprotocol.com/mayachain-dev-docs/aggregators/memos.md).

# Memos

#### Swap Memo (from [here](https://gitlab.com/thorchain/thornode/-/merge_requests/2218))

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                                                                                                                                                                                                |
| -------------------- | --------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `:DEXAggregatorAddr` | The whitelisted aggregator contract.                      | Can use the last x characters of the address to fuzz match it.                                                                                                                                            |
| `:FinalTokenAddr`    | The final token (must be on 1INCH Whitelist)              | Can be shortened                                                                                                                                                                                          |
| `:minAmountOut`      | The parameter to pass into AmountOutMin in AMM contracts. | <p>Handled by the aggregator, so:</p><p>1) Can be 0 (no protection).<br>2) Can be in any decimals.<br>3) Can be in % or BasisPoints, then converted to a price at the time of swap by the aggregator.</p> |

{% hint style="success" %}
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.
{% endhint %}

#### Additional ObserveTxIn field <a href="#user-content-additional-observetxin-field" id="user-content-additional-observetxin-field"></a>

In order to support SwapOut Dex Aggregation feature safely , a few more fields have been added into tx out item

```
[
  {
    "chain": "ETH",
    "to_address": "0x3fd2d4ce97b082d4bce3f9fee2a3d60668d2f473",
    "vault_pub_key": "tthorpub1addwnpepq02wq8hwgmwge6p9yzwscyfp0kjv823kres7l7tcv89nn2zfu3jguu5s4qa",
    "coin": {
      "asset": "ETH.ETH",
      "amount": "19053206"
    },
    "memo": "OUT:EA7D80B3EB709319A6577AF6CF4DEFF67975D4F5A93CD8817E7FF04A048D1C5C",
    "max_gas": [
      {
        "asset": "ETH.ETH",
        "amount": "240000",
        "decimals": 8
      }
    ],
    "gas_rate": 3,
    "in_hash": "EA7D80B3EB709319A6577AF6CF4DEFF67975D4F5A93CD8817E7FF04A048D1C5C",
    "aggregator": "0x69800327b38A4CeF30367Dec3f64c2f2386f3848",    <-------------------- NEW
    "aggregator_target_asset": "0x0a44986b70527154e9F4290eC14e5f0D1C861822", <-------------------- NEW
    "aggregator_target_limit": "1000" <-------------------- NEW , but optional
  }
]
```

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? <a href="#user-content-how-to-swap-out-with-dex-aggregator" id="user-content-how-to-swap-out-with-dex-aggregator"></a>

If i want to swap CACAO to random ERC20 asset that is not list on MAYAChain , but is list on SushiSwap for example

```
mayanode tx mayachain deposit 20000000000000 CACAO '=:ETH.ETH:0x3fd2d4ce97b082d4bce3f9fee2a3d60668d2f473::::2386f3848:0x0a44986b70527154e9F4290eC14e5f0D1C861822' --chain-id mayachain --node tcp://$MAYANODE_IP:26657 --from {from user} --keyring-backend=file --yes --gas 5000000000
```

**Note:**

1. Swap asset is `ETH.ETH`
2. `2386f3848` is the last nine characters of the aggregator contract address
3. `0x0a44986b70527154e9F4290eC14e5f0D1C861822` is the final asset address
4. Keep 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


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.mayaprotocol.com/mayachain-dev-docs/aggregators/memos.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
