# Transaction Bot Monitoring

### What is Transaction Bot Monitoring?

Transaction Bot Monitoring is primarily used for on-chain transaction monitoring.

### Typical Scenarios of Transaction Bot Monitoring

1. Monitoring transactions from a specific sender
2. Monitoring transactions to a specific recipient
3. Sending alerts when ETH is greater than or less than a target threshold
4. Monitoring transactions with a specific methodId

**Supported Data Sources**

| Data Source   | Type     | Stability |
| ------------- | -------- | --------- |
| Ethereum      | on chain | Very High |
| BSC           | on chain | High      |
| Avalanche     | on chain | High      |
| Polygon Pos   | on chain | High      |
| Arbitrum      | on chain | High      |
| Optimism      | on chain | High      |
| Polygon zkEVM | on chain | High      |
| ZkSync Era    | on chain | High      |
| Base          | on chain | High      |
| Scroll        | on chain | High      |
| Manta         | on chain | High      |
| ZKFair        | on chain | High      |
| Blast         | on chain | High      |
| Linea         | on chain | High      |
| B2            | on chain | High      |
| Merlin        | on chain | High      |

### How to Configure Transaction Bot Monitoring?

After logging into the ChainBot platform, click "Create Bot" at the top right corner -> "Transaction Monitor".

<figure><img src="https://3957434529-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fytm2ftx9VGhS1jFp37FQ%2Fuploads%2Fgit-blob-8301096f262b3245cff624c8aa1d5cab302e31d0%2Fcreate-tx-monitor.png?alt=media" alt=""><figcaption><p>Create a Transaction Bot</p></figcaption></figure>

#### Info Description

| Field    | Description                            | Required |
| -------- | -------------------------------------- | -------- |
| Name     | Bot Monitoring Name                    | Yes      |
| Chain    | Selected Chain                         | Yes      |
| Contract | Selected Smart Contract Address        | Yes      |
| Function | Selected Smart Contract Method         | Yes      |
| Tags     | Bot Monitoring Tags, for better search | Yes      |

#### Conditions Description

<table><thead><tr><th>Parameter</th><th width="202.33333333333331">Symbol</th><th>Description</th></tr></thead><tbody><tr><td>From</td><td>==, in</td><td>Sender address of the transaction; formats differ between chains</td></tr><tr><td>To</td><td>==, in</td><td>Recipient address of the transaction</td></tr><tr><td>Value</td><td>>, >=, &#x3C;, &#x3C;=, ==, !=, in</td><td>Value of the transaction in wei, 1 ETH == 1000000000000000000 wei</td></tr><tr><td>methodId</td><td>==, in</td><td>Method ID of the transaction, must be a 4-byte string starting with 0x, e.g., 0x95d89b41</td></tr><tr><td>data</td><td>Optional</td><td>Complete string</td></tr></tbody></table>

#### Template Variables Description

<table><thead><tr><th width="331">Variable</th><th>Description</th></tr></thead><tbody><tr><td>$subscription.name</td><td>Subscription name, typically the same as the Bot Monitoring name</td></tr><tr><td>$chain.explore</td><td>Blockchain explorer prefix</td></tr><tr><td>$chain.network</td><td>Chain chainId</td></tr><tr><td>$block.time</td><td>Block time at which the transaction occurred</td></tr><tr><td>$tx.hash</td><td>Transaction hash</td></tr><tr><td>$tx.height</td><td>Block height at which the transaction occurred</td></tr><tr><td>$tx.nonce</td><td>Transaction nonce value</td></tr><tr><td>$tx.from</td><td>Sender address of the transaction</td></tr><tr><td>$tx.to</td><td>Recipient address of the transaction</td></tr><tr><td>$tx.value</td><td>Transaction amount in Ether, use $tx.value/1e18 for ETH units</td></tr><tr><td>$tx.gas</td><td>Gas fee consumed by the transaction</td></tr><tr><td>$tx.gasPrice</td><td>Gas price of the transaction</td></tr><tr><td>$tx.input</td><td>Input data of the transaction</td></tr><tr><td>$tx.type</td><td>Transaction type</td></tr><tr><td>$tx.accessList</td><td>Supported for some transactions</td></tr><tr><td>$tx.chainId</td><td>Chain ID of the transaction</td></tr><tr><td>$tx.maxFeePerGas</td><td>Available in EIP-1559</td></tr><tr><td>$tx.maxPriorityFeePerGas</td><td>Available in EIP-1559</td></tr><tr><td>$tx.r</td><td>R value of the transaction signature</td></tr><tr><td>$tx.s</td><td>S value of the transaction signature</td></tr><tr><td>$tx.v</td><td>V value of the transaction signature</td></tr><tr><td>$tx.method</td><td>Transaction method name</td></tr></tbody></table>

#### Default Alert Template

```
[{$bot.name}]
From: {$tx.from}
To: {$tx.to}
Detail: {$parsed.message}
Method: {$tx.method}
Status: {$tx.status}
Explore: {$chain.explore}/tx/{$tx.hash}
Time: {$alert.time}
```

[Learn about alert notification templates?](https://github.com/ChainbotAI/doc-en/blob/master/advanced-features/alarm-notification-template/README.md)

#### Notification Message Example

> \[ Transaction Monitor ]\
> Name: mim Minting Monitor\
> From: 0xfddfe525054efaad204600d00ca86adb1cc2ea8a\
> To: 0x5f0dee98360d8200b20812e174d139a1a633edd2\
> Method: execTransaction(address,uint256,bytes,uint8,uint256,uint256,uint256,address,address,bytes)\
> Explore: <https://etherscan.io/tx/0x5a1a9f01fd3fad6fa3909bcdd284e8023eedf9797d94458a13bb6df929d80a1a>\
> Time: 2022-05-10 22:40:29 +0800 CST
>
> Created By [ChainBot.io](https://www.chainbot.io)

#### Transaction Bot Monitoring Case

[transaction-bot-demo](https://docs.chainbot.io/bot-case/transaction-bot-demo "mention")
