> For the complete documentation index, see [llms.txt](https://docs.chainbot.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.chainbot.io/advanced-features/alarm-notification-template/message-template.md).

# Message Template Variable Summary

### Common Variables for All Monitors:

* $bot
* $alert

### Address Monitor:

* $bot
* $alert
* $chain
* $block
* $tx
* $intent

### Event Monitor:

* $bot
* $alert
* $chain
* $block
* $tx
* $event
* $params

### Block Monitor:

* $bot
* $alert
* $chain
* $block

### Arweave Monitor:

* $bot
* $alert
* $chain
* $block
* $tx

### NFT Monitor:

* $bot
* $alert
* $block
* $nft

### DEX Monitor:

* $bot
* $alert
* $dex

### Value Monitor:

* $bot
* $alert
* $value

### Snapshot Monitor:

* $bot
* $alert
* $Snapshot

## Detailed Description of Variables

### $bot

| param     | type   | comment         |
| --------- | ------ | --------------- |
| $bot.name | string | Name of the Bot |
| $bot.url  | string | Link to the Bot |

### $alert

| param            | type   | comment                                                        |
| ---------------- | ------ | -------------------------------------------------------------- |
| $alert.time      | string | Time the alert was triggered, according to the user's timezone |
| $alert.timestamp | uint64 | Timestamp                                                      |

### $chain

| param           | type   | comment                              |
| --------------- | ------ | ------------------------------------ |
| $chain.type     | string | ethereum                             |
| $chain.chainId  | uint64 | chain\_id                            |
| $chain.symbol   | string | Symbol of the chain's native token   |
| $chain.decimals | int    | Decimals of the chain's native token |
| $chain.explore  | string | Link to the block explorer           |

### $block

| param                 | type    | comment                               |
| --------------------- | ------- | ------------------------------------- |
| $block.hash           | string  | Block hash                            |
| $block.height         | uint64  | Block height                          |
| $block.minter         | string  | Address of the block miner            |
| $block.baseFeePerGas  | float64 | Base fee for this block, in gwei      |
| $block.gasUsedPercent | float64 | Percentage of gas used for this block |

### $tx

| param     | type   | comment                                |
| --------- | ------ | -------------------------------------- |
| $tx.hash  | string | Transaction hash                       |
| $tx.nonce | string | Transaction nonce                      |
| $tx.from  | string | From address                           |
| $tx.to    | string | To address                             |
| $tx.value | string | Transaction value                      |
| $tx.gas   | string | Amount of gas used for the transaction |
| $tx.input | string | Input data for the transaction         |
| …         |        |                                        |

### $event

| param           | type   | comment                                   |
| --------------- | ------ | ----------------------------------------- |
| $event.contract | string | Contract address that triggered the event |
| $event.params   | object | Parsed event parameter object             |

### $params

$params is an alias for $event.params, used to directly access event parameters. The specific parameter names depend on the ABI definition of the smart contract event being monitored.

**Common Event Parameter Examples:**

For ERC20 Token Transfer events:

* $params.from - Transfer sender address
* $params.to - Transfer receiver address
* $params.value - Transfer amount

For Uniswap Swap events:

* $params.sender - Swap initiator
* $params.recipient - Swap receiver
* $params.amount0In - Input amount of token 0
* $params.amount1In - Input amount of token 1
* $params.amount0Out - Output amount of token 0
* $params.amount1Out - Output amount of token 1

**Usage Examples:**

```
🎯 Event Monitor Triggered!
Contract Address: $event.contract
Transaction Hash: $tx.hash
Sender: $tx.from

--- ERC20 Transfer Event ---
From: $params.from
To: $params.to
Amount: $params.value

--- Uniswap Swap Event ---
Swapper: $params.sender
Recipient: $params.recipient
Input Amount 0: $params.amount0In
Input Amount 1: $params.amount1In
Output Amount 0: $params.amount0Out
Output Amount 1: $params.amount1Out

Block Explorer: $chain.explore/tx/$tx.hash
Bot Details: $bot.url
```

### $nft

| param     | type   | comment                                |
| --------- | ------ | -------------------------------------- |
| $tx.hash  | string | Transaction hash                       |
| $tx.nonce | string | Transaction nonce                      |
| $tx.from  | string | From address                           |
| $tx.to    | string | To address                             |
| $tx.value | string | Transaction value                      |
| $tx.gas   | string | Amount of gas used for the transaction |
| $tx.input | string | Input data for the transaction         |
| …         |        |                                        |

### $dex

| param                    | type    | comment                        |
| ------------------------ | ------- | ------------------------------ |
| $dex.name                | string  | DEX name                       |
| $dex.address             | string  | Contract address for DEX swap  |
| $dex.tokenBase.symbol    | string  | Token base symbol              |
| $dex.tokenBase.address   | string  | Token base address             |
| $dex.tokenBase.decimals  | int     | Decimals of the token base     |
| $dex.tokenBase.amount    | decimal | Amount of the token base       |
| $dex.tokenBase.balance   | decimal | Liquidity of the token base    |
| $dex.tokenQuote.symbol   | string  | Token quote symbol             |
| $dex.tokenQuote.address  | string  | Token quote address            |
| $dex.tokenQuote.decimals | int     | Decimals of the token quote    |
| $dex.tokenQuote.amount   | decimal | Amount of the token quote      |
| $dex.tokenQuote.balance  | decimal | Liquidity of the token quote   |
| $dex.value               | decimal | Token quantity                 |
| $dex.USDValue            | decimal | USD value of the token         |
| $dex.price               | decimal | Price                          |
| $dex.priceUSD            | decimal | Price in USD                   |
| $dex.action              | string  | Action                         |
| $dex.tokenIn.symbol      | string  | Incoming token symbol          |
| $dex.tokenIn.address     | string  | Incoming token address         |
| $dex.tokenIn.decimals    | int     | Decimals of the incoming token |
| $dex.tokenIn.amount      | decimal | Amount of the incoming token   |
| $dex.tokenOut.symbol     | string  | Outgoing token symbol          |
| $dex.tokenOut.address    | string  | Outgoing token address         |
| $dex.tokenOut.decimals   | int     | Decimals of the outgoing token |
| $dex.tokenOut.amount     | decimal | Amount of the outgoing token   |
| $dex.direction           | 📈 📉   | Upwards / Downwards            |
| $dex.changed.duration    | string  | Duration of the change         |
| $dex.changed.rate        | decimal | Rate of the change             |
| $dex.changed.direction   | 📈 📉   | Upwards / Downwards            |

### $snapshot

| param                     | type   | comment           |
| ------------------------- | ------ | ----------------- |
| $snapshot.event           | string | Callback event    |
| $snapshot.time            | string | Time              |
| $snapshot.proposal.id     | string | ID                |
| $snapshot.proposal.title  | string | Title             |
| $snapshot.proposal.author | string | Author            |
| $snapshot.proposal.state  | string | State             |
| $snapshot.proposal.event  | string | Event             |
| $snapshot.proposal.space  | string | Space             |
| $snapshot.proposal.link   | string | Link              |
| $snapshot.proposal.body   | string | Content           |
| $snapshot.proposal.start  | string | Start time        |
| $snapshot.proposal.end    | string | End time          |
| $snapshot.space.id        | string | Space ID          |
| $snapshot.space.name      | string | Space name        |
| $snapshot.space.about     | string | Space description |
| $snapshot.space.network   | string | Space network     |
| $snapshot.space.symbol    | string | Space symbol      |

### $value

| param             | type   | comment                                                                                                                                     |
| ----------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------- |
| $value.values     | map    | Formatted values, for dynamic parsing, e.g., $value.values.balance, $value.values\["outpu0"]                                                |
| $value.condition  | string | All condition content converted to string                                                                                                   |
| $value.conditions | map    | Conditions set by the bot converted into a map, with the first field as the key and the condition content as the value in the string format |

### $intent

| param                                 | type   | comment                  |
| ------------------------------------- | ------ | ------------------------ |
| $intent.swap\_intents                 | array  | Array of swap intents    |
| $intent.swap\_intents\[].sender       | string | Sender address           |
| $intent.swap\_intents\[].swap\_type   | string | Type of swap             |
| $intent.swap\_intents\[].buy\_token   | string | Address of token to buy  |
| $intent.swap\_intents\[].buy\_amount  | string | Amount of token to buy   |
| $intent.swap\_intents\[].sell\_token  | string | Address of token to sell |
| $intent.swap\_intents\[].sell\_amount | string | Amount of token to sell  |

**Usage Examples:**

```
Sender: {$intent.swap_intents[0].sender}
Buy Token: {$intent.swap_intents[0].buy_token}
Buy Amount: {$intent.swap_intents[0].buy_amount}
Sell Token: {$intent.swap_intents[0].sell_token}
Sell Amount: {$intent.swap_intents[0].sell_amount}
Swap Type: {$intent.swap_intents[0].swap_type}
```
