# ChainBot Introduction

<https://chainbot.io>

ChainBot is a powerful real-time data monitoring and alert platform. It allows you to customize and automate the monitoring of on-chain or third-party platform data according to your needs and provides real-time feedback and alerts through your configured channels, enabling you to stay on top of your project's progress.

ChainBot currently supports the following major categories of monitoring:

> 1. [On-chain Event Bot Monitoring](/basic-usage/bots/event-bot)
> 2. [On-chain DEX Bot Monitoring](/basic-usage/bots/dex-bot)
> 3. [On-chain Transaction Bot Monitoring](/basic-usage/bots/transaction-bot)
> 4. [On-chain Value Bot Monitoring](/basic-usage/bots/value-bot)
> 5. [NFT Bot Monitoring](/basic-usage/bots/nft-bot)
> 6. [Third-party Snapshot Bot Monitoring](/basic-usage/bots/snapshot-bot)
> 7. [On-chain Block Bot Monitoring](/basic-usage/bots/block-bot)
> 8. [On-chain Arweave Bot Monitoring](/basic-usage/bots/arwwave-bot)

### What key issues does ChainBot address?

> The ChainBot platform is designed to be more flexible and general at the underlying level. The scenarios below are just frequent use cases; for more functionalities, please read the content of "Monitoring/Bots."

1. A whale withdraws a large amount of liquidity from the pool, requiring timely notifications for the next steps.
2. Real-time price change alerts in DEX; for instance, when a new shitcoin is listed in the DEX, you need to monitor its price closely.
3. Monitoring when the NFT floor price drops below the issuance price.
4. High-quality article monitoring alerts on Mirror, allowing you to learn new content promptly.
5. Monitoring hacker address activities; for example, when the FTX hacker address has fund transfers, you need to receive alert notifications immediately.
6. Send alert notifications when the concerned project executes a corresponding proposal on Snapshot, instead of manually refreshing the official UI intermittently.

### Terminology

1. **Bot**

   A set of continuous monitoring rules and alert templates for different categories of data is called a Bot. Bots can be private or public; public Bots can be subscribed to by any user. When a Bot meets the configured conditions, alerts will be sent to all Subscriptions that subscribed to that Bot according to the user's alert channel settings.
2. **Condition(s)**

   The conditions for a Bot to trigger an alert;

   Condition(s) support the comparison of multiple fields. When multiple fields are filled out, the logic for triggering the alert is "AND," meaning an alert will only be triggered when Condition A and Condition B are both met;
3. **Subscription**

   Users need to set up the method and frequency of Bot alerts through Subscriptions. A Subscription can only belong to one Bot, but a Bot can be subscribed to multiple times by different users;
4. **List**

   A List is a collection of multiple Bots. Users can set different types of Bots in different Lists according to their needs for easy management.
5. **Fork**

   Fully copying all data from the original Bot.
6. **Contract**

   Smart contracts deployed on the blockchain.
7. **Notify Channel**

   Alert channels and configurations for receiving messages, such as Slack/Pushover;
8. **Notify Template**

   The template content of the subscription alert notification. When configuring a Bot, the platform will automatically generate a default alert template, which users can modify according to their needs.
9. **DataSources**

   Data sources supported by the underlying architecture of the ChainBot platform.


# Quick Start

You can find your target Bot through the platform's Discover page or via the search function at the top. If there isn't a Bot that meets your needs, you can create a new one yourself.

### How to configure a Bot?

Based on ChainBot's definition of a Bot, here's what we should do:

1. [Set the alert notification channel for your account](https://github.com/ChainbotAI/doc-en/blob/master/broken-reference/README.md)
2. [Choose the category for Bot monitoring](/basic-usage/bots)
3. Configure the data source for Bot monitoring (supported data sources are listed within the various types of Bots)
4. [Set the required contract information for the Bot (if necessary)](/basic-usage/contracts-mange)
5. [Set the trigger conditions for Bot monitoring alerts (Condition(s))](/advanced-features/conditions-description)
6. [Modify the default alert template for Bot monitoring based on current needs](/advanced-features/alarm-notification-template)
7. [After creating the Bot monitoring, subscribe to the notifications for that Bot](/basic-usage/subs)

### Finding Bots via Discover

<figure><img src="/files/WTrsV7bSWahVZYRnM26r" alt=""><figcaption><p>Discover</p></figcaption></figure>

### Searching for Bots

<figure><img src="/files/oDv10iHBHloPMrkwBR0u" alt=""><figcaption><p>Search</p></figcaption></figure>

### Quick Learning Cases

> Below are examples of all Bot monitoring types. You can learn how to configure Bot monitoring here. However, we strongly recommend that you review the entire documentation before configuring.

[ChainBot all Bot monitoring cases.](https://chainbot.io/list/43)


# Monitoring/Bot

Bot is a monitoring configuration within ChainBot.

The basic components of a Bot include three parts: Info, Condition(s), and Notify Template. Users can configure the parameters of the Bot based on their needs.

Currently, ChainBot supports the following types of Bot monitoring:

| Bot Type                   | DataSource Type                                |
| -------------------------- | ---------------------------------------------- |
| Event Bot Monitoring       | On-chain Data Source                           |
| Dex Bot Monitoring         | On-chain Data Source                           |
| Transaction Bot Monitoring | On-chain Data Source                           |
| Block Bot Monitoring       | On-chain Data Source                           |
| Arweave Bot Monitoring     | On-chain Data Source                           |
| NFT Bot Monitoring         | Mixed Data Source (Ethereum + OpenSea)         |
| Snapshot Bot Monitoring    | Third-party Data Source (Snapshot Data Source) |


# 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="/files/3obMYmHYUmC0Hm7BNQ9L" 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 Example](/bot-case/transaction-bot-demo)


# Event Bot Monitoring

### What is Event Bot Monitoring?

> An event refers to an event in a smart contract, triggered when a certain transaction occurs. Users can track these events to trace transactions.

Event Monitoring listens for specific behaviors on-chain by monitoring events emitted by smart contracts.

### Typical Scenarios for Event Bot Monitoring

1. Defi Liquidity Event Monitoring
   1. Defi liquidity exceeds a set threshold.
   2. Defi liquidity falls below a set threshold.
2. NFT Mint Event Monitoring
   1. A specific NFT starts minting.
3. Token Mint Event Monitoring
   1. Large token unlock monitoring.
4. Others, etc.

#### 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 Event Bot Monitoring?

After logging in to the ChainBot platform, select "Create Bot" in the upper right corner -> "Event Monitor".

<figure><img src="/files/tMjjjX333g3cDM5xbGXS" alt=""><figcaption><p>Chosen Event Monitor</p></figcaption></figure>

⚠️ Note

When a specific Event is selected, Conditions will automatically parse the fields contained in that Event, limited to the Event's fields. Therefore, Event and Conditions have a corresponding relationship.

#### Info Description

| Field Name | Description                                | Required |
| ---------- | ------------------------------------------ | -------- |
| Name       | Monitoring Bot Name                        | Yes      |
| Chain      | Selected Chain                             | Yes      |
| Contract   | Selected Contract                          | Yes      |
| Event      | Selected Event                             | Yes      |
| Tags       | Bot monitoring tags, beneficial for search | Yes      |

#### Conditions Description

Conditions in Event Monitoring dynamically change based on the selected Event.

For example, when monitoring the Approval event in the USDT contract, as the parameters of Event Approval(owner: address, spender: address, value: uint256) are three, the available fields in conditions are also three, namely owner, spender, value. Configure your parameters based on your conditions to achieve your purpose.

#### Template Variables Description

| Variable            | Description                               | Example                 |
| ------------------- | ----------------------------------------- | ----------------------- |
| $alert.time         | Block in which the event occurred         | 16073651                |
| $tx.hash            | Transaction hash generating the event     | transaction hash        |
| $event.contract     | Contract address where the event occurred | 16073651                |
| $event.params.{abc} | Key fields parsed from the event          | $event.params.tokens    |
| $chain.explore      | Current chain explorer prefix             | <https://etherscan.io/> |

#### Default Notification Template

```
[ {$bot.name} ]
Contract: {$event.contract}
Time: {$alert.time}
Explore: {$chain.explore}/tx/{$tx.hash}
```

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

#### Notification Message Example

> \[ CRV Liquidation Call Monitor ]\
> Contract: 0x7d2768dE32b0b80b7a3454c06BdAc94A69DDc7A9\
> Amount: 187743.2161384799 CRV\
> Time: 2022-11-23T02:09:23+08:00\
> Explore: <https://etherscan.io/tx/0x47ffc7939cf8deed6a28357934f98402892b370ac2d3be0c6576f733f6d97b1e>\
> Created By [ChainBot.io](http://chainbot.io/)

#### Event Bot Monitoring Case Study

[Event Bot Example](/bot-case/event-bot-demo)


# DEX Bot Monitoring

### What is DEX Bot Monitoring?

DEX Bot Monitoring is a type of monitoring designed for DEX scenarios. Its main function is to monitor relevant events on decentralized exchanges (DEX).

### Typical Scenarios for DEX Bot Monitoring

1. Monitoring high-value transactions on a DEX
2. Monitoring significant liquidity removals on a DEX
3. Monitoring significant percentage changes in liquidity on a DEX
4. Monitoring liquidity thresholds on a DEX
5. Monitoring price fluctuations on a DEX

#### 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      |
| Base        | on chain | High      |
| ZKFair      | on chain | High      |
| Blast       | on chain | High      |

#### Supported Swaps

| Chain       | Dex                                  |
| ----------- | ------------------------------------ |
| Ethereum    | UniswapV2, UniswapV3, Sushiswap      |
| BSC         | Pancakeswap V2                       |
| Avalanche   | TraderJoe, Pangolin                  |
| Polygon PoS | UniswapV2, UniswapV3, MMF, Quickswap |
| Arbitrum    | UniswapV3, Sushiswap, Chronos        |
| Optimism    | UniswapV3                            |
| Base        | UniswapV3                            |
| ZKFair      | SideSwap                             |
| Blast       | Thruster                             |

### How to Configure DEX Bot Monitoring?

After logging in to the ChainBot platform, go to the upper right corner and select "Create Bot" -> "Dex Monitor".

<figure><img src="/files/AbwdEHbTQNpgOVBYs1Go" alt=""><figcaption><p>Create Dex Monitor</p></figcaption></figure>

**Info Description**

| Field Name | 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, helpful for search | Yes      |

#### Conditions Description

| Price     | Below                | Price of specified token in the dex is below the set threshold                                  |
| --------- | -------------------- | ----------------------------------------------------------------------------------------------- |
|           | Above                | Price of specified token in the dex is above the set threshold                                  |
|           | ChangeRisesRate      | Percentage increase in the price of the specified token in the dex                              |
|           | ChangeDropsRate      | Percentage decrease in the price of the specified token in the dex                              |
|           | ChangeRisesDropsRate | Percentage increase or decrease in the price of the specified token in the dex, monitoring both |
| Liquidity | Below                | Liquidity is below the set threshold                                                            |
|           | Above                | Liquidity is above the set threshold                                                            |
|           | ChangeRisesRate      | Percentage increase in liquidity of the specified pair in the dex                               |
|           | ChangeDropsRate      | Percentage decrease in liquidity of the specified pair in the dex                               |
|           | ChangeRisesDropsRate | Percentage increase or decrease in the liquidity of the specified pair in the dex               |
|           | WhaleAdd             | Large liquidity addition                                                                        |
|           | WhaleRemove          | Large liquidity removal                                                                         |
|           | WhaleAddRemove       | Large liquidity addition or removal                                                             |
| Swap      | WhaleSell            | Large sell                                                                                      |
|           | WhaleBuy             | Large buy                                                                                       |
|           | WhaleBuySell         | Large buy and sell                                                                              |

**Template Variables Description**

| $tokenBase.symbol    | Symbol of tokenBase, e.g., WBTC                                                       |
| -------------------- | ------------------------------------------------------------------------------------- |
| $tokenBase.decimals  | Decimals of tokenBase, e.g., 18                                                       |
| $tokenBase.address   | On-chain address of tokenBase                                                         |
| $tokenQuote.symbol   | Symbol of tokenQuote, e.g., WETH                                                      |
| $tokenQuote.decimals | Decimals of tokenQuote, e.g., 18                                                      |
| $tokenQuote.address  | On-chain address of tokenQuote                                                        |
| $tokenQuote.balance  | Balance of tokenQuote (only supported during liquidity changes)                       |
| $tokenIn.symbol      | Symbol of tokenIn, e.g., WBTC                                                         |
| $tokenIn.decimals    | Decimals of tokenIn, e.g., 18                                                         |
| $tokenIn.address     | On-chain address of tokenIn                                                           |
| $tokenOut.symbol     | Symbol of tokenOut, e.g., WETH                                                        |
| $tokenOut.decimals   | Decimals of tokenOut, e.g., 18                                                        |
| $tokenOut.address    | On-chain address of tokenOut                                                          |
| $dex.name            | Name of the DEX, e.g., Uniswap                                                        |
| $value               | Amount of target token exchanged in the dex                                           |
| $price               | Exchange price of the target token, valued in base token wei units                    |
| $priceUSD            | Exchange price of the target token, valued in USD                                     |
| $changed.duration    | Time range of the indicator change                                                    |
| $changed.rate        | Percentage rate of the indicator change                                               |
| $action              | Behaviour of the monitoring indicator, add (addition) / remove (removal) / buy / sell |

#### Terminology Description

1. tokenBase: The base token, e.g., in a WBTC/WETH trading pair, WBTC is the tokenBase.
2. tokenQuote: The token that prices the base token, e.g., in a WBTC/WETH trading pair, WETH is the tokenQuote.
3. tokenIn: In the dex, when using the swap function, swapping a for b, a is tokenIn and b is tokenOut. That is, putting token a into the liquidity pool and taking token b out of the liquidity pool. For example, when swapping WBTC/WETH, WBTC is tokenIn and WETH is tokenOut.
4. tokenBase, tokenQuote, tokenIn, tokenOut are all ERC20 tokens, therefore, they all have standard ERC20 methods like name, symbol, decimals, address.

#### Default Alert Templates

High-Value Swap - WhaleSwap

{% code overflow="wrap" lineNumbers="true" %}

```shell
[ 🐳 {$bot.name} ]
Pair: {$dex.tokenBase.symbol}/{$dex.tokenQuote.symbol} on {$dex.name}
Value: {$dex.value} USD
Action: {$dex.tokenIn.amount} {$dex.tokenIn.symbol} -> {$dex.tokenOut.amount} {$dex.tokenOut.symbol} at price {$dex.price} USD
Explore: {$chain.explore}/tx/{$tx.hash}
```

{% endcode %}

Large Liquidity - WhaleAdd/WhaleRemove/WhaleAdRemove

{% code overflow="wrap" lineNumbers="true" %}

```shell
[ 🐳 {$bot.name} ]
Pair: {$dex.tokenBase.symbol}/{$dex.tokenQuote.symbol} on {$dex.name}
Value: {$dex.value} USD
Action: {$dex.tokenIn.amount} {$dex.tokenIn.symbol} -> {$dex.tokenOut.amount} {$dex.tokenOut.symbol} at price {$dex.price} USD
Explore: {$chain.explore}/tx/{$tx.hash}
Created By ChainBot.org
```

{% endcode %}

Large Percentage Liquidity - WhaleAddPercent/WhaleRemovePercent/WhaleAddRemovePercent

{% code overflow="wrap" lineNumbers="true" %}

```shell
[ 🐳 {$bot.name} ]
Pair: {$dex.tokenBase.symbol}/{$dex.tokenQuote.symbol} on {$dex.name}
Value: {$dex.value} USD
Action: {$dex.action} more than {$dex.changed.rate}% liquidity to pool
Explore: {$chain.explore}/tx/{$tx.hash}
Created By ChainBot.org
```

{% endcode %}

Liquidity Threshold - Above/Below

{% code overflow="wrap" lineNumbers="true" %}

```shell
[ {$bot.name}  ]
📉📈 {$dex.tokenBase.symbol}/{$dex.tokenQuote.symbol} liquidity on {$dex.name} above/below {$dex.changed.rate} in the past {$dex.changed.duration}
current liquidity is {$dex.tokenQuote.balance} {$dex.tokenQuote.symbol}
```

{% endcode %}

Liquidity Fluctuation Ratio - ChangeRisesRate/ChangeDropsRate/ChangeRisesDropsRate

{% code overflow="wrap" lineNumbers="true" %}

```shell
[ {$bot.name}  ]
📉📈 {$dex.tokenBase.symbol}/{$dex.tokenQuote.symbol} liquidity on {$dex.name} {$dex.direction} {$dex.changed.rate} in the past {$dex.changed.duration}
current liquidity is {$dex.tokenQuote.balance} {$dex.tokenQuote.symbol}
```

{% endcode %}

Price Fluctuation - ChangeRisesRate/ChangeDropsRate/ChangeRisesDropsRate

{% code overflow="wrap" lineNumbers="true" %}

```shell
[ {$bot.name} ]
📉📈 {$dex.tokenBase.symbol}/{$dex.tokenQuote.symbol} price on {$dex.name} {$dex.direction} {$dex.changed.rate} in the past {$dex.changed.duration}
current price is {$dex.price} {$dex.tokenQuote.symbol}
```

{% endcode %}

Price Threshold Monitoring - Above/Below

{% code overflow="wrap" lineNumbers="true" %}

```shell
[ {$bot.name} ]
📉📈 {$dex.tokenBase.symbol}/{$dex.tokenQuote.symbol} price on {$dex.name} {$dex.direction} {$dex.setPrice}. 
current price {$dex.price} USD.
```

{% endcode %}

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

#### Notification Message Example

> \[ 🐳 Whale swap on Uniswap ETH/USDT pool ]\
> Pair: WETH/USDT on UniswapV3\
> Value: 51.237884 USD\
> Action: 0.0404716445741972 WETH -> 51.237884 USDT at price 1266.019321405753878 USD\
> Explore: <https://etherscan.io/tx/0xef1cd8f1edfbfa7fc2efe74b814c3535c333921cedae9aaad66a9d969ab885b8>\
> Created By [ChainBot.io](https://www.chainbot.io)

#### Dex Bot Monitoring Cases

[Dex Bot Example](/bot-case/dex-bot-demo)


# Value Bot Monitoring

### What is Value Bot Monitoring?

Value Bot Monitoring is a type of monitoring designed for numerical changes. Its main function is to monitor the value changes of a certain object, and when the value change reaches a preset threshold, an alert will be triggered.

### Typical Scenarios for Value Bot Monitoring

1. Monitoring Token balance changes
2. Monitoring the percentage change of Curve stablecoins

#### 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 Value Bot Monitoring?

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

<figure><img src="/files/CD3ActsH4Ywc7Ef7MlQZ" alt=""><figcaption><p>Create a Value Bot</p></figcaption></figure>

**Info Description**

<table><thead><tr><th width="183.33333333333331">Field Name</th><th width="280">Description</th><th>Required</th></tr></thead><tbody><tr><td>Name</td><td>Bot Monitoring Name</td><td>Yes</td></tr><tr><td>Chain</td><td>Selected Chain</td><td>Yes</td></tr><tr><td>Contract</td><td>Selected Smart Contract Address</td><td>Yes</td></tr><tr><td>Function</td><td>Selected Smart Contract Method</td><td>Yes</td></tr><tr><td>Interval</td><td>Data point interval, fetching data from the configured data source at each interval</td><td>Yes</td></tr><tr><td>Baseline Trigger</td><td>If this item is selected, the trigger condition is taken as the baseline. Once the value reaches the baseline, it will not be repeatedly triggered. It will only trigger again if it leaves and re-enters the baseline.</td><td>Yes</td></tr><tr><td>Fields</td><td>Numeric fields to be processed</td><td>Yes</td></tr><tr><td>Tags</td><td>Bot Monitoring tags for easy search</td><td>Yes</td></tr></tbody></table>

#### Fields Description

> Comprises multiple Field fields, each Field is an object containing field and formater types. The formater is a piece of js code; the user needs to define the code to format the final value.

#### Built-in Functions

<table><thead><tr><th width="305">Function Name</th><th>Description</th></tr></thead><tbody><tr><td>tokenPrice(symbol)</td><td>Gets the USD-based price of the token, such as tokenPrice('weth')</td></tr><tr><td>bot(botId)</td><td>References the content of a specific Bot, such as bot('1')</td></tr><tr><td>add(x,y)</td><td>x+y</td></tr><tr><td>sub(x,y)</td><td>x-y</td></tr><tr><td>mul(x,y)</td><td>x*y</td></tr><tr><td>div(x,y)</td><td>x/y &#x26;&#x26; y != 0</td></tr><tr><td>pow(x,y)</td><td>x^y</td></tr></tbody></table>

#### Supported USD-based Tokens

> Automatically gets the USD-based price of tokens. The data source comes from the highest liquidity trading pairs on the chain, with more tokens to be supported in the future.

| Token  | Pool                                                                                      |
| ------ | ----------------------------------------------------------------------------------------- |
| WBTC   | [WBTC/BUSD](https://bscscan.com/address/0xF45cd219aEF8618A92BAa7aD848364a158a24F33)       |
| WETH   | [WETH/USDT](https://etherscan.io/address/0x0d4a11d5eeaac28ec3f61d100daf4d40471f1852)      |
| WBNB   | [WBNB/BUSD](https://bscscan.com/address/0x58F876857a02D6762E0101bb5C46A8c1ED44Dc16)       |
| WMATIC | [WMATIC/USDC](https://polygonscan.com/address/0x6e7a5FAFcec6BB1e78bAE2A1F0B612012BF14827) |
| WAVAX  | [WAVAX/USDC](https://snowtrace.io/address/0xf4003F4efBE8691B60249E6afbD307aBE7758adb)     |
| WFTM   | [WFTM/USDC](https://ftmscan.com/address/0x2b4c76d0dc16be1c31d4c1dc53bf9b45987fc75c)       |
| CAKE   | [CAKE/USDC](https://bscscan.com/address/0xa39af17ce4a8eb807e076805da1e2b8ea7d0755b)       |

**Conditions Description**

The field parsing in conditions is dynamic and will change with the content configured in Fields. The Key of the Condition is the content of the Field, and both are consistent. The value in the condition is the threshold set by the user. When comparing values, the system uses the value formatted by the Field formater and compares it with the value in the condition. Therefore, users need to be aware of unit conversions when configuring.

**Template Variables Description**

| $subscription.name | Subscription Name, usually the same as the Bot Monitoring Name |
| ------------------ | -------------------------------------------------------------- |
| $block.height      | Block Height                                                   |
| $value.{}          | Formatted value, dynamically parsed, e.g., $value.balance      |
| $condition         | All condition content is converted to a string                 |
| $alert.time        | Block Time                                                     |

#### Default Alert Template

```
[{$bot.name}]
Block: {$block.height}
Values:{$value.values.ltv}
Condition: {$value.condition}
Time: {$alert.time}
```

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

#### Notification Message Example

> \[ENS Governance ETH Balance > 35000 ETH]
>
> Block: 16046035
>
> Balance: 35335.915888
>
> Condition: (5m) balance last > 35000
>
> Time: 2022-11-25T17:14:30+08:00
>
> Created By [ChainBot.io](https://www.chainbot.io)

#### Value Bot Monitoring Examples

[Value Bot Example](/bot-case/value-bot-demo)


# NFT Bot Monitoring

### What is NFT Bot Monitoring?

NFT Bot Monitoring is primarily designed to track changes in NFT prices, order updates, and ownership transfers.

### Typical Scenarios for NFT Bot Monitoring

1. Monitoring changes in NFT floor prices
   1. BAYC NFT floor price is greater than 100E
   2. BAYC NFT floor price is less than 100E
2. Monitoring NFT transfers
   1. BAYC #1 is transferred from Address A to Address B
3. Monitoring offers received by specific NFT owners
4. Monitoring the actions of target addresses buying NFTs

**Supported Data Sources**

| Data Source | Type     | Stability |
| ----------- | -------- | --------- |
| Ethereum    | on chain | Very High |

#### Supported Data Sources

| Data Source | Type     | Stability |
| ----------- | -------- | --------- |
| Ethereum    | On-chain | Very High |

#### Supported Markets

| Market  | Stability |
| ------- | --------- |
| OpenSea | High      |

*\*We are planning to support more markets.*

### How to Configure NFT Bot Monitoring?

After logging into the ChainBot platform, go to the upper right corner and click "Create Bot" -> "NFT Monitor".

<figure><img src="/files/cbp06RJYj2cUQgfesc3f" alt=""><figcaption><p>Create a NFT Bot</p></figcaption></figure>

#### Info Description

| Field Name | Description                                 | Required |
| ---------- | ------------------------------------------- | -------- |
| Name       | Bot Monitor Name                            | Yes      |
| Chain      | Select a supported blockchain               | Yes      |
| Contract   | Select an NFT contract, ERC 721 or ERC 1155 | Yes      |
| Market     | NFT trading market                          | Yes      |
| Event      | Type of NFT event                           | Yes      |
| Tags       | Tags for the Bot Monitor, useful for search | Yes      |

#### Event Types

<table><thead><tr><th width="313">Type</th><th>Description</th></tr></thead><tbody><tr><td>Listed</td><td>NFT is listed</td></tr><tr><td>MetadataUpdated</td><td>NFT metadata is updated</td></tr><tr><td>Sold</td><td>NFT is sold</td></tr><tr><td>Transferred</td><td>NFT ownership is transferred</td></tr><tr><td>ReceivedBid</td><td>Received a bid</td></tr><tr><td>ReceivedOffer</td><td>Received an offer</td></tr><tr><td>Cancelled</td><td>NFT listing is cancelled</td></tr><tr><td>FloorPrice</td><td>Collection floor price</td></tr></tbody></table>

#### Conditions Description

| Parameter    | Symbol       | Description         |
| ------------ | ------------ | ------------------- |
| makerAddress | ==           | Maker address       |
| takerAddress | ==           | Taker address       |
| price        | >, >=, <, <= | NFT price           |
| token\_id    | ==           | Token ID of the NFT |

#### Template Variables

<table><thead><tr><th width="283">Variable</th><th width="467">Description</th></tr></thead><tbody><tr><td>$taker.address</td><td>Taker address</td></tr><tr><td>$maker.address</td><td>Maker address</td></tr><tr><td>$collection.slug</td><td>NFT identifier on the platform</td></tr><tr><td>$item.opensea_link</td><td>Link to the item page on OpenSea</td></tr><tr><td>$item.token_id</td><td>Extract the final token ID from item.nft_id</td></tr><tr><td>$payment.symbol</td><td>Payment symbol, usually WETH</td></tr><tr><td>$payment.price</td><td>Sale price or base price, user needs to handle decimals</td></tr><tr><td>$payment.usd_price</td><td>Corresponding original payment.usd_price field</td></tr><tr><td>$quantity</td><td>Quantity of tokens, always 1 for ERC 721, could be multiple for ERC 1155</td></tr><tr><td>$transaction.hash</td><td>On-chain transaction hash</td></tr><tr><td>$transaction.timestamp</td><td>RFC3339 format timestamp</td></tr><tr><td>$subscriptions.name</td><td>Bot Monitor name</td></tr><tr><td>$monitor.market</td><td>Market monitored by the Bot, currently OpenSea</td></tr><tr><td>$event.type</td><td>Value listed like Listed, etc.</td></tr><tr><td>$event.timestamp</td><td>RFC3339 format timestamp</td></tr><tr><td>$chain.explore</td><td>Blockchain explorer prefix, <a href="https://etherscan.io/">https://etherscan.io/</a></td></tr></tbody></table>

#### Default Alert Template

{% code overflow="wrap" lineNumbers="true" %}

```shell
[{$bot.name}]
New {$nft.event} event for {$nft.slug} #{$nft.token_id} at {$nft.market}
View : {$nft.market_link}
Time: {$alert.time}
```

{% endcode %}

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

#### Notification Message Example

> \[ Listed monitor for BAYC ]\
> New Listed event for friendship-bracelets-by-alexis-andre #24805 at opensea\
> View : <https://opensea.io/collection/friendship-bracelets-by-alexis-andre>\
> Time: 2022-11-30T14:07:23+08:00\
> Created By [ChainBot.io](https://www.chainbot.io)

#### NFT Bot Monitoring Case

[NFT Bot Monitoring](/basic-usage/bots/nft-bot)


# Snapshot Bot Monitoring

### What is Snapshot Bot Monitoring?

Snapshot Bot Monitoring is used to monitor Snapshot proposals. It can monitor the creation of new proposals as well as changes in the status of existing proposals.

[Learn how Snapshot works](https://docs.snapshot.org/)

### Typical Scenarios for Snapshot Bot Monitoring

1. New proposal creation
2. Proposal entering the voting phase
3. Proposal voting ends
4. Proposal being deleted

**Supported Data Sources**

| Data Source | Type      | Stability |
| ----------- | --------- | --------- |
| Snapshot    | off chain | High      |

### How to Configure Snapshot Bot Monitoring?

After logging into the ChainBot platform, click on "Create Bot" -> "Snapshot Monitor" in the top right corner.

<figure><img src="/files/DNudKAgrtOivCSxrf70J" alt=""><figcaption><p>Create a Snapshot Bot</p></figcaption></figure>

#### Info Explanation

| Field | Description                                          | Required |
| ----- | ---------------------------------------------------- | -------- |
| Name  | Bot monitoring name                                  | Yes      |
| Space | Snapshot platform space name, usually an ENS domain. | Yes      |
| Tags  | Bot monitoring tags for easy search                  | Yes      |

#### Conditions Explanation

<table><thead><tr><th>Field</th><th width="249.33333333333331">Description</th><th>Required</th></tr></thead><tbody><tr><td>Event</td><td>Supported proposal status</td><td>Yes</td></tr></tbody></table>

#### Event Types

| Type             | Description                           |
| ---------------- | ------------------------------------- |
| proposal/created | New proposal created                  |
| proposal/start   | Proposal enters voting                |
| proposal/end     | Proposal voting ends                  |
| proposal/deleted | Proposal deleted                      |
| Any              | Superclass of the above four statuses |

#### Template Variables

<table><thead><tr><th width="219.33333333333331">Variable</th><th width="208">Description</th><th>Example</th></tr></thead><tbody><tr><td>$proposal.id</td><td>Proposal ID</td><td>proposal/0x38c654c0f81b63ea1839ec3b221fad6ecba474aa0c4e8b4e8bc957f70100e753</td></tr><tr><td>$proposal.title</td><td>Proposal title</td><td>SIP#20 Continued Balance and Rebalancing</td></tr><tr><td>$proposal.author</td><td>Proposal author</td><td>pistachiodao.eth</td></tr><tr><td>$proposal.state</td><td>Proposal state</td><td>proposal/created</td></tr><tr><td>$proposal.network</td><td>Proposal network, as ChainID</td><td>1</td></tr><tr><td>$proposal.link</td><td>Snapshot proposal link</td><td><a href="https://snapshot.org/#/stgdao.eth/proposal/0x714977397be501e7f854293401370ab89d8c9261f533d7bb551d0c29ade5755f">https://snapshot.org/#/stgdao.eth/proposal/0x714977397be501e7f854293401370ab89d8c9261f533d7bb551d0c29ade5755f</a></td></tr><tr><td>$event</td><td>Proposal status</td><td>proposal/created</td></tr><tr><td>$space</td><td>Proposal's space</td><td>pistachiodao.eth</td></tr><tr><td>$time</td><td>Proposal creation time</td><td>2022-11-29T03:20:46+08:00</td></tr></tbody></table>

#### Default Notification Template

{% code overflow="wrap" lineNumbers="true" %}

```shell
[{$bot.name}]
Proposal: {$snapshot.proposal.title}
Space: {$snapshot.space.id}
Event: {$snapshot.event}
Time: {$snapshot.time}
Detail: {$snapshot.proposal.link}
```

{% endcode %}

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

#### Sample Notification Message

> \[ Stargate new proposal]
>
> Proposal: SIP #16 - New Assets - DAI, FRAX, sUSD, LUSD
>
> Space: stgdao.eth
>
> Event: proposal/created
>
> Time: 2022-09-30T19:23:47+08:00
>
> Detail: <https://snapshot.org/#/stgdao.eth/proposal/0xe6fef4aa9c8e9d162f694ab764b11c06918b9f199aafe43e0d85b12d8271011c>
>
> Created By [ChainBot.io](https://www.chainbot.io)

#### Snapshot Bot Monitoring Case

[Snapshot Bot Example](/bot-case/snapshot-bot-demo)


# Block Bot Monitoring

### What is Block Bot Monitoring?

Block Bot Monitoring is used to track the gas consumption of blocks in the target chain, thereby allowing for the prediction of possible situations on the chain.

### Typical Scenarios for Block Bot Monitoring

1. Monitoring the value of block Gas Fees
2. Monitoring the proportion of block gas consumption relative to the maximum block limit
3. Monitoring the block miner

**Supported Data Sources**

| Data Source | Type     | Stability |
| ----------- | -------- | --------- |
| Ethereum    | on chain | Very High |

### How to Configure Block Bot Monitoring?

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

<figure><img src="/files/SHPPDI797hZomYq0Mf9y" alt=""><figcaption><p>Create a Block Bot</p></figcaption></figure>

#### Info Description

| Field Name | Description                    | Required |
| ---------- | ------------------------------ | -------- |
| Name       | Bot Monitoring Name            | Yes      |
| Chain      | User-selected chain            | Yes      |
| Tags       | Bot monitoring tags for search | Yes      |

#### Conditions Description

| Parameter      | Symbol           | Description                            |
| -------------- | ---------------- | -------------------------------------- |
| Miner          | ==               | Monitor blocks mined by specific miner |
| BlockNumber    | >, >=, <, <=, == | Block height                           |
| BaseFeePerGas  | >, >=, <, <=, == | Block Gas Fee                          |
| GasUsedPercent | >, >=, <, <=, == | Proportion of gas used in the block    |

#### Template Variable Description

| Variable              | Description                         |
| --------------------- | ----------------------------------- |
| $block.number         | Block height                        |
| $block.baseFeePerGas  | Block gas fee                       |
| $block.gasUsedPercent | Percentage of gas used in the block |
| $block.miner          | Miner address                       |
| $block.time           | Block creation time                 |

#### Default Alert Template

```
[{$bot.name}]
View: https://etherscan.io/block/{$block.height}
Time: {$alert.time}
```

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

#### Notification Message Example

> \[ Ethereum Base Fee monitor ]\
> BaseFee: 10.35 Gwei\
> View: <https://etherscan.io/block/16081313>\
> Time: 2022-11-30T11:28:11+04:00\
> Created By [ChainBot.io](https://www.chainbot.io)

#### Block Bot Monitoring Case

[Block Bot Example](/bot-case/block-bot-demo)


# Arweave Bot Monitoring

### What is Arweave Bot Monitoring?

Arweave is a decentralized storage chain where users can monitor content stored on it using tags on Arweave.

[Learn more about Arweave?](https://www.arweave.org/)

### Typical Scenarios for Arweave Bot

1. Monitoring Mirror articles
2. Monitoring other lightweight data stored on Arweave

Note:

Users of Arweave may store large files on the chain, such as PDFs, mp4 formats, etc. Currently, the ChainBot platform does not support parsing content of large file types.

**Supported Data Sources**

| Data Source | Type     | Stability |
| ----------- | -------- | --------- |
| Arweave     | on chain | Very High |

### How to Configure Arweave Bot Monitoring?

After logging into the ChainBot platform, click on the upper-right corner "Create Bot" -> "Arweave Monitor."

<figure><img src="/files/IxU1vb3GAfDJyzu54NQ5" alt=""><figcaption><p>Create a Arweave Bot</p></figcaption></figure>

#### Info Description

| Field Name | Description                            | Required |
| ---------- | -------------------------------------- | -------- |
| Name       | Bot monitoring name                    | Yes      |
| Tags       | Bot monitoring tags, useful for search | Yes      |

#### Tags Conditions Description

<table><thead><tr><th>Parameter</th><th width="233.33333333333331">Symbol</th><th>Description</th></tr></thead><tbody><tr><td>App-Name</td><td>==, in</td><td>Application name tagged by Arweave users on Arweave, e.g., Mirror uses the tag "mirrorxyz"</td></tr><tr><td>Contributor</td><td>==, in</td><td>Contributor of content on Arweave, for example, the author of an article in Mirror</td></tr><tr><td>Original-Content-Digest</td><td>empty, notEmpty</td><td>When content on Arweave is updated, the digest of the initial push content will be tagged as Original-Content-Digest</td></tr></tbody></table>

#### Data Conditions Description

Users can filter content entities stored on Arweave based on their own conditions. For example, if you want to monitor articles with the keyword Aptos on Mirror, you should fill it in as:

<figure><img src="/files/L3fr6Ue0nViYJkYlutMe" alt=""><figcaption><p>Conditions Demo</p></figcaption></figure>

#### Template Variables Description

<table><thead><tr><th width="340">Variable</th><th>Description</th></tr></thead><tbody><tr><td>$data.{}</td><td>Data information retrieved from specific content on Arweave, dynamically parsed</td></tr><tr><td>$tags.{}</td><td>The value of any tag parsed from Arweave, dynamically parsed</td></tr><tr><td>$tx.id</td><td>Transaction ID on Arweave</td></tr><tr><td>$tx.owner.address</td><td>Initiator of the transaction on Arweave</td></tr><tr><td>$block.id</td><td>Block hash generated on Arweave</td></tr><tr><td>$block.timestamp</td><td>Timestamp of the block generated on Arweave</td></tr><tr><td>$block.height</td><td>Height of the block generated on Arweave</td></tr></tbody></table>

#### Default Alarm Template

```
[{$bot.name}]
{$data.authorship.contributor} published new article
Title: {$data.content.title}
View: https://mirror.xyz/{$data.authorship.contributor}/{$tags.original_content_digest}
Time: {formatTime($data.content.timestamp)}
```

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

#### Notification Message Example

> \[ Aptos Mirror Monitoring ]
>
> 0x7620D7991a8469ef7F26B5Da7952e27C16074367 published a new article aptos1021
>
> View: <https://mirror.xyz/0x7620D7991a8469ef7F26B5Da7952e27C16074367/HvyIBgIbHud_9oyx6_MSyuFFWONKFeqtRdUniZmX7lE>
>
> Time: 1669643104
>
> Created By [ChainBot.io](https://www.chainbot.io)

#### Arweave Bot Monitoring Case

[Arweave Bot Example](/bot-case/arweave-bot-demo)


# Lists

You can create a List and manage the Lists you have created.


# Create List

### How to create a List?

After logging into the ChainBot platform, go to your personal page, select "My Lists" -> "+ Add List".

<div align="left" data-full-width="false"><figure><img src="/files/3khdhWQkfgjLBGCFxyv0" alt=""><figcaption><p>Create a List</p></figcaption></figure></div>

<figure><img src="/files/vc9a8TRId13AAP93gXI7" alt=""><figcaption><p>Create a List</p></figcaption></figure>

#### Information required when creating a List

<table><thead><tr><th width="187">Field Name</th><th>Description</th><th>Required</th></tr></thead><tbody><tr><td>Name</td><td>The name of the List</td><td>Yes</td></tr><tr><td>Description</td><td>A detailed description of the List</td><td>Yes</td></tr></tbody></table>


# Manage List

### Edit List

After logging into the ChainBot platform, go to the personal page and choose "My Lists". Select the specific Card, then choose “Edit”.

<figure><img src="/files/s6b1kyIbxxq1Wo2KGNx9" alt=""><figcaption></figcaption></figure>

### Delete List

After logging into the ChainBot platform, go to the personal page and choose "My Lists". Select the specific Card, then choose “Delete”.

### Subscribe to List

After logging into the ChainBot platform, go to the personal page and choose "My Lists". Select the specific Card, then click the “Subscribe” button to subscribe to all content under that List.


# Contract Management

Contract

To facilitate users in flexibly using ChainBot to build their own monitoring system, ChainBot maintains contract information on various blockchains.

By default, ChainBot will automatically fetch the ABI information of smart contracts. It also supports manually filling in the relevant content of smart contracts.


# Add Contract

### How to Add a Contract

1. After logging in, you will see the "Custom Contract" option on the left in the user interface. Click on this tab to enter the configuration page.
2. Click the "Add Custom Contract" button in the top right corner and fill in the relevant information for the smart contract.

<figure><img src="/files/sIt9UQh5e2HR0dQN6vbm" alt=""><figcaption><p>Add Contract</p></figcaption></figure>

<figure><img src="/files/SmjBiY5SLUv9VE1TOHT4" alt=""><figcaption><p>Add Contract</p></figcaption></figure>

Explanation of contract fields

<table><thead><tr><th width="208">Field</th><th>Description</th><th>Example</th></tr></thead><tbody><tr><td>Name</td><td>Custom contract name</td><td>CurveStablecoin3pool</td></tr><tr><td>Chain</td><td>Select the chain supported by the ChainBot platform</td><td>Ethereum, BSC, etc.</td></tr><tr><td>Address</td><td>Contract address</td><td>0xdAC17F958D2ee523a2206206994597C13D831ec7</td></tr><tr><td>ABI</td><td>Contract-related ABI information in JSON format</td><td>[]</td></tr><tr><td>Functions / Events</td><td>Functions and events defined by the contract</td><td>function getOwner();<br>event Issue(uint amount);</td></tr></tbody></table>


# Manage Contract

In the Contracts list on the personal page, you can see all the Contracts you have created. Here you can edit and delete the Contracts you have created.

<figure><img src="/files/oG5ZAzC4EaN6bMuEmP6I" alt=""><figcaption><p>Manage Contracts</p></figcaption></figure>


# Notify Channels

Alert notifications are a crucial component of ChainBot. For a comprehensive monitoring setup, notifications are an essential part.

ChainBot supports user configuration for instant messaging apps like Slack, Discord, Telegram, and Dingtalk. It also supports professional notification products such as Pushover and Pagerduty, as well as custom Webhook pushes defined by users.

ChainBot supports simultaneous pushes to multiple channels. Once this setting is completed, all monitors can use any of the related channels.

<figure><img src="/files/BEMNvUsVAh3tXMtwNY1o" alt=""><figcaption></figcaption></figure>


# Email

### How to set up Email?

Fill in the Email address and name on the ChainBot platform.

<figure><img src="https://github.com/ChainbotAI/doc-en/blob/master/.gitbook/assets/Email.png" alt=""><figcaption></figcaption></figure>


# Slack

### How to set up Slack?

Click on the "Click here to connect your slack" area, proceed to the Slack authorization, and select the channel where ChainBot will receive messages.

<figure><img src="/files/EnPMJJvyd2QmaMant7NB" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/TWUAJ3AJ3dsAerdiGVSh" alt=""><figcaption><p>Select a channel</p></figcaption></figure>


# Discord

### How to Set Up Discord?

When pushing messages to the Discord service, users need to create a new Webhook connection within the specified Discord server. The configuration process is as follows:

1. Create a Webhook link on the specified Discord server. (If you do not have a Discord server, please create one.)
2. Copy the Webhook link to the ChainBot platform and fill in the name of the Webhook.

<figure><img src="/files/9PmTaI7HO50ySBqyhgwL" alt=""><figcaption></figcaption></figure>

### How to Create a Webhook in Discord

1. Open "Server Settings" -> APP -> "Integrations" on the specified server in Discord.
2. Click on "New Webhook".

   <figure><img src="/files/LiDOK7FUbC0NbpKTC9Oc" alt=""><figcaption><p>Create Webhook</p></figcaption></figure>

To distinguish different types of alerts, users can set the following content for the Webhook:

1. Set an avatar.
2. Set the Webhook nickname that will receive messages.
3. Set the designated Channel in Discord that will receive the message push.

<figure><img src="/files/ou8gU9N1wknD1GubNnOE" alt=""><figcaption><p>Setting Webhook</p></figcaption></figure>


# Telegram

## Telegram Push Types

1. [User (Message sent to an individual user)](#set-user)
2. [Group (Message sent to a group)](#set-group)
3. [Channel](#set-channel)[ (Message sent to a channel)](#set-channel)
4. [Bot (Create your own branded TG Bot)](#set-bot)

For push notifications of types 1 User, 2 Group, 3 Channel, messages are sent through ChainBot's official [Telegram Bot](https://t.me/chainbot_bot).

For type 4 Bot, you can configure a TG Bot branded for yourself, allowing you to spread it to more individuals, groups, and channels.

### How to Set Up User? <a href="#set-user" id="set-user"></a>

1. Choose Chat Type as User.
2. Click Get Chat ID and it will redirect you to the Telegram app.
3. After choosing "Start," you will receive a message from ChainBot that includes the Chat ID.
4. Copy the Chat ID and fill it in the ChainBot platform.

<figure><img src="/files/qzMllh7kjQyer3qhv20b" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/qs7iJjj40q9vfarcCrvS" alt=""><figcaption><p>Got your Chat ID</p></figcaption></figure>

<figure><img src="/files/PmesOgAnSSoYs12XTpGc" alt=""><figcaption></figcaption></figure>

### How to Set Up Group? <a href="#set-group" id="set-group"></a>

1. Choose Chat Type as Group.
2. Add the ChainBot bot to the Group.
3. Groups are divided into **Private** and **Public** types, first confirm the type of Group.
4. If it's a Private Group, you need to fill in the **Chat ID with a minus sign,** e.g., -123456.
5. If it's a Public Group, you need to fill in the **Group Name with an @ symbol,** e.g., @chainbot\_group.
6. Copy the Chat ID with a minus sign or the Group Name with @ symbol and fill it in on the ChainBot platform.

#### Adding the ChainBot Bot to the Group

<figure><img src="/files/QlKiOdJLTawbtQChEoVg" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/yYf7oK0XEZLvrWT1UZbq" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/LKQts843OXoObQK9sjdN" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/fejPWcsH9UXS4u76JvVG" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/t2nghQSXPRtnhwsq6SE0" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/uTdC6jwFt8JN4xWZZKnT" alt=""><figcaption></figcaption></figure>

#### Confirming the Type of Group <a href="#confirm-group-type" id="confirm-group-type"></a>

<figure><img src="/files/ksUtuQ9Rv0wleb7xvfZ8" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/CImvb3u2M1EbFoEPzfze" alt=""><figcaption></figcaption></figure>

#### Getting the Chat ID or Group Name

**You need to open Telegram on the web,** [**https://web.telegram.org/**](https://web.telegram.org/)

Get the Group Name of the Public Group from the web URL, e.g., @chainbot\_public\_group

<figure><img src="/files/IQ7ph0lDZ6GSuFrt0NPp" alt=""><figcaption></figcaption></figure>

Get the Chat ID of the Private Group from the web URL, e.g., -811463215

<figure><img src="https://github.com/ChainbotAI/doc-en/blob/master/.gitbook/assets/image%20(2)%20(1).png" alt=""><figcaption></figcaption></figure>

#### Fill in the Chat ID or Group Name on the ChainBot platform

<figure><img src="/files/6BfywJ75mFRcvi44Tw0K" alt=""><figcaption></figcaption></figure>

### How to Set Up Channel? <a href="#set-channel" id="set-channel"></a>

1. Choose Chat Type as Channel (steps are the same as Group).
2. Add the ChainBot bot to the Channel, **and set it as an admin** (steps are the same as Group).
3. Channels are divided into Private and Public types, **messages can only be pushed to Public Channels,** first confirm the Channel type (steps are the same as Group).
4. If it's a Public Channel, you need to fill in the **Channel Name with an @ symbol,** e.g., @chainbot\_channel (steps are the same as Group).

### How to Set Up Bot <a href="#set-bot" id="set-bot"></a>

1. First, you need to create your own Telegram Bot. Refer to Telegram's [official tutorial](https://core.telegram.org/bots/features#creating-a-new-bot).
2. After creating your own Bot using [BotFather](https://t.me/BotFather), you will see the API Token for this Bot. Or, you can choose the recently created Bot again from the /mybots menu command to view this API Token.

   <figure><img src="/files/DInIpc8k3n0ejKLRbCQR" alt=""><figcaption></figcaption></figure>
3. Copy the API Token, return to ChainBot, choose "Bot" as Chat Type, and paste the API Token in the corresponding input box. Click Save.

   <figure><img src="/files/yErsj50Hj1YN4kKfsDKc" alt=""><figcaption></figcaption></figure>
4. After saving successfully, you can control whether your Bot pushes messages in the current chat session using the `/start` and `/stop` commands. For example, you can add this Bot to a group, and as an admin, send the `/start` command in the group. The TG Bot will then send your monitoring messages in the group.

   <figure><img src="/files/MdD6PAKGc3RcaPnHGTkI" alt=""><figcaption></figcaption></figure>


# DingTalk

### How to set up DingTalk?

1. Log in to DingTalk to get the Secret and Webhook URL.
2. Configure the relevant information on the ChainBot platform.

<figure><img src="/files/MeAqpTrosChx8jv4Wojx" alt=""><figcaption></figcaption></figure>

#### How to get the Secret and Webhook URL of DingTalk?

[For details, please refer to DingTalk's official documentation.](https://open.dingtalk.com/document/robots/custom-robot-access)


# Pushover

### How to set up Pushover?

1. Log in to [Pushover](https://pushover.net/) to obtain the Pushover <mark style="color:purple;">**Key**</mark>**.**
2. Create an Application in Pushover and obtain the Application <mark style="color:purple;">**Token**</mark>.
3. Enter the Key and Token into the ChainBot platform.

<figure><img src="/files/89RZ0JK4CoH3Yrwe6iMb" alt=""><figcaption></figcaption></figure>

#### How to obtain the Pushover Key and Token

1. After logging into Pushover, you can see the Key on the homepage.

   <figure><img src="/files/JsNnWe8BG3eZPHRf531b" alt=""><figcaption><p>Get your Key and Token from Pushover</p></figcaption></figure>
2. Click "Create an Application/API Token" to create an Application or choose an existing Application.
3. View the Application to see the Token.

   <figure><img src="/files/U6n4NXd5ZOrru2QbVitC" alt=""><figcaption><p>Get the Token from your application detail page</p></figcaption></figure>


# Pagerduty

### How to set up Pagerduty?

1. Log in to the [Pagerduty](https://www.pagerduty.com/) platform and obtain the Pagerduty **token**.
2. Fill in the token and name on the ChainBot platform.

<figure><img src="/files/34sgMeux3ys42JKEDyFP" alt=""><figcaption></figcaption></figure>


# Webhook

### How to set up a Webhook?

Simply fill in the Webhook URL.

<figure><img src="/files/Z6woz1ol4BGUFoW4rOME" alt=""><figcaption></figcaption></figure>


# Lark

### How to set up Lark?

Simply fill in the Webhook URL.

<figure><img src="/files/SRTLShtKKt1f56dvJfwQ" alt=""><figcaption></figcaption></figure>


# Cobo Argus

### How to set up Cobo Argus?

<figure><img src="/files/39MmXGeydlAcnW1cAPNg" alt=""><figcaption></figcaption></figure>


# Subscription

In Chainbot, you can subscribe to the bot, select the notification channel you created, and set the subscription frequency.

<figure><img src="/files/vKG8V7ElgyQxCg0mv5rE" alt=""><figcaption></figcaption></figure>

#### Alert Subscription Field Description

| Field              | Description                                             | Example        |
| ------------------ | ------------------------------------------------------- | -------------- |
| Name               | Subscription name, title of notification                | Aptos Mirror   |
| Subscription Group | Subscription group                                      |                |
| Conditions         | Subscription condition values can be adjusted as needed | As shown above |
| Frequency          | Frequency of receiving alerts                           | Always         |
| Actions            | Platforms to receive alerts                             | Discord        |

#### Alert Subscription Frequency Description

> You can choose the frequency of message reception based on the importance of monitoring.

<table><thead><tr><th width="149">Frequency</th><th>Description</th></tr></thead><tbody><tr><td>Always</td><td>You will receive a message for every generated alert</td></tr><tr><td>OnlyOnce</td><td>Only receive one message; further alerts will not be sent</td></tr><tr><td>5m</td><td>Receive a message every 5 minutes; if multiple alerts are generated within 5 minutes, only one message will be received</td></tr><tr><td>10m</td><td>Receive a message every 10 minutes; if multiple alerts are generated within 10 minutes, only one message will be received</td></tr><tr><td>30m</td><td>Receive a message every 30 minutes; if multiple alerts are generated within 30 minutes, only one message will be received</td></tr><tr><td>1h</td><td>Receive a message every hour; if multiple alerts are generated within 1 hour, only one message will be received</td></tr><tr><td>4h</td><td>Receive a message every 4 hours; if multiple alerts are generated within 4 hours, only one message will be received</td></tr><tr><td>12h</td><td>Receive a message every 12 hours; if multiple alerts are generated within 12 hours, only one message will be received</td></tr><tr><td>24h</td><td>Receive a message every 24 hours; if multiple alerts are generated within 24 hours, only one message will be received</td></tr></tbody></table>


# Fork Bot

When users find that the Bots available in Discover or through search do not fully meet their needs, they can choose to quickly Fork the current Bot. At this time, the ChainBot platform will duplicate the current Bot's configuration data and automatically switch to the editing page. Users can then modify the relevant parameters based on this, achieving the goal of quickly configuring the Bot.

<figure><img src="/files/xOndJdYi9G4SSDNgWIpa" alt=""><figcaption><p>Fork a Bot</p></figcaption></figure>

<figure><img src="/files/R3Wyjq5XVKGuWpGCuH7Q" alt=""><figcaption><p>Fork a Bot</p></figcaption></figure>


# Manage Bot

### Edit Bot

After logging into the ChainBot platform, navigate to the "Bots" section on your personal page, select the target Bot you wish to operate, click the button on the upper right corner of the Bot, and then click "Edit" to re-edit the current Bot.

<figure><img src="/files/JAzww8jwQhX4mXnsIJpI" alt=""><figcaption><p>Edit a Bot</p></figcaption></figure>

### Share Bot

After logging into the ChainBot platform, navigate to the "Bots" section on your personal page, select the target Bot's tab to enter the Bot details page. Click the "Share" button on the upper right corner to share this Bot.

<figure><img src="/files/UbPleVyvxaRLrYF3OkM8" alt=""><figcaption><p>Share a Bot</p></figcaption></figure>

### Delete Bot

After logging into the ChainBot platform, navigate to the "Bots" section on your personal page, select the target Bot you wish to operate, click the button on the upper right corner of the Bot, and then click "Delete" to delete the current Bot.

<figure><img src="/files/jr1Y2IfYrRd21ac9MJlv" alt=""><figcaption><p>Delete a Bot</p></figcaption></figure>

### Publish Bot

By default, the Bots created on the ChainBot platform are private Bots, meaning others cannot see the Bots you have created. If you wish to share the current Bot, you need to publish it. Once the Bot is successfully published, others can search for it or discover it and subscribe to the Bot you created. Additionally, you can view the Bots you have published in "Bots" -> "Published".

If the Bot you created has 5 or more subscriptions after being published, you will not be able to delete that Bot. If the number of subscriptions is less than 5, you can delete the Bot.

<figure><img src="/files/Kg5OvkdCcYKCdaaoACoA" alt=""><figcaption><p>Publish a Bot</p></figcaption></figure>


# Alarm Notification Template

### What is an Alert Notification Template?

In the ChainBot platform, an alert notification template is essentially a string of text with no length limitation. Whenever a user creates a Bot, a default alert notification template is generated. Users need to modify the keywords in the alert notification template according to their own needs, and they can also modify the injected variables based on the type of Bot monitoring.

Here is an example of an alert notification template:

```
[ {$bot.name} ]
  Contract: {$event.contract}
  Time: {$block.time}
  Explore: {$chain.explore}/tx/{$tx.hash}
  Created By ChainBot.io
```

In this example, "Contract" is a keyword designed for user readability, and "{$event.contract}" is a template variable. Template variables must be enclosed in "{}".

[Learn about the different injected variables supported by Bot monitoring](/advanced-features/alarm-notification-template/message-template)

### Advanced Features of Alert Notification Templates

> To use these features, users need basic programming skills.

#### 1. Formatting Time

```javascript
// Format the time zone to the user's designated time zone
timezone($block.time, 8)
```

#### 2. Arithmetic Operations

```javascript
"123000000000000000000" / 1e18 == 123
"1" + "1" + 1 == 3
2 - 1 == 1
2 * 2 == 4
```

#### 3. Rounding Operations

```
{ round(1000000000001000000 / 1e18, 1)}
```

#### Complex Alert Template Example

```
[{$subscription.name}]
Block: {$block.number}
Values: {$values._reserve0 / 1e18} / {$values._reserve1 / 1e18} = {$values.percent}
Condition: {$condition}
Time: {$block.time}

```


# 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}
```


# Condition(s) Description


# Webhooks

Receive Bot monitoring alerts using Webhook

You can configure receiving data via Webhook in [How to Set Up Webhook](/basic-usage/notify-channels/webhook#ru-he-she-zhi-webhook). When the Bot monitoring alert is triggered, the system will call back the specified Webhook via `POST`.

### Event Alert Callback Data Example

```json
{
  "bot": {
    "id": "310921842431212166",
    "name": "ChainbotFactoryCN_Demo_event_formatTime"
  },
  "data": {
    "block": {
      "hash": "0x812c4e049074fc939f84a336b051d252ded717a00624659be5e9eaa0ea5c0e33",
      "height": 16145470,
      "time": "2022-12-09T06:49:47Z"
    },
    "chain": {
      "chain_id": "1",
      "explore": "https://etherscan.io",
      "type": "Ethereum"
    },
    "conditions": [],
    "event": {
      "contract": "0xdac17f958d2ee523a2206206994597c13d831ec7",
      "params": {
        "owner": "0x9173be58bf265c40385c6b3c4f8e80873c1255fd",
        "spender": "0x1111111254eeb25477b68fb85ed929f73a960582",
        "value": 1.157920892373162e+77
      },
      "rawEvent": {
        "address": "0xdac17f958d2ee523a2206206994597c13d831ec7",
        "blockHash": "0x812c4e049074fc939f84a336b051d252ded717a00624659be5e9eaa0ea5c0e33",
        "blockNumber": "0xf65c3e",
        "data": "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
        "logIndex": "0x1b",
        "removed": false,
        "topics": [
          "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925",
          "0x0000000000000000000000009173be58bf265c40385c6b3c4f8e80873c1255fd",
          "0x0000000000000000000000001111111254eeb25477b68fb85ed929f73a960582"
        ],
        "transactionHash": "0xc0c8954508021711575e2e2261bf934f3228eb3cf51d5e836eafeaf66f7c9c86",
        "transactionIndex": "0xe"
      }
    },
    "transaction": {
      "hash": "0xc0c8954508021711575e2e2261bf934f3228eb3cf51d5e836eafeaf66f7c9c86"
    }
  },
  "subscription": {
    "id": "310921842766756486",
    "name": "ChainbotFactoryCN_Demo_event_formatTime1"
  },
  "time": "2022-12-09T06:49:49.993075864Z",
  "version": "1.0"
}
```

### DEX Alert Callback Data Example

```json
{
  "bot": {
    "id": "311119159553604230",
    "name": "ChainbotFactoryCN_demo_dex"
  },
  "data": {
    "action": "sell",
    "block": {
      "hash": "0xdb082dbf8a51f4c7f2ff304329a133be42aeda04bad278b5a226c9c027ff9277",
      "height": 16145450,
      "time": "2022-12-09T06:45:47Z"
    },
    "chain": {
      "chain_id": "1",
      "explore": "https://etherscan.io",
      "type": "Ethereum"
    },
    "condition": {
      "param": "Swap",
      "symbol": "WhaleBuySell",
      "unit": "USD",
      "value": "1"
    },
    "dex": {
      "address": "0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45",
      "name": "UniswapV3"
    },
    "price": "0.0007780715056737",
    "priceUSD": "0.99746853486837753388444328412",
    "tokenBase": {
      "address": "0xdAC17F958D2ee523a2206206994597C13D831ec7",
      "amount": "100",
      "decimals": 6,
      "symbol": "USDT"
    },
    "tokenIn": {
      "address": "0xdAC17F958D2ee523a2206206994597C13D831ec7",
      "amount": "100",
      "decimals": 6,
      "symbol": "USDT"
    },
    "tokenOut": {
      "address": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
      "amount": "-0.077807150567369",
      "decimals": 18,
      "symbol": "WETH"
    },
    "tokenQuote": {
      "address": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
      "amount": "-0.077807150567369",
      "decimals": 18,
      "symbol": "WETH"
    },
    "transaction": {
      "hash": "0x26ebda9060af58a0eb8097faa3afeab0694db52169d0bd0d6570a18bc60ff7cb"
    },
    "value": "0"
  },
  "subscription": {
    "id": "311120377680149126",
    "name": "ChainbotFactoryCN_demo_dex"
  },
  "time": "2022-12-09T06:45:50.911504167Z",
  "version": "1.0"
}
```

### Value Alert Callback Data Example

```json
{
  "bot": {
    "id": "306859121112954304",
    "name": "ChainbotFactoryCN_demo_reserve_percent1"
  },
  "data": {
    "chain": {
      "chain_id": "1",
      "explore": "",
      "type": "Ethereum"
    },
    "conditions": {
      "_reserve0": {
        "field": "_reserve0",
        "method": "last",
        "result": 5394298.279736,
        "symbol": ">",
        "threshold": 546000,
        "timeRange": "5m",
        "value": 5394298.279736
      },
      "_reserve1": {
        "field": "_reserve1",
        "method": "last",
        "result": 5399252.162221,
        "symbol": ">",
        "threshold": 546000,
        "timeRange": "5m",
        "value": 5399252.162221
      },
      "percent": {
        "field": "percent",
        "method": "last",
        "result": 0.999082,
        "symbol": ">",
        "threshold": 0.9,
        "timeRange": "5m",
        "value": 0.9990824872896912
      }
    },
    "fields": [
      {
        "index": "0",
        "key": "_reserve0",
        "modifier": "function format(values){\n    return values['_reserve0']/1e6;\n}"
      },
      {
        "index": "1",
        "key": "_reserve1",
        "modifier": "function format(values){\n    return values['_reserve1']/1e6;\n}"
      },
      {
        "index": "percent",
        "key": "percent",
        "modifier": "function format(values){\n    return values['_reserve0']/values['_reserve1'];\n}"
      }
    ],
    "time_range": "60s",
    "values": {
      "_reserve0": 5394298.279736,
      "_reserve1": 5399252.162221,
      "percent": 0.9990824872896912
    }
  },
  "subscription": {
    "id": "306863510603150784",
    "name": "ChainbotFactoryCN_demo_reserve_percent1"
  },
  "time": "2022-12-09T07:23:12.18185473Z",
  "version": "1.0"
}
```

### Transaction Alert Callback Data Example

```json
{
  "bot": {
    "id": "311120108020152966",
    "name": "ChainbotFactoryCN_test_tx_timeFormat"
  },
  "data": {
    "block": {
      "hash": "0x8bd5331676d308b7abfed895da1a68177661b4c9aee970702fb6c18eb3988e6e",
      "height": 16145663,
      "time": "2022-12-09T07:28:23Z"
    },
    "chain": {
      "chain_id": "1",
      "type": "Ethereum"
    },
    "conditions": [],
    "transaction": {
      "arguments": null,
      "chainId": "1",
      "from": "0xc7c669ad7cfaaaf77da193daf0967b38dea34437",
      "gas": "0x10e07",
      "gasPrice": "",
      "hash": "0x79ca5a9a1dd9000f41c73887a9391fc21652974102926c4cb002a2e5e7692168",
      "height": 16145663,
      "input": "0x23b872dd0000000000000000000000003ee764a5a659ba9ad28e3cf3fa467e75dad5a090000000000000000000000000bf69d9d87cc310544db068e5198c25e738a806ac0000000000000000000000000000000000000000000000000000000000000000",
      "maxFeePerGas": "0xda979d87c",
      "maxPriorityFeePerGas": "0x59682f00",
      "method": "transferFrom(address,address,uint256)",
      "nonce": "0xf65",
      "r": "0x4c520e66df875e38cf9d058ac679ce5c862a948d1c7e56156e736d8f98f9a7d8",
      "s": "0x498ae192afd44defdd06fb4d44cf2f158a60fb7d565a624af5f604d1cd236f1a",
      "success": false,
      "to": "0xdac17f958d2ee523a2206206994597c13d831ec7",
      "type": "0x2",
      "type_arguments": null,
      "v": "0x0",
      "value": "0"
    }
  },
  "subscription": {
    "id": "311120108288522886",
    "name": "ChainbotFactoryCN_demo_tx_timeFormat"
  },
  "time": "2022-12-09T07:28:27.122532348Z",
  "version": "1.0"
}
```

### Block Alert Callback Data Example

```json
{
  "bot": {
    "id": "296436117295614241",
    "name": "ChainbotFactoryCN_demo_block_gasused<60%"
  },
  "data": {
    "block": {
      "baseFeePerGas": 27.617106321,
      "gasUsedPercent": 9.64783,
      "hash": "0xd99db0bb07609f60fcfff475247826633ee8245fde944e115dca5d27ffc891e7",
      "height": 16145678,
      "minter": "0x5c647ca5e2bc5bd17c40410fcb8003d38879ae50",
      "time": "2022-12-09T07:31:23Z"
    },
    "chain": {
      "chain_id": "1",
      "type": "Ethereum"
    },
    "conditions": [
      {
        "param": "gasUsedPercent",
        "symbol": "<",
        "unit": "Percent",
        "value": "60"
      }
    ]
  },
  "subscription": {
    "id": "310931430308166278",
    "name": "ChainbotFactoryCN_demo_block_gasused<60%"
  },
  "time": "2022-12-09T07:31:33.011598237Z",
  "version": "1.0"
}
```

### NFT Alert Callback Data Example

```json
{
  "bot": {
    "id": "311159164322167430",
    "name": "ChainbotFactoryCN Demo"
  },
  "data": {
    "chain": {
      "chain_id": "1",
      "explore": "https://etherscan.io/",
      "type": "Ethereum"
    },
    "collection": {
      "slug": "cockpunch"
    },
    "conditions": [],
    "event": {
      "time": "2022-12-09T08:16:59+00:00",
      "timestamp": 1670573819000,
      "type": "Sold"
    },
    "item": {
      "market_link": "https://opensea.io/collection/cockpunch",
      "opensea_link": "https://opensea.io/collection/cockpunch",
      "token_id": "3462"
    },
    "maker": {
      "address": "0x0fe0e246423e61dae865bf1bf9a8e28344788c87"
    },
    "market": {
      "name": "opensea"
    },
    "payment": {
      "price": "0.92",
      "symbol": "ETH",
      "usd_price": "1280.8900000000001"
    },
    "quantity": "1",
    "taker": {
      "address": "0x54edade621180c64dd55b5b49f1541deb33a0c30"
    },
    "transaction": {
      "hash": "0xd70d5603b24ccb9d04b5304ff5e3a0abc00579180a9085eb0b53a791e9a2d221",
      "time": "2022-12-09T08:16:59+00:00",
      "timestamp": 1670573819000
    }
  },
  "subscription": {
    "id": "311159238225607302",
    "name": "ChainbotFactoryCN demo"
  },
  "time": "2022-12-09T08:16:59+00:00",
  "version": "1.0"
}
```

### Snapshot Alert Callback Data Example

```json
{
  "bot": {
    "id": "310930122406673030",
    "name": "ChainbotFactoryCN_demo_snapshot_timeFormat"
  },
  "data": {
    "conditions": [
      {
        "field": "event",
        "symbol": "in",
        "value": "proposal/created,proposal/start,proposal/end,proposal/deleted"
      },
      {
        "field": "space",
        "symbol": "=",
        "value": "stgdao.eth"
      }
    ],
    "proposal": {
      "author": "0xE2D48F03082deeF8eb557B00a54aC9fc38Aa4709",
      "event": "proposal/start",
      "expire": 1663107416,
      "id": "0xe6fef4aa9c8e9d162f694ab764b11c06918b9f199aafe43e0d85b12d8271011c",
      "link": "https://snapshot.org/#/stgdao.eth/proposal/0xe6fef4aa9c8e9d162f694ab764b11c06918b9f199aafe43e0d85b12d8271011c",
      "network": "1",
      "space": "stgdao.eth",
      "state": "closed",
      "title": "SIP #16 - New Assets - DAI, FRAX, sUSD, LUSD"
    }
  },
  "subscription": {
    "id": "311139153012505222",
    "name": "ChainbotFactoryCN_demo_snapshot_timeFormat"
  },
  "time": "2022-12-09T07:13:14.208602165Z",
  "version": "1.0"
}
```

### Arweave Alert Callback Data Example

```json
{
  "bot": {
    "id": "311124588459309702",
    "name": "ChainbotFactoryCN_demo_Arweave"
  },
  "data": {
    "block": {
      "hash": "4uamc6mU6VnKjkYptP_2oSGPoiX4QPl-BxJABAmNG2FI_65V_xuG3LVEBkzyKtX0",
      "height": 1073786,
      "time": "2022-12-09T06:57:37Z"
    },
    "conditions": [
      {
        "Field": "app-name",
        "Symbol": "==",
        "Type": "tags",
        "Value": "mirrorxyz"
      }
    ],
    "raw": {
      "authorship": {
        "algorithm": {
          "hash": "SHA-256",
          "name": "ECDSA"
        },
       
```


# Supported Data Sources

### Public Chains

#### EVM Compatible

* Ethereum
* Binance smart chain
* Avalanche
* Polygon
* Fantom

**Arweave**

* Mainnet

### Third-party Data

* [Snapshot](https://snapshot.org/)
* [OpenSea](https://opensea.io/)


# API


# API Key Application

### Applying for an Api Key

Register an account normally at <https://chainbot.io/> and purchase a Pro user membership. Provide the email associated with the account to the team for application. Each account will be assigned a `client_id` and `secret_key`.

### Authentication Method

The authentication method is `Base Auth`, i.e., `Basic: base64(client_id:secret_key)` as the `Authorization`.

#### Example

For example, if the assigned `client_id` is `test_client_id` and the `secret_key` is `test_secret_key`,

then `base64(test_client_id:test_secret_key) = dGVzdF9jbGllbnRfaWQ6dGVzdF9zZWNyZXRfa2V5`

The code for sending the request is

```
curl "https://api.chainbot.io" \
     -H 'Authorization: Basic dGVzdF9jbGllbnRfaWQ6dGVzdF9zZWNyZXRfa2V5'
```


# API Doc

### Api Base Host

`https://api.chainbot.io/api/v1`

### Channel

#### Query Channel

**GET** `/notify/channels`

**Parameters**

* `current_page` int, Current query page, starting from 1
* `per_page` int, Number of records per page

**Response**

```
{
    "code": 0,
    "msg": "success",
    "data": {
        "data": [
            {
                "id": 1367,
                "user_id": 2137,
                "name": "Pushover",
                "platform": "Pushover",
                "token": "token",
                "channel": "channel",
                "channel_type": "",
                "is_default": 0,
                "priority": 1,
                "others": null
            },
            {
                "id": 1075,
                "user_id": 2137,
                "name": "Webhook",
                "platform": "Webhook",
                "token": "",
                "channel": "http://webhook.io/url",
                "channel_type": "",
                "is_default": 1,
                "priority": 0,
                "others": null
            }
        ],
        "current_page": 1,
        "per_page": "999",
        "total": 2
    }
}
```

#### Add Channel

**POST** `/notify/channels`

**Parameters**

```
{
    "name": "web",
    "platform": "Webhook",
    "token": "",
    "channel_type": "",
    "channel": "http://webhook.com/url",
    "priority": 0,
    "others": {
        "retryExpire": "0",
        "retryInterval": "0"
    }
}
```

**Response**

```
{
  "code": 0,
  "msg": "success",
  "data": {
    "id": 2879,   // channel id, needed when subscribing to bot
    "user_id": 2137,
    "name": "Webhook",
    "platform": "Webhook",
    "token": "",
    "channel": "http://sda.dfa",
    "channel_type": "",
    "is_default": 0,
    "priority": 0,
    "others": {}
  }
}
```

#### Delete Channel

**DELETE** `/notify/channels/{channel_id}`

**Parameters**

* `channel_id`

**Response**

```
{
    "code": 0,
    "msg": "success",
    "data": {}
}
```

### Bot

#### Create Bot

**POST** `/bots`

**Parameters**

Address Bot Example

```
{
    "info": {
        "type": "Wallet",  // address bot is fixed as Wallet
        "name": "address bot",
        "tags": [
            "tag1"  // tags for statistical display
        ],
        "status": "Public",   // optional: Public/Private, only VIP users are allowed to create Private bot 
        "notify_template": "[{$subscription.name}]\nFrom: {$tx.from}\nTo: {$tx.to}\nMethod: {$tx.method}\nStatus: {$tx.status}\nExplore: {$chain.explore}/tx/{$tx.hash}\nTime: {$block.time}",
        "description": "desc"
    },
    "driver": {
        "chains": [
            {
                "chain_id": "1",
                "type": "Ethereum"
            }
        ],
        "addresses": [
            "0x114910771af9ca656af840dff83e8264ecf986ca"
        ],
        "strategies": [
            {
                "func": "eth_transfer",  // monitor eth transfer
                "params": {
                    "direction": "out",  // optional values: both/out/in
                    "minimum_amount": "100000000000000000000",  // eth amount, unit: wei
                    "minimum_usd": 1   // eth converted to usd amount
                }
            },
            {
                "func": "token_transfer",  // monitor erc 20 transfer
                "params": {
                    "direction": "both",  // optional values: both/out/in
                    "minimum_usd": 6
                }
            },
            {
                "func": "nft_transfer",   // monitor nft transfer
                "params": {
                    "direction": "both"
                }
            },
            {
                "func": "contract_deploy",  // monitor contract deployment
                "params": {}
            },
            {
                "func": "contract_call",  // monitor contract call
                "params": {}
            }
        ]
    }
}
```

**Response**

```
{
  "code": 0,
  "msg": "success",
  "data": {
    "id": "461170869663212058",  // bot id, used for subscription after creation
    "info": {
      "type": "Wallet",
      "name": "address bot",
      "tags": [
        "tag1"
      ],
      "description": "desc",
      "notify_template": "[{$subscription.name}]\nFrom: {$tx.from}\nTo: {$tx.to}\nMethod: {$tx.method}\nStatus: {$tx.status}\nExplore: {$chain.explore}/tx/{$tx.hash}\nTime: {$block.time}",
      "status": "Public"
    },
    "driver": {
      "addresses": [
        "0x114910771af9ca656af840dff83e8264ecf986ca"
      ],
      "chains": [
        {
          "chain_id": "1",
          "type": "Ethereum"
        }
      ],
      "strategies": [
        {
          "func": "eth_transfer",
          "params": {
            "direction": "both",
            "minimum_amount": "0",
            "minimum_usd": 0
          }
        },
        {
          "func": "token_transfer",
          "params": {
            "direction": "both",
            "minimum_usd": 0
          }
        }
      ]
    },
    "subscribe_num": 0,
    "fork_num": 0,
    "view_times": 0,
    "triggered_times": 0,
    "last_trigger_time": 0,
    "readme": "",
    "created_at": "2024-05-09T17:40:29.336Z",
    "user": {},
    "notifies": null,
    "forked_bot": null,
    "original_bot": null,
    "sub_users": null
  }
}
```

#### Delete Bot

**DELETE** `/bots/{bot_id}`

**Parameters**

* `bot_id`

**Response**

```
{
    "code": 0,
    "msg": "success",
    "data": {}
}
```

#### Update Bot

**PUT** `/bots/{bot_id}`

**Parameters**

Address Bot Example

```
{
    "info": {
        "type": "Wallet",
        "name": "test address",
        "tags": [],
        "status": "Private",
        "notify_template": "[{$subscription.name}]\nFrom: {$tx.from}\nTo: {$tx.to}\nMethod: {$tx.method}\nStatus: {$tx.status}\nExplore: {$chain.explore}/tx/{$tx.hash}\nTime: {$block.time}\nCreated By chainbot.io",
        "description": ""
    },
    "driver": {
        "chains": [
            {
                "chain_id": "1",
                "type": "Ethereum"
            }
        ],
        "addresses": [
            "0x114910771af9ca656af840dff83e8264ecf986ca"
        ],
        "strategies": [
            {
                "func": "eth_transfer",
                "params": {
                    "direction": "both",
                    "minimum_amount": "0",
                    "minimum_usd": 1
                }
            },
            {
                "func": "token_transfer",
                "params": {
                    "direction": "both",
                    "minimum_usd": 1
                }
            },
            {
                "func": "contract_deploy",
                "params": {}
            }
        ]
    }
}
```

**Response**

```
{
    "code": 0,
    "msg": "success",
    "data": {
        "id": "464062092614790430",
        "info": {
            "type": "Wallet",
            "name": "test address",
            "notify_template": "[{$subscription.name}]\nFrom: {$tx.from}\nTo: {$tx.to}\nMethod: {$tx.method}\nStatus: {$tx.status}\nExplore: {$chain.explore}/tx/{$tx.hash}\nTime: {$block.time}\nCreated By chainbot.io",
            "status": "Private"
        },
        "driver": {
            "addresses": [
                "0x114910771af9ca656af840dff83e8264ecf986ca"
            ],
            "chains": [
                {
                    "chain_id": "1",
                    "type": "Ethereum"
                }
            ],
            "strategies": [
                {
                    "func": "eth_transfer",
                    "params": {
                        "direction": "both",
                        "minimum_amount": "0",
                        "minimum_usd": 1
                    }
                },
                {
                    "func": "token_transfer",
                    "params": {
                        "direction": "both",
                        "minimum_usd": 1
                    }
                },
                {
                    "func": "contract_deploy",
                    "params": {}
                }
            ]
        },
        "subscribe_num": null,
        "fork_num": null,
        "view_times": 0,
        "triggered_times": 0,
        "last_trigger_time": 0,
        "readme": "",
        "created_at": null,
        "user": {},
        "notifies": null,
        "forked_bot": null,
        "original_bot": null,
        "sub_users": null
    }
}
```

### Subscribe

#### Subscribe to Bot

POST `/subscriptions`

**Parameters**

```
{
  "bot_id": "461170869663212058",  // bot id to subscribe
  "info": {
    "name": "address bot",   // subscription name
    "status": "Enabled",  // fixed as Enabled
    "actions": [
      {
        "type": "Notify",  // fixed as Notify
        "params": {
          "channel_ids": [
            2877    // channel id
          ]
        }
      }
    ],
    "notify": {
      "frequency": "5m", // push frequency, optional values: Always OnlyOnce 5m 10m 30m 1h 4h 12h 24h
      "template": ""
    }
  },
  "driver": {}  // deprecated, fixed as {}
}
```

**Response**

```
{
    "code": 0,
    "msg": "success",
    "data": {
        "id": "464064078080863518",  //
        "info": {
            "name": "safa",
            "status": "Enabled",
            "actions": [],
            "notify": {
                "frequency": "Always",
                "template": "[{$subscription.name}]\nFrom: {$tx.from}\nTo: {$tx.to}\nMethod: {$tx.method}\nStatus: {$tx.status}\nExplore: {$chain.explore}/tx/{$tx.hash}\nTime: {$block.time}\nCreated By chainbot.io"
            }
        },
        "user_id": 2137,
        "bot_id": "464063535924735262",
        "trigger_times": 0,
        "last_trigger_time": 0,
        "trigger_last_update_at": 1716138672,
        "created_at": "2024-05-19T17:11:12.64Z"
    }
}
```

#### Unsubscribe from Bot

**DELETE** `/subscriptions/{subscription_id}`

**Parameters**

* `subscription_id`

**Response**

```
{
    "code": 0,
    "msg": "success",
    "data": {}
}
```


# Event Bot Example

> Examples of typical Event Bot monitoring configurations that you can reference to learn and set up your own Bot monitoring.

### USDC Minting Bot Monitor

<figure><img src="/files/5Anh47aT2ZffzzMTUt9t" alt=""><figcaption><p>Mint USDC Bot for Event Monitor</p></figcaption></figure>

[Jump to this Bot example](https://chainbot.io/bot/309141703208769299)

### USDC Burning Monitor

<figure><img src="/files/46DIuJrv2sZKIjhPJpc4" alt=""><figcaption><p>Burn USDC Bot for Event Monitor</p></figcaption></figure>

[Jump to this Bot example](https://chainbot.io/bot/309142198203815699)


# Dex Bot Example

> Typical configured Dex Bot monitoring cases. You can refer to these cases to learn and configure your Bot monitoring.

### Uniswap V2 Token Price Monitoring

<figure><img src="/files/EsWmxkRa9B5WPUjtm3gj" alt=""><figcaption><p>Price Bot Monitor by Dex</p></figcaption></figure>

[Go to Bot Case](https://chainbot.io/bot/309115106724321043)

### Uniswap V2 Large Swap Monitoring

<figure><img src="/files/gfcALmVHrKpj2CuMXEcG" alt=""><figcaption><p>Swap Bot Monitor by Dex</p></figcaption></figure>

[Go to Bot Case](https://chainbot.io/bot/309115846817650451)

### Uniswap V3 Large Swap Monitoring

<figure><img src="/files/GXgtT8lHXnvd4mFWoX5u" alt=""><figcaption><p>Swap Bot Monitor by Dex</p></figcaption></figure>

[Go to Bot Case](https://chainbot.io/bot/309135326927427347)

### Uniswap Add Liquidity Monitoring

<figure><img src="/files/05aK1UkxMOxQNyMeXjbY" alt=""><figcaption><p>Add Liquidity Bot Monitor by Dex</p></figcaption></figure>

[Go to Bot Case](https://chainbot.io/bot/309118057065125651)

### Uniswap Remove Liquidity Monitoring

<figure><img src="/files/aEvbPOF0c1AlAXVc0uqM" alt=""><figcaption><p>Remove Liquidity Bot Monitor by Dex</p></figcaption></figure>

[Go to Bot Case](https://chainbot.io/bot/309118450188916499)


# Value Bot Example

> Typical Value Bot monitoring case studies configured. You can refer to these cases to learn and configure your own Bot monitoring.

### Single Indicator Value Monitoring

<figure><img src="/files/j0XMI8HHVMLb1yv2gL8P" alt=""><figcaption></figcaption></figure>

[Jump to this Bot case](https://chainbot.io/bot/308885297973003838)

### Multi-Indicator Value Monitoring

<figure><img src="/files/DmmwA9uwYPwNN9oYkAWz" alt=""><figcaption></figcaption></figure>

[Jump to this Bot case](https://chainbot.io/bot/308891060913210942)

### TVL Monitoring

> Mainly uses ChainBot's tokenPrice(symbol: string) method to convert amount into USD value

<figure><img src="/files/lYD8eTNUs9F70lok6reK" alt=""><figcaption></figcaption></figure>

[Jump to this Bot case](https://chainbot.io/bot/308892585995503166)

### Bot Reference Monitoring

> In Value type Bot monitoring, there is a feature to reference values from other Bots.

<figure><img src="/files/avfQn0VXlryrOrceDH2i" alt=""><figcaption></figcaption></figure>

[Jump to this Bot case](https://chainbot.io/bot/308898889530902078)


# Transaction Bot Example

> A typical example of a configured Transaction Bot monitor. You can refer to these examples to learn and configure your Bot monitoring.

### Monitoring of Large Outflows from Target Address

<figure><img src="/files/8zPq4AJAlFwWXrIOQ7y0" alt=""><figcaption></figcaption></figure>

[Go to this Bot example](https://chainbot.io/bot/308871909855036990)

### Monitoring of Incoming Transfers to Target Address

<figure><img src="/files/MsAB3emEEYX72dYLoZRa" alt=""><figcaption></figcaption></figure>

[Go to this Bot example](https://chainbot.io/bot/308873369624151614)

### Transactions of Multiple Target Addresses

<figure><img src="/files/viilJDCJhyl49OLCh6Ba" alt=""><figcaption></figcaption></figure>

[Go to this Bot example](https://chainbot.io/bot/306173082463221184)

### Monitoring Transactions of Target Methods in Target Contract

<figure><img src="/files/9EokzSSaTul47BJs2se2" alt=""><figcaption></figcaption></figure>

[Go to this Bot example](https://chainbot.io/bot/308875461390599742)


# Block Bot Example

> Typical configured Block Bot monitoring cases. You can refer to these cases to learn and set up your Bot monitoring.

### Gas Fee Monitoring Case

<figure><img src="/files/OczX6X3ISsz7iPzW7L6K" alt=""><figcaption></figcaption></figure>

[Go to this Bot Case](https://chainbot.io/bot/308869331734136382)

### Block Gas Usage Monitoring Case

<figure><img src="/files/DonEbNOduPJMGQUlo3l1" alt=""><figcaption></figcaption></figure>

[Go to this Bot Case](https://chainbot.io/bot/308869734219613758)

### Miner Address Block Monitoring

<figure><img src="/files/EZw203NKC92E3uwpir6e" alt=""><figcaption></figcaption></figure>

[Go to this Bot Case](https://chainbot.io/bot/308870353030121022)


# NFT Bot Example

> Typical NFT Bot monitoring examples already configured. You can refer to these examples to learn and configure your Bot monitoring.

### NFT Floor Price Monitoring

<figure><img src="/files/bbsBGUBcNQ4DLiO5CMK4" alt=""><figcaption></figcaption></figure>

[Jump to this Bot case](https://chainbot.io/bot/308853533485598270)

### New token Listing for Target NFT on Opensea

> Corresponding to Opensea's "buy now" feature, enabling monitoring of a specific NFT holder's selling price intention.

<figure><img src="/files/1iNvFzyAgmXUZz7WvV1m" alt=""><figcaption></figcaption></figure>

[Jump to this Bot case](https://chainbot.io/bot/308855519823824446)

### NFT Transaction Monitoring

<figure><img src="/files/pO4BuOSU12VJCFkpmMdV" alt=""><figcaption></figcaption></figure>

[Jump to this Bot case](https://chainbot.io/bot/308856215759390270)

### NFT Metadata Update Monitoring

<figure><img src="/files/RJWwQ5SHINAhp2LJk9EK" alt=""><figcaption></figcaption></figure>

[Jump to this Bot case](https://chainbot.io/bot/308856442302531134)

### Monitoring NFT Holder Ownership Transfers

<figure><img src="/files/7h12BEafE2JOWugYRLhu" alt=""><figcaption></figcaption></figure>

[Jump to this Bot case](https://chainbot.io/bot/308858653874882110)

### Monitoring New Bids on NFT

<figure><img src="/files/lRw3TCH9AZXCminupZ9M" alt=""><figcaption></figcaption></figure>

[Jump to this Bot case](https://chainbot.io/bot/308859223780329022)

### Monitoring New Offers on Followed NFTs

<figure><img src="/files/Gfisq8G5AS6hcgG98oq6" alt=""><figcaption></figcaption></figure>

[Jump to this Bot case](https://chainbot.io/bot/308860068865279550)

### NFT Bid and Offer Cancellation Monitoring

<figure><img src="/files/iHUXzvoLzUYj6UeoIqLs" alt=""><figcaption></figcaption></figure>

[Jump to this Bot case](https://chainbot.io/bot/308860714838296126)


# Snapshot Bot Example

> A typical configured Snapshot Bot monitoring case. You can refer to these cases to learn and configure your Bot monitoring.

### Monitor all proposals of the target Space

<figure><img src="/files/j7mQcGBiFRnC2SSTntg1" alt=""><figcaption></figcaption></figure>

[Jump to this Bot Case](https://chainbot.io/bot/308847499324786238)

### Monitor specific event proposals of the target Space

<figure><img src="/files/yU5ag1Y1czd3gLU40leC" alt=""><figcaption></figcaption></figure>

[Jump to this Bot Case](https://chainbot.io/bot/308847997305849406)


# Arweave Bot Example

> Currently, Mirror is the only platform at scale using Arweave for data storage. Therefore, the following cases all use Mirror for demonstration.
>
> These are typical examples of configured Arweave Bot monitoring. You can refer to these cases to learn and configure your own Bot monitoring.

### Monitoring Articles on the Entire Mirror Platform

<figure><img src="/files/qXy78zeDqyIy5dQnWjQM" alt=""><figcaption></figcaption></figure>

[Go to this Bot Case](https://chainbot.io/bot/308846134615836222)

### Monitoring Articles from Multiple Target Authors on Mirror

<figure><img src="/files/RLrGamcE4pXdu68qIODo" alt=""><figcaption></figcaption></figure>

[Go to this Bot Case](https://chainbot.io/bot/308846177162528318)

### Monitoring Articles with Keywords on Mirror

<figure><img src="/files/vySb7UALPBhyQjsiWvGm" alt=""><figcaption></figcaption></figure>

[Go to this Bot Case](https://chainbot.io/bot/308846213250385470)


# Privacy Policy

Last updated: Oct 14, 2022

Please read this Privacy Policy carefully before using the Chainbot websites, including <https://www.chainbot.io> and all other subdomains, (the "Service") operated by Ltd. ("us", "we", or "our"), a company incorporated in Singapore. This Privacy Policy outlines which of your personal data we collect, how we use this data and your data privacy rights as a user of the Service.

In this Privacy Policy, by personal data we mean information that identifies you as an individual. Personal data does not include non-personally identifying information.

**We have a few fundamental principles that we follow:**

Data you provide to Chainbot (such as labels added to "My Chainbot") will not be made available to other users - nor will they be used for our own internal labeling - without your permission.

Aggregate statistics from user behavior on the Chainbot platform may be used whenever there's no risk of displaying user-sensitive data. An example of such a feature would be top-ranked tokens that Chainbot users have recently viewed - across all users. Conversely, we would not surface top blockchain addresses that have been viewed, since this could involve a risk of displaying user-sensitive data.

We never use customer data (nor your activity data from using Chainbot) to add new labels.

We do not share your personal data with anyone except to develop our products, protect our rights, or comply with the law.

We do not store personal data on our servers unless required for the on-going operation of our service.

It is our policy to respect your privacy regarding any information we may collect while operating our service.

**NON-PERSONALLY IDENTIFYING INFORMATION WE COLLECT**

Our purpose in collecting non-personally identifying information is to better understand how visitors use our website. We do not use non-personally identifying information in a way that would enable us to identify you personally.

**Log files**

We collect non-personally identifying information of the sort that web browsers and servers typically make available, such as the browser type, language preference, referring site, and the date and time of each visitor request.

**Aggregated statistics**

We may collect statistics about the behavior of visitors and users of the Service. For instance, we may monitor the most popular dashboards or queries. We may display this information publicly or provide it to others.

**PERSONAL DATA WE COLLECT**

Sometimes, you may choose to interact with the Service in ways that require us to gather your personal data. The amount and type of personal data that we gather depends on the nature of the interaction. You may always refuse to supply personal data, with the caveat that it may prevent you from using certain parts of the Service.

**Signing up for an account**

If you sign up for an account with the Service, we will ask to provide an email address. We do this simply because it is the most convenient way to persist a user account over time, while having the possibility to communicate with you as a user.

**Marketing material**

When signing up for an account with the Service, you are automatically enrolled into our email communication. We may occasionally send you an email to tell you about new features, solicit your feedback, or just keep you up to date with what’s going on with our products. You can unsubscribe at any time by clicking the "Unsubscribe" button in our emails.

**Billing information**

A trusted third party is used to manage payment processing. This third party is not permitted to store, retain, or use your billing information for any purpose except for payment processing on our behalf.

**Cookies**

A cookie is a string of information that a website stores on a visitor’s computer, and that the visitor’s browser provides to the website each time the visitor returns. We use cookies to help us track your usage of our website, and your website access preferences. If you do not wish to have cookies placed on your computer, you may set your browser to refuse cookies before using our websites, with the caveat that certain features of our websites may not function properly without the aid of cookies.

**PROTECTION OF PERSONAL DATA**

We disclose personal data only to our employees, contractors, related companies and trusted third parties that:

* Need to know that information in order to process it on our behalf or to provide services available at our websites, and
* That have agreed not to disclose it to others.

Some of those employees, contractors, related companies and trusted third parties may be located outside of your home country which may have different privacy laws than your home country. By using the Service, you consent to the processing and transfer of your personal data to them.

Other than to our employees, contractors, related companies and trusted third parties, as described above, we disclose personal data only as necessary to comply with our legal obligations, maintain accurate accounting, resolve disputes and enforce our agreements.

We take all measures reasonably necessary to protect against the unauthorized access of your personal data.

**BUSINESS TRANSFERS**

If we or substantially all of our assets are acquired, or in the unlikely event that we go out of business or become insolvent, your personal data could be one of the assets that is transferred or acquired. You acknowledge that such transfers may occur, and that any acquirer may continue to use your personal data as set forth in this Privacy Policy.

**YOUR RIGHTS**

You may request access to your personal data, as well as information on how we process your personal data. You may also request to erase, restrict or rectify such processing. Additionally, you may request to receive your personal data exported in a structured, commonly used and machine-readable format.

Upon your request, we will delete your personal data.

For further information about your data protection rights, you may contact our Data Protection Officer at the email address below.

Attention: Data Protection Officer <support@chainbot.io>

**PRIVACY POLICY CHANGES**

We may change this Privacy Policy from time to time, and at our sole discretion. We will inform you in advance of any material changes. You are encouraged to review this page for the latest version of this Privacy Policy. Your continued use of this site after any change in this Privacy Policy will constitute your acceptance of such change.


# Terms of Services

Last updated: Oct 14, 2022

Please read these Terms of Service ("Terms", "Terms of Service") carefully before using the Chainbot websites, including <https://www.chainbot.io> and all other subdomains, (the "Service") operated by Chainbot Ltd. ("us", "we", or "our"), a company incorporated in Singapore.

Your access to and use of the Service is conditioned on your acceptance of and compliance with these Terms. These Terms apply to all visitors, users, and others who access or use the Service.

By accessing or using the Service you agree to be bound by these Terms. If you disagree with any part of the terms then you may not access the Service.

**DISCLAIMER**

To the maximum extent permitted under applicable law, the Service is provided on an “as is” and “as available” basis. We expressly disclaim, and you waive, all warranties of any kind, whether express or implied, including, without limitation, implied warranties of merchantability, fitness for a particular purpose, title, and non-infringement as to the Service, including the information, content, and materials contained therein.

**ACCEPTABLE USE**

You agree to use the Service in accordance with the applicable law and regulations and in accordance with these Terms. You are solely responsible for your conduct while using the Service. You must not:

1. Copy, reproduce, modify, distribute, duplicate, copy, sell, resell, license, publicly display or disclose the Service without our prior consent.
2. Share, recompile, decompile, disassemble, reverse engineer, or make or distribute any other form of, or any derivative work from the Service;
3. Use the Service, directly or indirectly, in any manner that could cause the Service so used to: (i) be a substitute for the Service by a third party, (ii) affect Chainbot's ability to realize revenue in connection with the Service, or (iii) compete with Chainbot's business;
4. Store or use data or content in an archival file site, database or other searchable repository except as expressly permitted by this agreement or in an applicable order form.
5. Use any robot, spider, crawler, scraper or other automated means or interface not provided by us to access the Service or to extract data;
6. Use or attempt to use another user’s account without authorization;
7. Attempt to circumvent any content filtering techniques we employ, or attempt to access any service or area of the Service that you are not authorized to access;
8. Introduce to the Service any virus, trojan worms, logic bombs, or other harmful material or otherwise hack the Service;
9. Develop any third-party applications that interact with the Service without our prior written consent;

We reserve the right to determine whether a use of the Service is in violation of these Terms or fails to constitute acceptable use.

**ACCESSING CHAINBOT USING WEB3 SERVICES:**

Chainbot leverages web3 services to provide our end users the ability to sign up with, or associate their existing account, to their blockchain address which functions as an extension of their personal identity and can be used as a form of accessing the platform.

By using this feature Chainbot assumes the right to collect your blockchain wallet address, completed transaction information, and token identifiers for the purpose of enabling this feature.

Wallets are not maintained by, operated by, or affiliated with Chainbot. Chainbot has no control over the contents of your wallet and does not accept any responsibility for, or liability to you, in connection with your usage of a wallet on the Chainbot platform. You, as the user and owner of the wallet, are solely responsible for keeping your wallet secure. You should never share credentials or seed phrases of your wallet with anyone and Chainbot will never ask for this information under any circumstances. Any issues noted with your wallet should be directed to and discussed with your wallet provider.

**THIRD-PARTY LINKS**

The Service may contain links to third-party websites or services that are not owned or controlled by Chainbot.

Chainbot has no control over, and assumes no responsibility for, the content, privacy policies, or practices of any third-party websites or services. You further acknowledge and agree that Chainbot shall not be responsible or liable, directly or indirectly, for any damage or loss caused or alleged to be caused by or in connection with the use of or reliance on any such content, goods, or services available on or through any such websites or services.

We strongly advise you to read the terms and conditions and privacy policies of any third-party websites or services that you visit.

**INTELLECTUAL PROPERTY RIGHTS**

We retain all rights, including all copyright and other intellectual property rights, in all content and other materials contained on our website or provided in connection with the Service.

You receive no license or usage rights to the Service other than what is explicitly stated in these Terms.

**LIMITATION**

Except as otherwise required by law, in no event shall we be liable for any special, indirect or consequential damages, or any other damages of any kind, including but not limited to loss of use, loss of profits, or loss of data, arising out of or in any way connected with the use of or inability to use the Service, including without limitation any damages resulting from reliance by you on any information obtained from using the Service.

**MAINTENANCE**

We may temporarily suspend the Service from time to time for maintenance. We do not warrant any particular level of Service availability.

**TERMINATION**

We may terminate or suspend access to the Service immediately, without prior notice or liability, for any reason whatsoever, including without limitation if you breach the Terms.

All provisions of the Terms which by their nature should survive termination shall survive termination, including, without limitation, ownership provisions, warranty disclaimers, indemnity and limitations of liability.

**WAIVER**

Our failure to enforce any right or provision of these Terms will not be considered a waiver of those rights. If any provision of these Terms is held to be invalid or unenforceable by a court, the remaining provisions of these Terms will remain in effect. These Terms constitute the entire agreement between us regarding the Service, and supersede and replace any prior agreements we might have between us regarding the Service.

**CHANGES**

We reserve the right, at our sole discretion, to modify or replace these Terms at any time. If a revision is material we will try to notify you prior to any new terms taking effect. What constitutes a material change will be determined at our sole discretion. By continuing to access or use the Service after those revisions become effective, you agree to be bound by the revised terms. If you do not agree to the new terms, please stop using the Service.

**GOVERNING LAW AND JURISDICTION**

These Terms shall be governed and construed in accordance with the laws of Singapore, without regard to its conflict of law provisions.

You irrevocably agree that the Singapore courts shall have non-exclusive jurisdiction to hear and decide any suit, action or proceedings or settle any dispute arising out of or in connection with the Service.

**CONTACT US**

If you have any questions about these Terms, please contact us via email: <support@chainbot.io>


# FAQ

### 1. What does Decimals mean?

Computers cannot accurately store floating-point numbers, so all value-related data on the chain needs to be converted into integers for storage. When developers design a Token initially, they need to determine the precision (decimals) of the Token, which can be understood as the number of decimal places.

When configuring ChainBot monitoring, all value-related comparisons need to be made using the original format on the chain. For instance, 100 ETH should be written as 100e18 because the decimals for ETH is 18.

### **2. What do 1e18 and 1e6 mean?**

These expressions are the scientific notation of numbers: 1e18 means 1 multiplied by 10 to the power of 18, and 1e6 means 1 multiplied by 10 to the power of 6.

For easier input of integers, you can preferentially use scientific notation to enter accurate numbers.

### **3. How to confirm the decimals of a specific token?**

You can check it on the token page of <https://etherscan.io/>.

<figure><img src="/files/zDzE0hUM0b0OKfvd8Dxy" alt=""><figcaption><p>Confirm Decimals for Token</p></figcaption></figure>

### **4. Is there an API that can be directly integrated?**

Public API is actively being prepared. Stay tuned!

### 5. **When creating a Bot, how do I determine which type of Bot monitoring to use?**

For details, please read

[Monitoring/Bot](/basic-usage/bots)

[https://github.com/ChainbotAI/doc-en/blob/master/support/broken-reference/README.md](https://github.com/ChainbotAI/doc-en/blob/master/support/broken-reference/README.md "mention")

### **6. In Bot monitoring configuration, how do I determine which Symbol to choose?**

[Condition(s) Description](/advanced-features/conditions-description)

### 7. What is the difference between a Bot and a List?

A Bot is single, while a List contains a group of Bots.

You can add multiple related Bots to a List for easier management, such as multiple Bots related to a particular project.

Both Bots and Lists can be shared, allowing other users to quickly subscribe to the quality Bots/Lists you create or discover.

### 8. How to handle reaching the limit for free alerts?

Currently, the number of free alerts is 500, which usually meets the needs. If you reach the alert limit, the ChainBot platform will send corresponding notifications to your configured Channel. If you still reach the alert limit, please contact the administrator via private message on Discord.

### 9. What is the methodId of a transaction? How to find the methodId of a target transaction?

In the EVM system, each method defined by a contract will generate a corresponding methodId as an identifier. The methodId is fixed at 4 bytes, for example: 0x38926b6d.

On the blockchain explorer, select the corresponding transaction, scroll to the bottom of the page to see the methodId. For example:

[Example of a transaction in Uniswap v2:](https://etherscan.io/tx/0x240fd278cadc224eb035b8a9af0c17f9ab72cc92cc8a968507cf1ddcd7cdfc2d)

<figure><img src="/files/lN0bXgG2lFEdFkvuaFYT" alt=""><figcaption><p>Uniswap v2 demo</p></figcaption></figure>

[Example of a transaction in Seaport 1.1:](https://etherscan.io/tx/0x0e15e77cba06ce0178a208d73d3da2b722cbaeb6000428b43cbc6a9e348d3d92)

<figure><img src="/files/erFrm6M56dfYWRw50BUw" alt=""><figcaption><p>Seaport 1.1 Demo</p></figcaption></figure>


# Contact us

<table><thead><tr><th width="212">Social Media</th><th>Url</th></tr></thead><tbody><tr><td>Discord</td><td><a href="https://discord.gg/RQF3KzsrDC">https://discord.gg/RQF3KzsrDC</a></td></tr></tbody></table>

**Support Mail**

<support@chainbot.io>


# ChainBot 介绍

<https://chainbot.io>

ChainBot 是一款强大的实时数据监控和告警平台。它能够根据你的需要定制化、自动化的对链上或第三方平台的数据进行监控，并实时的通过你设定的渠道反馈和告警，让你及时把控项目的进展。

ChainBot 目前支持以下几个大类的监控：

> 1. [链上 Event Bot 监控](/zh/basic-usage/bots/event-bot)
> 2. [链上 DEX Bot 监控](/zh/basic-usage/bots/dex-bot)
> 3. [链上 Transaction Bot 监控](/zh/basic-usage/bots/transaction-bot)
> 4. [链上 Value Bot 监控](/zh/basic-usage/bots/value-bot)
> 5. [NFT Bot 监控](/zh/basic-usage/bots/nft-bot)
> 6. [三方 Snapshot Bot 监控](/zh/basic-usage/bots/snapshot-bot)
> 7. [链上 Block Bot 监控](/zh/basic-usage/bots/block-bot)
> 8. [链上 Arweave Bot 监控](/zh/basic-usage/bots/arwwave-bot)

### ChainBot 主要解决哪些关键问题？

> ChainBot 平台在底层设计的更为灵活通用，下述场景只是高频场景，更多的功能请阅读 "监控/Bot"
>
> 的内容。

1. 巨鲸从池子里面撤走了巨额流动性，需要及时接收消息并进行下一步计划。
2. DEX 中币价实时变化告警通知，比如 DEX 中上新了一个 shitcoin，需要对其币价保持关注。
3. NFT 地板价跌破了发行价监控。
4. mirror 上高质量文章监控告警，从而第一时间去学习新的内容。
5. 黑客地址行为监控，比如：当 FTX 黑客地址资金有转出转入时，需要第一时间收到告警监控。
6. 当关注的项目方在 snapshot 操作对应的提案时发送告警通知，而不是时不时去刷新官方 UI。

### 术语解释

1. **Bot**

   一组针对不同类别数据持续监控的规则和告警模板，我们称之为 Bot 。Bot 可以为私有或者公开的，公开的 Bot 任意用户都可以订阅。当 Bot 满足配置条件时，按照用户设置的告警 Channel，将会像订阅了该 Bot 的所有 Subscription 发送告警通知信息。
2. **Condition(s)**

   Bot 触发告警的条件；

   Condition(s) 支持多个字段的比较，当填写多个字段时，触发告警的逻辑关系为“且”，当即满足 Condition A 且满足 Condition B 时才会触发告警；
3. **Subscription**

   用户需通过 Subscription 设置 Bot 告警的发送方式及频率等信息。一个 Subscription 只能从属于一个 Bot，但一个 Bot 可以被不同用户订阅多次；
4. **List**

   List 是多个 Bot 的集合。用户可以依照自身需求，将不同种类的 Bot 设置到不同的 List 中，方便管理。
5. **Fork**

   完整复制原 Bot 的所有数据。
6. **Contract**

   部署在区块链上的智能合约。
7. **Notify Channel**

   接收消息的告警渠道及配置，例如 Slack/Pushover；
8. **Notify Template**

   订阅告警通知的模板内容，在配置 Bot 时，平台将会自动生成默认的告警模板，用户可以按照自身需求变更告警内容。
9. **DataSources**

   数据源，ChainBot 平台架构底层支持的数据源。


# 快速开始

您可以通过平台的 Discover 页面或者通过顶部的搜索功能找到目标 Bot，如果尚未存在满足需求的 Bot 则可以自主创建新Bot。

### 如何配置 Bot？

根据 ChainBot 对 Bot 的定义，可知我们应该做如下操作：

1. [设置账户的告警通知渠道](https://github.com/ChainbotAI/doc-zh/blob/master/broken-reference/README.md)
2. [选择 Bot 监控的类别](/zh/basic-usage/bots)
3. 设置 Bot 监控的数据源（各个类型的 Bot 中已列出支持的数据源）
4. [配置 Bot 所需的合约信息（如果需要的话）](/zh/basic-usage/contracts-mange)
5. [设置 Bot 监控告警的触发条件 （Condition(s)）](/zh/advanced-features/conditions-description)
6. [依照当前需求更改默认的 Bot 监控设置的告警模板](/zh/advanced-features/alarm-notification-template)
7. [创建 Bot 监控后，订阅该 Bot 的通知](/zh/basic-usage/subs)

### 通过 Discover 查找 Bot

<figure><img src="/files/Gye8I7LF5HzTO96fHvqw" alt=""><figcaption><p>Discover</p></figcaption></figure>

### 搜索 Bot

<figure><img src="/files/3hyQCeZieoP2KMz4mQZ9" alt=""><figcaption><p>Search</p></figcaption></figure>

### 快速学习案例

> 下面是所有 Bot 监控类型的案例，你可以在这里学习如何配置 Bot 监控。但是我们强烈建议你学习完整个文档再行配置。

[ChainBot 所有 Bot 监控案例。](https://chainbot.io/list/43)


# 监控/Bot

Bot 是 ChainBot 里的一个监控配置。

Bot 的基本组成要素包含三个部分，分别为：Info，Condition(s)，Notify Template。用户可根据需求配置该 Bot 的参数。

目前 ChainBot 已支持的 Bot 监控类型有：

| Bot Type           | DataSource Type           |
| ------------------ | ------------------------- |
| Event Bot 监控       | 链上数据源                     |
| Dex Bot 监控         | 链上数据源                     |
| Transaction Bot 监控 | 链上数据源                     |
| Block Bot 监控       | 链上数据源                     |
| Arweave Bot 监控     | 链上数据源                     |
| NFT Bot 监控         | 混合数据源（Ethereum + OpenSea） |
| Snapshot Bot 监控    | 三方数据源（Snapshot 数据源）       |


# Transaction Bot 监控

### Transaction Bot 监控是什么？

Transaction Bot 监控主要用于链上交易监控。

### Transaction Bot 监控典型场景

1. 监控目标发送人的交易
2. 监控目标接受人的交易
3. 监控 ETH 大于或小于目标阈值发送告警
4. 监控特定 methodId 的交易

**支持的数据源**

| 数据源           | 类型       | 稳定性 |
| ------------- | -------- | --- |
| Ethereum      | on chain | 极高  |
| BSC           | on chain | 高   |
| Avalanche     | on chain | 高   |
| Polygon Pos   | on chain | 高   |
| Arbitrum      | on chain | 高   |
| Optimism      | on chain | 高   |
| Polygon zkEVM | on chain | 高   |
| ZkSync Era    | on chain | 高   |
| Base          | on chain | 高   |
| Scroll        | on chain | 高   |
| Manta         | on chain | 高   |
| ZKFair        | on chain | 高   |
| Blast         | on chain | 高   |
| Linea         | on chain | 高   |
| B2            | on chain | 高   |
| Merlin        | on chain | 高   |

### 如何配置 Transaction Bot 监控？

登录 ChainBot 平台后，右上角 "Create Bot" -> "Transaction Monitor"。

<figure><img src="/files/HQL7YSB4iLxk76UU5pef" alt=""><figcaption><p>Create a Transaction Bot</p></figcaption></figure>

#### Info 说明

| 字段名      | 说明               | 是否必填 |
| -------- | ---------------- | ---- |
| Name     | Bot 监控名          | 是    |
| Chain    | 选定的 Chain        | 是    |
| Contract | 选定的智能合约地址        | 是    |
| Function | 选定的智能合约的方法       | 是    |
| Tags     | Bot 监控 tags，利于搜索 | 是    |

#### Conditions 说明

<table><thead><tr><th>参数</th><th width="202.33333333333331">Symbol</th><th>说明</th></tr></thead><tbody><tr><td>From</td><td>==, in</td><td>发送交易的 from 参数，不同链的格式不同</td></tr><tr><td>To</td><td>==, in</td><td>发送交易的 to 参数</td></tr><tr><td>Value</td><td>>, >=, &#x3C;, &#x3C;=, ==, !=, in</td><td>发送交易的 value 参数，默认为 wei，1ETH == 1000000000000000000</td></tr><tr><td>methodId</td><td>==, in</td><td>发送交易的 MethodID，必须为 0x 开头的4个字节，例如 0x95d89b41</td></tr><tr><td>data</td><td>可以为空</td><td>整体字符串</td></tr></tbody></table>

#### 模板变量说明

<table><thead><tr><th width="331">变量</th><th>说明</th></tr></thead><tbody><tr><td>$subscription.name</td><td>订阅名称，一般和 Bot 监控同名</td></tr><tr><td>$chain.explore</td><td>链浏览器前缀</td></tr><tr><td>$chain.network</td><td>链的 chainId</td></tr><tr><td>$block.time</td><td>交易产生的区块时间</td></tr><tr><td>$tx.hash</td><td>交易 hash</td></tr><tr><td>$tx.height</td><td>交易产生的区块高度</td></tr><tr><td>$tx.nonce</td><td>交易 nonce 值</td></tr><tr><td>$tx.from</td><td>交易发送地址</td></tr><tr><td>$tx.to</td><td>交易接收地址</td></tr><tr><td>$tx.value</td><td>交易以太数值，如果以 ETH 为单位，则应该填写 $tx.value/1e18</td></tr><tr><td>$tx.gas</td><td>交易消耗的 Gas 费</td></tr><tr><td>$tx.gasPrice</td><td>交易的 gasPrice</td></tr><tr><td>$tx.input</td><td>交易的 input_data</td></tr><tr><td>$tx.type</td><td>交易类型</td></tr><tr><td>$tx.accessList</td><td>支持部分交易</td></tr><tr><td>$tx.chainId</td><td>交易的 ChainID</td></tr><tr><td>$tx.maxFeePerGas</td><td>ERC-1155 之后才有</td></tr><tr><td>$tx.maxPriorityFeePerGas</td><td>ERC-1155 之后才有</td></tr><tr><td>$tx.r</td><td>交易签名的 R 值</td></tr><tr><td>$tx.s</td><td>交易签名的 S 值</td></tr><tr><td>$tx.v</td><td>交易签名的 V 值</td></tr><tr><td>$tx.method</td><td>交易的方法名</td></tr></tbody></table>

#### 默认告警模板

```
[{$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}
```

[了解告警通知模板？](/zh/advanced-features/alarm-notification-template)

#### 通知消息示例

> \[ Transaction Monitor ]\
> Name: mim增发监控\
> 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 监控案例

[Transaction Bot 案例](/zh/bot-case/transaction-bot-demo)


# Event Bot 监控

### Event bot 监控是什么？

> Event 是指智能合约中的 event，当某个交易发生时，对触发对应的 event，因此用户可以通过监听该 event 进而达到追溯该交易的目的。

Event 监控通过监听智能合约中 event 的产生达到监听链上特定行为的目的。

### Event Bot 监控的典型场景

1. Defi 流动性事件监控
   1. Defi 流动性大于设置的阈值
   2. Defi 流动性小于设置的阈值
2. NFT mint 事件监控
   1. 某个 NFT 开始 mint
3. Token mint 事件监控
   1. Token 大额解锁监控
4. 其他等等

#### 支持的数据源

| 数据源           | 类型       | 稳定性 |
| ------------- | -------- | --- |
| Ethereum      | on chain | 极高  |
| BSC           | on chain | 高   |
| Avalanche     | on chain | 高   |
| Polygon Pos   | on chain | 高   |
| Arbitrum      | on chain | 高   |
| Optimism      | on chain | 高   |
| Polygon zkEVM | on chain | 高   |
| ZkSync Era    | on chain | 高   |
| Base          | on chain | 高   |
| Scroll        | on chain | 高   |
| Manta         | on chain | 高   |
| ZKFair        | on chain | 高   |
| Blast         | on chain | 高   |
| Linea         | on chain | 高   |
| B2            | on chain | 高   |
| Merlin        | on chain | 高   |

### 如何配置 Event Bot 监控？

登录 ChainBot 平台后，右上角 "Create Bot" -> "Event Monitor"。

<figure><img src="/files/vfH5ApWYww3Y8Hl8O4kh" alt=""><figcaption><p>Chosen Event Monitor</p></figcaption></figure>

⚠️ 注意

当选择指定的 Event 时，Conditions 会自动解析出该 Event 所包含的字段，且只能是该 Event 的字段。因此 Event 和 Conditions 为对应关系。

#### Info 说明

| 字段名      | 说明               | 是否必填 |
| -------- | ---------------- | ---- |
| Name     | 监控 Bot 名称        | 是    |
| Chain    | 用户选定的链           | 是    |
| Contract | 用户选定的合约          | 是    |
| Event    | 用户选定的事件          | 是    |
| Tags     | Bot 监控 tags，利于搜索 | 是    |

#### Conditions 说明

Event 监控中的 condition 根据选定的 Event 而动态变化。

比如监控 USDT 合约中的 Approval 事件时，由于 Event Approval(owner: address, spender: address, value uint256) 的参数为三个，因此在 conditions 中可选的 field 也为三个，分别为 owner, spender, value，根据您的条件配置您的参数即可达到目的。

#### 模板变量说明

| 变量                  | 说明                      | 示例                      |
| ------------------- | ----------------------- | ----------------------- |
| $alert.time         | 该事件产生的区块                | 16073651                |
| $tx.hash            | 产生该事件的 transaction hash | transaction hash        |
| $event.contract     | 产生该事件的合约地址              | 16073651                |
| $event.params.{abc} | 事件产生后，解析出事件中关键的字段。      | $event.params.tokens    |
| $chain.explore      | 当前链浏览器的前缀               | <https://etherscan.io/> |

#### 默认通知模板

```
[ {$bot.name} ]
Contract: {$event.contract}
Time: {$alert.time}
Explore: {$chain.explore}/tx/{$tx.hash}
```

[了解告警通知模板？](/zh/advanced-features/alarm-notification-template)

#### 通知消息示例

> \[ CRV Liquidation Call Monitor ]\
> Contract: 0x7d2768dE32b0b80b7a3454c06BdAc94A69DDc7A9\
> Amount: 187743.2161384799 CRV\
> Time: 2022-11-23T02:09:23+08:00\
> Explore: <https://etherscan.io/tx/0x47ffc7939cf8deed6a28357934f98402892b370ac2d3be0c6576f733f6d97b1e>\
> Created By [ChainBot.io](http://chainbot.io/)

#### Event Bot 监控案例

[Event Bot 案例](/zh/bot-case/event-bot-demo)


# DEX Bot 监控

### Dex Bot 监控是什么？

DEX Bot 监控是针对 DEX 的需求场景而设计的监控类型。该主要功能是监控各去中心化交易所的相关事件。

### Dex Bot 监控典型场景

1. Dex 上大额成交监控
2. Dex 上流动性大额移除监控
3. Dex 上流动性大额百分比监控
4. Dex 上流动性阈值监控
5. Dex 上币价波动监控

#### 支持的数据源

| 数据源         | 类型       | 稳定性 |
| ----------- | -------- | --- |
| Ethereum    | on chain | 极高  |
| BSC         | on chain | 高   |
| Avalanche   | on chain | 高   |
| Polygon PoS | on chain | 高   |
| Arbitrum    | on chain | 高   |
| Optimism    | on chain | 高   |
| Base        | on chain | 高   |
| ZKFair      | on chain | 高   |
| Blast       | on chain | 高   |

#### 支持的 Swap

| Chain       | Dex                                  |
| ----------- | ------------------------------------ |
| Ethereum    | UniswapV2, UniswapV3, Sushiswap      |
| BSC         | Pancakeswap V2                       |
| Avalanche   | TraderJoe, Pangolin                  |
| Polygon PoS | UniswapV2, UniswapV3, MMF, Quickswap |
| Arbitrum    | UniswapV3, Sushiswap, Chronos        |
| Optimism    | UniswapV3                            |
| Base        | UniswapV3                            |
| ZKFair      | SideSwap                             |
| Blast       | Thruster                             |

### 如何配置 Dex Bot 监控？

登录 ChainBot 平台后，右上角 "Create Bot" -> "Dex Monitor"。

<figure><img src="/files/stFHqjLFzTVuZEEuXJiF" alt=""><figcaption><p>Create Dex Monitor</p></figcaption></figure>

**Info 说明**

| 字段名      | 说明               | 是否必填 |
| -------- | ---------------- | ---- |
| Name     | Bot 监控名          | 是    |
| Chain    | 选定的 Chain        | 是    |
| Contract | 选定的智能合约地址        | 是    |
| Function | 选定的智能合约的方法       | 是    |
| Tags     | Bot 监控 tags，利于搜索 | 是    |

#### Conditions 说明

| Price     | Below                | dex 中指定 token ​的价格低于设置的阈值          |
| --------- | -------------------- | ---------------------------------- |
|           | Above                | dex 中指定 token ​的​​价格高于设置的阈值        |
|           | ChangeRisesRate      | dex 中指定 token ​价格上涨百分率             |
|           | ChangeDropsRate      | dex 中指定 token ​价格下跌百分率             |
|           | ChangeRisesDropsRate | dex 中指定 token ​价格上涨或者下跌百分率，两个同时都监控 |
| Liquidity | Below                | 流动性低于设置的阈值                         |
|           | Above                | 流动性高于设置的阈值                         |
|           | ChangeRisesRate      | dex 中指定 pair 的流动性上涨百分率             |
|           | ChangeDropsRate      | dex 中指定 pair 的流动性下跌百分率             |
|           | ChangeRisesDropsRate | dex 中指定 pair 的流动性上涨或下跌百分率          |
|           | WhaleAdd             | 大额流动性添加                            |
|           | WhaleRemove          | 大额流动性移除                            |
|           | WhaleAddRemove       | 大额流动性添加或者移除                        |
| Swap      | WhaleSell            | 大额卖出                               |
|           | WhaleBuy             | 大额买入                               |
|           | WhaleBuySell         | 大额买卖                               |

**模板变量说明**

| $tokenBase.symbol    | tokenBase 的 symbol，比如 WBTC                   |
| -------------------- | -------------------------------------------- |
| $tokenBase.decimals  | ​tokenBase 的 decimals，比如 18                  |
| $tokenBase.address   | ​tokenBase 的链上地址                             |
| $tokenQuote.symbol   | ​tokenQuote 的 symbol，比如 WETH                 |
| $tokenQuote.decimals | ​tokenQuote 的 decimals，比如 18                 |
| $tokenQuote.address  | tokenQuote 的链上地址                             |
| $tokenQuote.balance  | tokenQuote 的余额（只在流动性变化的时候支持）                 |
| $tokenIn.symbol      | ​tokenIn 的 symbol，比如 wbtc                    |
| $tokenIn.decimals    | ​tokenIn 的 decimals，比如 18                    |
| $tokenIn.address     | ​tokenIn 的链上地址                               |
| $tokenOut.symbol     | ​​tokenOut 的 symbol，比如 weth                  |
| $tokenOut.decimals   | ​​tokenOut 的 decimals，比如 18                  |
| $tokenOut.address    | ​​tokenOut 的链上地址                             |
| ​$dex.name           | DEX 的名字，比如 uniswap                           |
| $value               | 目标 token 在 dex 兑换的数量                         |
| $price               | 目标 token 兑换的价格，以 base token wei 计价单位         |
| $priceUSD            | 目标 token 兑换成 U 的价格，以 U 计价                    |
| $changed.duration    | ​指标变动时间范围                                    |
| $changed.rate        | ​指标变动百分率                                     |
| $action              | 监控指标的行为，add（添加）/ remove（移除）/ buy（买）/ sell（卖） |

#### 术语说明

1. tokenBase：为基准 token，例如：WBTC/WETH 交易对中，其中 WBTC 为 tokenBase。
2. tokenQuote：为基准 token 定价的 token，例如：WBTC/WETH 交易对中，其中 WETH 为 tokenQuote。
3. tokenIn：在 dex 中使用 swap 功能使用 a 换 b时，其中 a 为 tokenIn，b 为 tokenOut。即：将 a token 放进流动性池子中，从流动性池子中拿出 b token 的行为。例如：swap WBTC/WETH 时，此时 WBTC 为 tokenIn，WETH 则为 tokenOut。
4. tokenBase, tokenQuote, tokenIn, tokenOut 均为 ERC20 的 Token，因此都有 name, symbol, decimals, address 等标准 ERC20 的方法。

#### 默认告警模板

大额成交 Swap-WhaleSwap

{% code overflow="wrap" lineNumbers="true" %}

```shell
[ 🐳 {$bot.name} ]
Pair: {$dex.tokenBase.symbol}/{$dex.tokenQuote.symbol} on {$dex.name}
Value: {$dex.value} USD
Action: {$dex.tokenIn.amount} {$dex.tokenIn.symbol} -> {$dex.tokenOut.amount} {$dex.tokenOut.symbol} at price {$dex.price} USD
Explore: {$chain.explore}/tx/{$tx.hash}
```

{% endcode %}

流动性大额 Liquidity-WhaleAdd/WhaleRemove/WhaleAdRemove

{% code overflow="wrap" lineNumbers="true" %}

```shell
[ 🐳 {$bot.name} ]
Pair: {$dex.tokenBase.symbol}/{$dex.tokenQuote.symbol} on {$dex.name}
Value: {$dex.value} USD
Action: {$dex.tokenIn.amount} {$dex.tokenIn.symbol} -> {$dex.tokenOut.amount} {$dex.tokenOut.symbol} at price {$dex.price} USD
Explore: {$chain.explore}/tx/{$tx.hash}
Created By ChainBot.org
```

{% endcode %}

流动性大额百分比 Liquidity-WhaleAddPercent/WhaleRemovePercent/WhaleAddRemovePercent

{% code overflow="wrap" lineNumbers="true" %}

```shell
[ 🐳 {$bot.name} ]
Pair: {$dex.tokenBase.symbol}/{$dex.tokenQuote.symbol} on {$dex.name}
Value: {$dex.value} USD
Action: {$dex.action} more than {$dex.changed.rate}% liquidity to pool
Explore: {$chain.explore}/tx/{$tx.hash}
Created By ChainBot.org
```

{% endcode %}

流动性阈值 Liquidity-Above/Below

{% code overflow="wrap" lineNumbers="true" %}

```shell
[ {$bot.name}  ]
📉📈 {$dex.tokenBase.symbol}/{$dex.tokenQuote.symbol} liquidity on {$dex.name} above/below {$dex.changed.rate} in the past {$dex.changed.duration}
current liquidity is {$dex.tokenQuote.balance} {$dex.tokenQuote.symbol}
```

{% endcode %}

流动性波动比率 Liquidity-ChangeRisesRate/ChangeDropsRate/ChangeRisesDropsRate

{% code overflow="wrap" lineNumbers="true" %}

```shell
[ {$bot.name}  ]
📉📈 {$dex.tokenBase.symbol}/{$dex.tokenQuote.symbol} liquidity on {$dex.name} {$dex.direction} {$dex.changed.rate} in the past {$dex.changed.duration}
current liquidity is {$dex.tokenQuote.balance} {$dex.tokenQuote.symbol}
```

{% endcode %}

币价波动 Price-ChangeRisesRate/ChangeDropsRate/ChangeRisesDropsRate

{% code overflow="wrap" lineNumbers="true" %}

```shell
[ {$bot.name} ]
📉📈 {$dex.tokenBase.symbol}/{$dex.tokenQuote.symbol} price on {$dex.name} {$dex.direction} {$dex.changed.rate} in the past {$dex.changed.duration}
current price is {$dex.price} {$dex.tokenQuote.symbol}
```

{% endcode %}

币价阈值监控 Price-Above/Below

{% code overflow="wrap" lineNumbers="true" %}

```shell
[ {$bot.name} ]
📉📈 {$dex.tokenBase.symbol}/{$dex.tokenQuote.symbol} price on {$dex.name} {$dex.direction} {$dex.setPrice}. 
current price {$dex.price} USD.
```

{% endcode %}

[了解告警通知模板？](/zh/advanced-features/alarm-notification-template)

#### 通知消息示例

> \[ 🐳 Whale swap on Uniswap ETH/USDT pool ]\
> Pair: WETH/USDT on UniswapV3\
> Value: 51.237884 USD\
> Action: 0.0404716445741972 WETH -> 51.237884 USDT at price 1266.019321405753878 USD\
> Explore: <https://etherscan.io/tx/0xef1cd8f1edfbfa7fc2efe74b814c3535c333921cedae9aaad66a9d969ab885b8>\
> Created By [ChainBot.io](https://www.chainbot.io)

#### Dex Bot 监控案例

[Dex Bot 案例](/zh/bot-case/dex-bot-demo)


# Value Bot 监控

### Value Bot 监控是什么？

Value Bot 监控是针对数值变化而设计的一种监控类型。主要功能是监控某个对象的数值变化，当数值变化达到预设的阈值时，将会触发报警。

### Value Bot 监控典型场景

1. 监控 Token 余额变化
2. 监控 Curve 稳定币占比百分比的变化

#### 支持的数据源

| 数据源           | 类型       | 稳定性 |
| ------------- | -------- | --- |
| Ethereum      | on chain | 极高  |
| BSC           | on chain | 高   |
| Avalanche     | on chain | 高   |
| Polygon Pos   | on chain | 高   |
| Arbitrum      | on chain | 高   |
| Optimism      | on chain | 高   |
| Polygon zkEVM | on chain | 高   |
| ZkSync Era    | on chain | 高   |
| Base          | on chain | 高   |
| Scroll        | on chain | 高   |
| Manta         | on chain | 高   |
| ZKFair        | on chain | 高   |
| Blast         | on chain | 高   |
| Linea         | on chain | 高   |
| B2            | on chain | 高   |
| Merlin        | on chain | 高   |

### 如何配置 Value Bot 监控？

登录 ChainBot 平台后，右上角 "Create Bot" -> "Value Monitor"。

<figure><img src="/files/5VVNTNsyXkImUhtne8wV" alt=""><figcaption><p>Create a Value Bot</p></figcaption></figure>

**Info 说明**

<table><thead><tr><th width="183.33333333333331">字段名</th><th width="280">说明</th><th>是否必填</th></tr></thead><tbody><tr><td>Name</td><td>Bot 监控名</td><td>是</td></tr><tr><td>Chain</td><td>选定的 Chain</td><td>是</td></tr><tr><td>Contract</td><td>选定的智能合约地址</td><td>是</td></tr><tr><td>Function</td><td>选定的智能合约的方法</td><td>是</td></tr><tr><td>Interval</td><td>数据打点间隔，即每隔 interval 的时间，拉取一次配置的数据源的数据</td><td>是</td></tr><tr><td>Baseline Trigger</td><td>若勾选此项，则触发条件作为基线，当数值达到基线，后续满足条件也不会重复触发。只有离开基线后再次回归，才会再次触发。</td><td>是</td></tr><tr><td>Fields</td><td>需要处理的数值字段</td><td>是</td></tr><tr><td>Tags</td><td>Bot 监控 tags，利于搜索</td><td>是</td></tr></tbody></table>

#### Fields 说明

> 由多个 Field 字段组成，单独的 Field 是个对象，包含 field, formater 的类型。其中 formater 是
>
> 一段 js 代码，用户需要自己定义格式化最终数值的代码。

#### 内置的函数

<table><thead><tr><th width="305">Function Name</th><th>说明</th></tr></thead><tbody><tr><td>tokenPrice(symbol)</td><td>获取 token 的U本位价格，例如 tokenPrice('weth')</td></tr><tr><td>bot(botId)</td><td>引用特定的 Bot 的内容，例如 bot('1')</td></tr><tr><td>add(x,y)</td><td>x+y</td></tr><tr><td>sub(x,y)</td><td>x-y</td></tr><tr><td>mul(x,y)</td><td>x*y</td></tr><tr><td>div(x,y)</td><td>x/y &#x26;&#x26; y != 0</td></tr><tr><td>pow(x,y)</td><td>x^y</td></tr></tbody></table>

#### 支持的 U 计价的币种

> 自动获取 token U 本位价格，数据源来自链上流动性最高的交易对，后续将会支持更多的Token。

| Token  | Pool                                                                                      |
| ------ | ----------------------------------------------------------------------------------------- |
| WBTC   | [WBTC/BUSD](https://bscscan.com/address/0xF45cd219aEF8618A92BAa7aD848364a158a24F33)       |
| WETH   | [WETH/USDT](https://etherscan.io/address/0x0d4a11d5eeaac28ec3f61d100daf4d40471f1852)      |
| WBNB   | [WBNB/BUSD](https://bscscan.com/address/0x58F876857a02D6762E0101bb5C46A8c1ED44Dc16)       |
| WMATIC | [WMATIC/USDC](https://polygonscan.com/address/0x6e7a5FAFcec6BB1e78bAE2A1F0B612012BF14827) |
| WAVAX  | [WAVAX/USDC](https://snowtrace.io/address/0xf4003F4efBE8691B60249E6afbD307aBE7758adb)     |
| WFTM   | [WFTM/USDC](https://ftmscan.com/address/0x2b4c76d0dc16be1c31d4c1dc53bf9b45987fc75c)       |
| CAKE   | [CAKE/USDC](https://bscscan.com/address/0xa39af17ce4a8eb807e076805da1e2b8ea7d0755b)       |

**Conditions 说明**

conditions 中的字段解析是动态的，会跟随配置的 Fields 的内容变化。其中 Condition 的 Key 为 Field 的内容，二者保持一致。condition 中的 value 为用户设置的阈值，最后比较的时候会使用 Field formater 后的 value 和 condition 中的 value 比较，因此用户在配置时，需要注意单位换算。

**模板变量说明**

| $subscription.name | 订阅名称，一般和 Bot 监控同名                     |
| ------------------ | ------------------------------------- |
| $block.height      | 区块高度                                  |
| $value.{}          | formater 后的数值，为动态解析，比如 $value.balance |
| $condition         | 所有 condition 内容专为字符串                  |
| $alert.time        | 区块时间                                  |

#### 默认告警模板

```
[{$bot.name}]
Block: {$block.height}
Values:{$value.values.ltv}
Condition: {$value.condition}
Time: {$alert.time}
```

[了解告警通知模板？](/zh/advanced-features/alarm-notification-template)

#### 通知消息示例

> \[ENS Governance ETH Balance > 35000 ETH]
>
> Block: 16046035
>
> Balance: 35335.915888
>
> Condition: (5m) balance last > 35000
>
> Time: 2022-11-25T17:14:30+08:00
>
> Created By [ChainBot.io](https://www.chainbot.io)

#### Value Bot 监控案例

[Value Bot 案例](/zh/bot-case/value-bot-demo)


# NFT Bot 监控

### NFT Bot 监控是什么？

NFT Bot 监控主要围绕着 NFT 价格变更，订单变更，以及所属权的转移而设计的。

### NFT Bot 监控典型场景

1. 监控 NFT 地板价的变更
   1. BAYC NFT 地板价大于 100E
   2. BAYC NFT 地板价小于 100E
2. 监控 NFT 的转移
   1. BAYC #1 从 A 地址转移到 B 地址
3. 监控指定 NFT 的所有者收到的 offer
4. 监控目标地址买入 NFT 的行为

**支持的数据源**

| 数据源      | 类型       | 稳定性 |
| -------- | -------- | --- |
| Ethereum | on chain | 极高  |

#### 支持的数据源

| 数据源      | 类型 | 稳定性 |
| -------- | -- | --- |
| Ethereum | 链上 | 极高  |

#### 支持的 Market

| Market  | 稳定性 |
| ------- | --- |
| OpenSea | 高   |

*\*我们正在计划支持更多的 Market。*

### 如何配置 NFT Bot 监控？

登录 ChainBot 平台后，右上角 "Create Bot" -> "NFT Monitor"。

<figure><img src="/files/OT8MKHdFtS8FqIWAG4Bj" alt=""><figcaption><p>Create a NFT Bot</p></figcaption></figure>

#### Info 说明

| 字段名      | 说明                           | 是否必填 |
| -------- | ---------------------------- | ---- |
| Name     | Bot 监控名称                     | 是    |
| Chain    | 选择已支持的链                      | 是    |
| Contract | 选择 NFT 合约，ERC 721 或 ERC 1155 | 是    |
| Market   | NFT 交易市场                     | 是    |
| Event    | NFT 行为类型                     | 是    |
| Tags     | Bot 监控 tags，利于搜索             | 是    |

#### Event 类型

<table><thead><tr><th width="313">类型</th><th>说明</th></tr></thead><tbody><tr><td>Listed</td><td>NFT上架</td></tr><tr><td>MetadataUpdated</td><td>NFT 的 metadata 更新</td></tr><tr><td>Sold</td><td>NFT 被卖出</td></tr><tr><td>Transferred</td><td>NFT 所有权被转移</td></tr><tr><td>ReceivedBid</td><td>收到的竞价</td></tr><tr><td>ReceivedOffer</td><td>收到的出价</td></tr><tr><td>Cancelled</td><td>NFT 被取消上架</td></tr><tr><td>FloorPrice</td><td>collection 地板价</td></tr></tbody></table>

#### Conditions 说明

| 参数           | Symbol       | 说明                 |
| ------------ | ------------ | ------------------ |
| makerAddress | ==           | maker 地址           |
| takerAddress | ==           | taker 地址           |
| price        | >, >=, <, <= | NF                 |
| token\_id    | ==           | 目标 NFT 的 token\_id |

#### 模板变量

<table><thead><tr><th width="283">变量</th><th width="467">说明</th></tr></thead><tbody><tr><td>$taker.address</td><td>taker 地址</td></tr><tr><td>$maker.address</td><td>maker 地址</td></tr><tr><td>$collection.slug</td><td>交易平台的nft 标识</td></tr><tr><td>$item.opensea_link</td><td>到 OpenSea 的 item 页面的链接</td></tr><tr><td>$item.token_id</td><td>需要从 item.nft_id 中取出来最后的token id</td></tr><tr><td>$payment.symbol</td><td>支付 Symbol 一般为 WETH</td></tr><tr><td>$payment.price</td><td>取 sale_price 或者 base_price ，需要用户处理 decimals ；</td></tr><tr><td>$payment.usd_price</td><td>对应原始的 payment.usd_price 字段</td></tr><tr><td>$quantity</td><td>token 的数量，721协议都是1，1155可能是多个</td></tr><tr><td>$transaction.hash</td><td>链上 transaction hash</td></tr><tr><td>$transaction.timestamp</td><td>RFC3339</td></tr><tr><td>$subscriptions.name</td><td>Bot 监控名称</td></tr><tr><td>$monitor.market</td><td>Bot 监控的 market，目前为 OpenSea</td></tr><tr><td>$event.type</td><td>取值 Listed 等</td></tr><tr><td>$event.timestamp</td><td>RFC3339</td></tr><tr><td>$chain.explore</td><td>公链的浏览器前缀，<a href="https://etherscan.io/">https://etherscan.io/</a></td></tr></tbody></table>

#### 默认告警模板

{% code overflow="wrap" lineNumbers="true" %}

```shell
[{$bot.name}]
New {$nft.event} event for {$nft.slug} #{$nft.token_id} at {$nft.market}
View : {$nft.market_link}
Time: {$alert.time}
```

{% endcode %}

[了解告警通知模板？](/zh/advanced-features/alarm-notification-template)

#### 通知消息示例

> \[ Listed monitor for BAYC ]\
> New Listed event for friendship-bracelets-by-alexis-andre #24805 at opensea\
> View : <https://opensea.io/collection/friendship-bracelets-by-alexis-andre>\
> Time: 2022-11-30T14:07:23+08:00\
> Created By [ChainBot.io](https://www.chainbot.io)

#### NFT Bot 监控案例

[NFT Bot 监控](/zh/basic-usage/bots/nft-bot)


# Snapshot Bot 监控

### Snapshot Bot 监控是什么？

Snapshot Bot 监控用于监控 Snapshot 提案，可监控新提案的产生，也可监控已存在提案的状态变更。

[了解 Snapshot 是如何工作的？](https://docs.snapshot.org/)

### Snapshot Bot 监控典型场景

1. 新提案的发布
2. 提案进入投票阶段
3. 提案投票结束
4. 提案被删除

**支持的数据源**

| 数据源      | 类型        | 稳定性 |
| -------- | --------- | --- |
| Snapshot | off chain | 高   |

### 如何配置 Snapshot Bot 监控？

登录 ChainBot 平台后，右上角 "Create Bot" -> "Snapshot Monitor"。

<figure><img src="/files/G2a91uYem6YioEADU4ty" alt=""><figcaption><p>Create a Snapshot Bot</p></figcaption></figure>

#### Info 说明

| 字段名   | 说明                               | 是否必填 |
| ----- | -------------------------------- | ---- |
| Name  | Bot 监控名称                         | 是    |
| Space | Snapshot 平台 space 名称，通常是 ENS 域名。 | 是    |
| Tags  | Bot 监控 tags，利于搜索                 | 是    |

#### Conditions 说明

<table><thead><tr><th>字段名</th><th width="249.33333333333331">说明</th><th>是否必填</th></tr></thead><tbody><tr><td>Event</td><td>支持的提案状态</td><td>是</td></tr></tbody></table>

#### Event 类型

| 类型               | 说明         |
| ---------------- | ---------- |
| proposal/created | 新提案产生      |
| proposal/start   | 提案进入投票阶段   |
| proposal/end     | 提案结束投票     |
| proposal/deleted | 提案被删除      |
| Any              | 为上述四个状态的父集 |

#### 模板变量

<table><thead><tr><th width="219.33333333333331">变量</th><th width="208">说明</th><th>示例</th></tr></thead><tbody><tr><td>$proposal.id</td><td>提案 ID</td><td>proposal/0x38c654c0f81b63ea1839ec3b221fad6ecba474aa0c4e8b4e8bc957f70100e753</td></tr><tr><td>$proposal.title</td><td>提案名称</td><td>SIP#20 Continued Balance and Rebalancing</td></tr><tr><td>$proposal.author</td><td>提案发起人</td><td>pistachiodao.eth</td></tr><tr><td>$proposal.state</td><td>提案状态</td><td>proposal/created</td></tr><tr><td>$proposal.network</td><td>提案网络，为 ChainID</td><td>1</td></tr><tr><td>$proposal.link</td><td>Snapshot 提案链接</td><td><a href="https://snapshot.org/#/stgdao.eth/proposal/0x714977397be501e7f854293401370ab89d8c9261f533d7bb551d0c29ade5755f">https://snapshot.org/#/stgdao.eth/proposal/0x714977397be501e7f854293401370ab89d8c9261f533d7bb551d0c29ade5755f</a></td></tr><tr><td>$event</td><td>提案状态</td><td>proposal/created</td></tr><tr><td>$space</td><td>提案的 Space</td><td>pistachiodao.eth</td></tr><tr><td>$time</td><td>提案产生时间</td><td>2022-11-29T03:20:46+08:00</td></tr></tbody></table>

#### 默认通知模板

{% code overflow="wrap" lineNumbers="true" %}

```shell
[{$bot.name}]
Proposal: {$snapshot.proposal.title}
Space: {$snapshot.space.id}
Event: {$snapshot.event}
Time: {$snapshot.time}
Detail: {$snapshot.proposal.link}
```

{% endcode %}

[了解告警通知模板？](/zh/advanced-features/alarm-notification-template)

#### 通知消息示例

> \[ Stargate new proposal]
>
> Proposal: SIP #16 - New Assets - DAI, FRAX, sUSD, LUSD
>
> Space: stgdao.eth
>
> Event: proposal/created
>
> Time: 2022-09-30T19:23:47+08:00
>
> Detail:<https://snapshot.org/#/stgdao.eth/proposal/0xe6fef4aa9c8e9d162f694ab764b11c06918b9f199aafe43e0d85b12d8271011c>
>
> Created By [ChainBot.io](https://www.chainbot.io)

#### Snapshot Bot 监控案例

[Snapshot Bot 案例](/zh/bot-case/snapshot-bot-demo)


# Block Bot 监控

### Block Bot 监控是什么？

Block Bot 监控用于对目标链区块 Gas 消耗情况的追踪，从而达到对链可能发生情况做预判的目的。

### Block Bot 监控典型场景

1. 区块 Gas Fee 数值监控
2. 区块 Gas 消耗占总区块限制最大比例的监控
3. 监控区块 miner

**支持的数据源**

| 数据源      | 类型       | 稳定性 |
| -------- | -------- | --- |
| Ethereum | on chain | 极高  |

### 如何配置 Block Bot 监控？

登录 ChainBot 平台后，右上角 "Create Bot" -> "Block Monitor"。

<figure><img src="/files/XHEMMvZf3BkCrzazKMJk" alt=""><figcaption><p>Create a Block Bot</p></figcaption></figure>

#### Info 说明

| 字段名   | 说明               | 是否必填 |
| ----- | ---------------- | ---- |
| Name  | Bot 监控名          | 是    |
| Chain | 用户选择的链           | 是    |
| Tags  | Bot 监控 tags，利于搜索 | 是    |

#### Conditions 说明

| 参数             | Symbol           | 说明          |
| -------------- | ---------------- | ----------- |
| Miner          | ==               | 监控特定矿工产出区块  |
| BlockNumber    | >, >=, <, <=, == | 区块高度        |
| BaseFeePerGas  | >, >=, <, <=, == | 区块 Gas Fee  |
| GasUsedPercent | >, >=, <, <=, == | 区块 Gas 消耗占比 |

#### 模板变量说明

| 变量                    | 说明            |
| --------------------- | ------------- |
| $block.number         | 区块高度          |
| $block.baseFeePerGas  | 区块 gas fee    |
| $block.gasUsedPercent | 区块消耗 Gas 的百分比 |
| $block.miner          | 矿工地址          |
| $block.time           | 区块产生时间        |

#### 默认告警模板

```
[{$bot.name}]
View: https://etherscan.io/block/{$block.height}
Time: {$alert.time}
```

[了解告警通知模板？](/zh/advanced-features/alarm-notification-template)

#### 通知消息示例

> \[ Ethereum Base Fee monitor ]\
> BaseFee: 10.35 Gwei\
> View: <https://etherscan.io/block/16081313>\
> Time: 2022-11-30T11:28:11+04:00\
> Created By [ChainBot.io](https://www.chainbot.io)

#### Block Bot 监控案例

[Block Bot 案例](/zh/bot-case/block-bot-demo)


# Arweave Bot 监控

### Arweave Bot 监控是什么？

Arweave 是一条去中心化存储链，用户通过 Arweave 上的 tags 对存储在其上的内容进行监听。

[了解 Arweave？](https://www.arweave.org/)

### Arweave Bot 典型场景

1. Mirror 文章监控
2. 其他存储在 Arweave 轻量数据监控

注意：

Arweave 的用户可能给链上存储大型文件，比如 PDF，mp4 格式等，目前 ChainBot 平台并不支持对大文件类型的内容解析。

**支持的数据源**

| 数据源     | 类型       | 稳定性 |
| ------- | -------- | --- |
| Arweave | on chain | 极高  |

### 如何配置 Arweave Bot 监控？

登录 ChainBot 平台后，右上角 "Create Bot" -> "Arweave Monitor"。

<figure><img src="/files/qvwuzaWnDBO8GuGQOBQp" alt=""><figcaption><p>Create a Arweave Bot</p></figcaption></figure>

#### Info 说明

| 字段名  | 说明               | 是否必填 |
| ---- | ---------------- | ---- |
| Name | Bot 监控名          | 是    |
| Tags | Bot 监控 tags，利于搜索 | 是    |

#### Tags Conditions 说明

<table><thead><tr><th>参数</th><th width="233.33333333333331">Symbol</th><th>说明</th></tr></thead><tbody><tr><td>App-Name</td><td>==, in</td><td>Arweave 用户在 Arweave 上标记的应用名，比如 Mirror 会打 "mirrorxyz" 的 tag</td></tr><tr><td>Contributor</td><td>==, in</td><td>Arweave 上内容贡献者，比如 Mirror 的规则为文章撰稿人</td></tr><tr><td>Original-Content-Digest</td><td>empty, notEmpty</td><td>当 Arweave 上的内容被更新时，初次推送内容的 Digest 会被标记为 Original-Content-Digest</td></tr></tbody></table>

#### Data Conditions 说明

用户根据自身条件过滤需要的存储在 Arweave 上内容实体的内容。以 Mirror 为例，假设要监控 Aptos 关键词的文章，则应该填写为：

<figure><img src="/files/je0zzw59s1cpAvQoKOwu" alt=""><figcaption><p>Conditions Demo</p></figcaption></figure>

#### 模板变量说明

<table><thead><tr><th width="340">变量</th><th>说明</th></tr></thead><tbody><tr><td>$data.{}</td><td>从 Arweave 具体内容取到的 data 信息，动态解析</td></tr><tr><td>$tags.{}</td><td>从 Arweave 解析的任意 tag 的值，动态解析</td></tr><tr><td>$tx.id</td><td>Arweave 上的 transaction id</td></tr><tr><td>$tx.owner.address</td><td>Arweave 上的交易发起者</td></tr><tr><td>$block.id</td><td>Arweave 上产生数据的 Block hash</td></tr><tr><td>$block.timestamp</td><td>Arweave 上区块产生的时间戳</td></tr><tr><td>$block.height</td><td>Arweave 上区块产生的高度</td></tr></tbody></table>

#### 默认告警模板

```
[{$bot.name}]
{$data.authorship.contributor} published new article
Title: {$data.content.title}
View: https://mirror.xyz/{$data.authorship.contributor}/{$tags.original_content_digest}
Time: {formatTime($data.content.timestamp)}
```

[了解告警通知模板？](/zh/advanced-features/alarm-notification-template)

#### 通知消息示例

> \[ Aptos Mirror 监控 ]
>
> 0x7620D7991a8469ef7F26B5Da7952e27C16074367 publish new article aptos1021
>
> View: <https://mirror.xyz/0x7620D7991a8469ef7F26B5Da7952e27C16074367/HvyIBgIbHud_9oyx6_MSyuFFWONKFeqtRdUniZmX7lE>
>
> Time: 1669643104
>
> Created By [ChainBot.io](https://www.chainbot.io)

#### Arweave Bot 监控案例

[Arweave Bot 案例](/zh/bot-case/arweave-bot-demo)


# 列表/List

你可以创建 List，并能对自己创建的 List 进行管理。


# 创建 List

### 如何创建 List?

登录 ChainBot 平台后，个人页面选择“My Lists” -> "+ Add List"。

<div align="left" data-full-width="false"><figure><img src="/files/ErTXEPFwudZZuJClZZqA" alt=""><figcaption><p>Create a List</p></figcaption></figure></div>

<figure><img src="/files/Mf7OIFgtx4dfMksaamsM" alt=""><figcaption><p>Create a List</p></figcaption></figure>

#### 创建List时需要的信息

<table><thead><tr><th width="187">字段名</th><th>说明</th><th>是否必填</th></tr></thead><tbody><tr><td>Name</td><td>创建 List 的名称</td><td>是</td></tr><tr><td>Description</td><td>该 List 的详细描述</td><td>是</td></tr></tbody></table>


# 管理 List

### 编辑 List

登录 ChainBot 平台后，个人页面选择 "My Lists"，选择特定的 Card，选择 “Edit”。

<figure><img src="/files/L8enWDpOpL1NnjmocLIr" alt=""><figcaption></figcaption></figure>

### 删除 List

登录 ChainBot 平台后，个人页面选择 "My Lists"，选择特定的 Card，选择 “Delete”。

### 订阅 List

登录 ChainBot 平台后，个人页面选择 "My Lists"，选择特定的 Card，点击 “Subscribe” 按钮，即可订阅该 List 下的所有内容。


# 合约管理/Contract

Contract

为方便用户更灵活的使用 ChainBot 构建自己的监控体系，ChainBot 维护了一份各区块链上合约信息。

在默认情况下，ChainBot 会自动拉取智能合约的 ABI 信息。同时支持手动填写智能合约的相关内容。


# 添加合约

### 如何添加合约

1. 登录后，在用户界面，将会在左侧看到 “ Custom Contract ” 的选项，点击该选项卡，进入配置页面。
2. 点击右上角的 “Add Custom Contract” 的按钮并填写智能合约相关信息。

<figure><img src="/files/SXtINZKX71edbQ2EKICA" alt=""><figcaption><p>Add Contract</p></figcaption></figure>

<figure><img src="/files/bpJVMq7qIbIYYLLQE3Y4" alt=""><figcaption><p>Add Contract</p></figcaption></figure>

合约字段说明

<table><thead><tr><th width="208">字段</th><th>说明</th><th>示例</th></tr></thead><tbody><tr><td>Name</td><td>自定义合约名</td><td>CurveStablecoin3pool</td></tr><tr><td>Chain</td><td>选择 ChainBot 平台已支持的链</td><td>Ethereum,BSC 等等</td></tr><tr><td>Address</td><td>合约地址</td><td>0xdAC17F958D2ee523a2206206994597C13D831ec7</td></tr><tr><td>ABI</td><td>合约相关 ABI 信息，为 json 串</td><td>[]</td></tr><tr><td>Functions / Events</td><td>合约定义的 function 和 event</td><td>function getOwner();<br>event Issue(uint amount);</td></tr></tbody></table>


# 管理合约

在个人页的 Contracts 列表中，你可以看到所有你创建 Contracts。在这里你可以编辑，删除你创建的Contracts。

<figure><img src="/files/rYtRfjqupTzkOGvXY9Jc" alt=""><figcaption><p>Manage Contracts</p></figcaption></figure>


# 通知渠道/Notify Channels

告警通知是 ChainBot 里的重要组成部分。一个完整的监控，通知是必不可少的部分。

ChainBot 支持用户配置 Slack、Discord、Telegram，Dingtalk 等即时通讯类APP，也支持 Pushover、Pagerduty 这样的专业通知产品，还支持用户自定义的 Webhook 推送。

ChainBot 支持同时推送至多个 Channel 中，当该信息设置完成时，所有监控均可使用相关的任意 Channel。

<figure><img src="/files/zmfhNbVKEXq8n6KPnF9i" alt=""><figcaption></figcaption></figure>


# Email

### 如何设置 Email？

在 ChainBot 平台填写Email地址，以及名称。

<figure><img src="/files/Uq9hIneCJaBLpR0S7GYD" alt=""><figcaption></figcaption></figure>


# Slack

### 如何设置 Slack？

点击 "Click here to connect your slack" 的区域，跳转至 slack 授权，并选择 ChainBot 接受消息的 channel。

<figure><img src="/files/bNEaKbveHOVtISIqbiWe" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/oNHldqAnBRqjekKGQg9P" alt=""><figcaption><p>Select a channel</p></figcaption></figure>


# Discord

### 如何设置 Discord？

当给 Discord 服务推送消息时，需要用户在指定 Discord 服务器中创建新的 Webhook 连接。配置流程如下：

1. 在指定的 Discord 服务器上创建一个 Webhook 链接。（如果没有 Discord 服务器，请创建一个。）
2. 复制 Webhook 链接至 ChainBot 平台，并填写该 Webhook 的名称。

<figure><img src="/files/yGYTZN26oOqeYbbEM4uj" alt=""><figcaption></figcaption></figure>

### 如何在 Discord 创建 Webhook

1. 打开 Discord 中指定服务器的 “服务器设置” -> APP -> “整合”。
2. 点击 “新 Webhook”。

   <figure><img src="/files/xPbPGe8j20TjN4nTmEqx" alt=""><figcaption><p>Create Webhook</p></figcaption></figure>

为了区分不同告警的类型，用户可以设置 Webhook 的以下内容：

1. 设置头像
2. 设置接收消息的 Webhook 昵称
3. 设置消息推送至 Discord 中的指定 Channel

<figure><img src="/files/hMz40gRR66MGcYr0xWih" alt=""><figcaption><p>Setting Webhook</p></figcaption></figure>


# Telegram

## Telegram 推送类型

1. [User（消息发送给个人用户）](#ru-he-she-zhi-user)
2. [Group（消息发送给群组）](#ru-he-she-zhi-group)
3. [Channel](#ru-he-she-zhi-channel-qu-dao)[（消息发送给频道）](#ru-he-she-zhi-channel)
4. [Bot（创建自己品牌的 TG Bot）](#ru-he-she-zhi-bot)

对于 1 User、2 Group、3 Channel 类型的推送消息都由 ChainBot 的官方 [Telegram Bot](https://t.me/chainbot_bot) 推送。

对于4 Bot，您可以配置属于自己品牌的 TG Bot，以便将自己的 Bot 传播出去给更多的个人、群组和频道使用。

### 如何设置 User？ <a href="#set-user" id="set-user"></a>

1. 选择Chat Type为User。
2. 点击Get Chat ID跳转到 Telegram 的软件。
3. 选择 "Start" 后，将会收到一条 ChainBot 发送的一条消息，消息内容中包含 Chat ID。
4. 复制 Chat ID 填写到 ChainBot 平台即可。

<figure><img src="/files/BYSatwBfFlEbvnwmgnfY" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/6GeFin0Y0fnsJZMiTBh1" alt=""><figcaption><p>Got your Chat ID</p></figcaption></figure>

<figure><img src="/files/ZQzwqu9RA6HHTMOLHZr3" alt=""><figcaption></figcaption></figure>

### 如何设置 Group？ <a href="#set-group" id="set-group"></a>

1. 选择Chat Type为Group。
2. 将Chainbot机器人拉入到Group。
3. Group分为\*\*Private(私有)和Public(公开)\*\*两类, 首先确认Group的类型。
4. 如果是Private(私有) Group, 需要填写**带负号的Chat ID,** 如 -123456。
5. 如果是Public(公开) Group, 需要填写带\*\*@符号的Group Name,\*\* 如 @chainbot\_group。
6. 复制带负号的Chat ID 或带@符号的Group Name, 填写到 ChainBot 平台即可。

#### 将Chainbot机器人拉入到Group

<figure><img src="/files/iWuCnGPewcNbULTXvg3u" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/L4THdO6Fk8Wlc7WugeZy" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/1IJaPmJhGefZyFlrWLEA" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/7RtIaXcUJ0mrsLLvD2dD" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/XDk3oqBXvWbgNBxayHfb" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/STVdSGV44vFh3NSMVIz2" alt=""><figcaption></figcaption></figure>

#### 确认Group的类型 <a href="#confirm-group-type" id="confirm-group-type"></a>

<figure><img src="/files/qH3Y1RG0L41IhccG4P6E" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/8jlH4K7bLfsiAVnD5C7e" alt=""><figcaption></figcaption></figure>

#### 获取Chat ID或Group Name

**需要在Web端打开Telegram,** [**https://web.telegram.org/**](https://web.telegram.org/)

从网页URL上获取Public Group的Group Name, 如 @chainbot\_public\_group

<figure><img src="/files/TvYB4Y11haic88E1jsBf" alt=""><figcaption></figcaption></figure>

从网页URL上获取Private Group的Chat ID, 如 -811463215

<figure><img src="/files/lrnfCw0r81wgtMNjqxor" alt=""><figcaption></figcaption></figure>

#### 在Chainbot平台, 填写Chat ID或Group Name

<figure><img src="/files/knMkoQaEt0xhrSER3iDT" alt=""><figcaption></figcaption></figure>

### 如何设置 Channel？ <a href="#set-channel" id="set-channel"></a>

1. 选择Chat Type为Channel (操作步骤与Group一致)。
2. 将Chainbot机器人拉入到Channel, **并设置为管理员** (操作步骤与Group一致)。
3. Channel分为Private(私有)和Public(公开)两类, **只能推送到Public类型的Channel,** 首先确认Channel的类型 (操作步骤与Group一致)
4. 如果是Public(公开) Channel, 需要填写带\*\*@符号的Channel Name,\*\* 如 @chainbot\_channel。(操作步骤与Group一致)

### 如何设置 Bot <a href="#set-bot" id="set-bot"></a>

1. 首先您需要创建一个自己的 Telegram Bot ，参考Telegram的[官方教程](https://core.telegram.org/bots/features#creating-a-new-bot)。

2. 使用 [BotFather](https://t.me/BotFather) 创建好属于自己的Bot后，您将看到这个 Bot 的 API Token。或者您可以在 /mybots 命令的菜单中再次选择刚刚创建的Bot查看此 API Token。

   <figure><img src="/files/rX5ahEpDgcGrelADdtqe" alt=""><figcaption></figcaption></figure>

3. 点击复制这一段 API Token，回到ChainBot，Chat Type 选择"Bot"，并将API Token粘贴在对应的输入框内。点击保存<br>

   <figure><img src="/files/S9FEWSJhWyxXAEKa2V70" alt=""><figcaption></figcaption></figure>

4. 保存成功后，您可以通过`/start` 和`/stop` 命令来控制您的Bot是否在所在聊天会话中推送消息。例如您可以将这个Bot拉入群组，并作为管理员身份在群组中发送 `/start` 命令，则该TG Bot将会在群里发送您的监控消息。

   <figure><img src="/files/KZSVsGaPMUU7c9VPGIRN" alt=""><figcaption></figcaption></figure>


# DingTalk

### 如何设置 DingTalk？

1. 登录 DingTalk 获取 Secret 以及 Webhook URL。
2. 在 ChainBot 平台配置相关信息。

<figure><img src="/files/dItoPMJ4WeTq76vs52Cu" alt=""><figcaption></figcaption></figure>

#### 如何获取 DingTalk 的 Secret 以及 Webhook URL？

[详细请参照 DingTalk 的官方文档。](https://open.dingtalk.com/document/robots/custom-robot-access)


# Pushover

### 如何设置 Pushover？

1. 登录 [Pushover](https://pushover.net/)，获取 Pushover 的 <mark style="color:purple;">**Key**</mark>**。**
2. 在 Pushover 中创建一个 Application，并获取该 Application 的 <mark style="color:purple;">**Token**</mark>。
3. 将 Key 和 Token 获取填写到 ChainBot 平台中。

<figure><img src="/files/vYolXujLJvzb8K3kmUYr" alt=""><figcaption></figcaption></figure>

#### 如何获取 Pushover 的 Key 和 Token

1. 登录 Pushover 后，在首页即可看到 Key。

   <figure><img src="/files/NUR4NkHxhYqcziNzCUe3" alt=""><figcaption><p>Get your Key and Token from Pushover</p></figcaption></figure>
2. 点击 “Create an Application/API Token” 创建一个 Application，或者选择一个已存在的 Application。
3. 查看 Application 即可看到 Token。

   <figure><img src="/files/pIBI0DXFtzqzK0PNVosr" alt=""><figcaption><p>Get the Token from your application detail page</p></figcaption></figure>


# Pagerduty

### 如何设置 Pagerduty？

1. 登录 [Pagerduty](https://www.pagerduty.com/) 平台，获取 Pagerduty 的 **token**。
2. 在 ChainBot 平台填写 token，以及名称。

<figure><img src="/files/CPyhF0Ydq8kdcY9xXVv2" alt=""><figcaption></figcaption></figure>


# Webhook

### 如何设置 Webhook？

填写 Webhook URL 即可。

<figure><img src="/files/2WkisxVKyx5HvBvs7QOf" alt=""><figcaption></figcaption></figure>


# Lark

### 如何设置 Lark？

填写 Webhook URL 即可。

<figure><img src="/files/dx0gVJXH2qYJuDKZOhRR" alt=""><figcaption></figcaption></figure>


# Cobo Argus

### 如何设置 Cobo Argus？

<figure><img src="/files/QDnMz62yyibBEObA4vBL" alt=""><figcaption></figcaption></figure>


# 订阅/Subscription

在Chainbot中，你可以对bot进行订阅，选择您创建的通知渠道，设置订阅频率。

<figure><img src="/files/LlbAosB2wUo6H3AjZq1X" alt=""><figcaption></figcaption></figure>

#### 告警订阅字段说明

| 字段                 | 说明                  | 示例           |
| ------------------ | ------------------- | ------------ |
| Name               | 订阅名称，接收通知的标题        | Aptos Mirror |
| Subscription Group | 订阅组                 |              |
| Conditions         | 订阅条件的被比较数值可根据自身需求调整 | 如上图所示        |
| Frequency          | 接收告警的频率             | Always       |
| Actions            | 接收告警的平台             | Discord      |

#### 告警订阅频率说明

> 您可以根据监控的重要性，选择接收消息的频率。

<table><thead><tr><th width="149">频率</th><th>说明</th></tr></thead><tbody><tr><td>Always</td><td>每产生一条消息都会接受到一条消息</td></tr><tr><td>OnlyOnce</td><td>仅接收一次消息，之后触发告警，将不会再收到消息</td></tr><tr><td>5m</td><td>每隔 5m 接收一次消息，如果 5m 内产生多条消息，仅接收一条消息</td></tr><tr><td>10m</td><td>每隔 10m 接收一次消息，如果 10m 内产生多条消息，仅接收一条消息</td></tr><tr><td>30m</td><td>每隔 30m 接收一次消息，如果 30m 内产生多条消息，仅接收一条消息</td></tr><tr><td>1h</td><td>每隔 1h 接收一次消息，如果 1h 内产生多条消息，仅接收一条消息</td></tr><tr><td>4h</td><td>每隔 4h 接收一次消息，如果 4h 内产生多条消息，仅接收一条消息</td></tr><tr><td>12h</td><td>每隔 12h 接收一次消息，如果 12h 内产生多条消息，仅接收一条消息</td></tr><tr><td>24h</td><td>每隔 24h 接收一次消息，如果 24h 内产生多条消息，仅接收一条消息</td></tr></tbody></table>


# Fork Bot

当用户发现在 Discover 或者通过搜索查到到的相关 Bot 不完全满足需求时，用户可以选择快速 Fork 当前 Bot，此时 ChainBot 平台会复制一份当前 Bot 的配置数据并自动切换到编辑页面，用户在此基础上，可以修改相关参数，从而达到快速配置 Bot 的目的。

<figure><img src="/files/je7ssiEe0fWCJP7OT3tA" alt=""><figcaption><p>Fork a Bot</p></figcaption></figure>

<figure><img src="/files/kfbG2YHU8izo02HAwHxw" alt=""><figcaption><p>Fork a Bot</p></figcaption></figure>


# 管理 Bot

### 编辑 Bot

登录 ChainBot 平台后，个人页面选择 "Bots" 选择要操作的目标 Bot，点击 Bot 右上角的按钮，并点击 “Edit” 即可重新编辑当前 Bot。

<figure><img src="/files/Pam1ZYdVuR1wZaVRNZAC" alt=""><figcaption><p>Edit a Bot</p></figcaption></figure>

### 分享 Bot

登录 ChainBot 平台后，个人页面选择 "Bots" 选择要操作的目标 Bot 的选项卡进入到 Bot 详情页。点击右上角的 "Share" 按钮，即可分享该 Bot。

<figure><img src="/files/8Vp6j3KLY94AmZgVLTha" alt=""><figcaption><p>Share a Bot</p></figcaption></figure>

### 删除 Bot

登录 ChainBot 平台后，个人页面选择 "Bots" 选择要操作的目标 Bot，点击 Bot 右上角的按钮，并点击 “Delete” 即可重新编辑当前 Bot。

<figure><img src="/files/AH1y47bTHipx8OlRUxhu" alt=""><figcaption><p>Delete a Bot</p></figcaption></figure>

### Publish Bot

默认情况下，在 ChainBot 平台创建的 Bot 为私有 Bot，即其他人无法看到你创建的 Bot，如果需要分享当前 Bot，则需要将该 Bot Publish 出去，Publish 成功之后，其他人则也可以通过搜索，或者 Discover 搜索并订阅你创建的 Bot；并且你可以在 “Bots” -> "Published" 中查看你已经 Published 的 Bot。

如果你创建的 Bot publish 之后，订阅数 >= 5 时，你无法再删除该 Bot。订阅数 < 5 时，则可以删除该 Bot。

<figure><img src="/files/m19adLCUP7YYLqmyay8X" alt=""><figcaption><p>Publish a Bot</p></figcaption></figure>


# 告警通知模板

### 什么是告警通知模板？

ChainBot 平台中，告警通知模板本质为一串字符串，没有长度限制。每当用户创建 Bot 时，都会生成一个默认的告警通知模板，用户需要根据自身需求，变更告警通知模板中的关键词，同时可以根据每种 Bot 监控类型变更注入变量。

以下为告警通知模板示例：

```
[ {$bot.name} ]
  Contract: {$event.contract}
  Time: {$block.time}
  Explore: {$chain.explore}/tx/{$tx.hash}
  Created By ChainBot.io
```

其中例如 “Contract” 为方便用户阅读的关键词，“{$event.contract}” 为模板变量。其中模板变量必须使用 "{}" 包括起来。

[了解不同 Bot 监控支持的注入变量？](/zh/advanced-features/alarm-notification-template/message-template)

### 告警通知模板高级功能

> 使用该部分功能，用户需要有初级的编程技能。

#### 1. 格式化时间

```javascript
// 格式化时区至用户设定的时区
timezone($block.time, 8)
```

#### 2. 四则运算

```javascript
"123000000000000000000" / 1e18 == 123
"1" + "1" + 1 == 3
2 - 1 == 1
2 * 2 == 4
```

#### 3. 取整运算

```
{ round(1000000000001000000 / 1e18, 1)}
```

#### 复杂告警模板示例

```
[{$subscription.name}]
Block: {$block.number}
Values: {$values._reserve0 / 1e18} / {$values._reserve1 / 1e18} = {$values.percent}
Condition: {$condition}
Time: {$block.time}

```


# 消息模版变量汇总表

### 所有 Monitor 通用变量：

* $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

## 变量详细说明

### $bot

| param     | type   | comment   |
| --------- | ------ | --------- |
| $bot.name | string | 此 Bot 的名称 |
| $bot.url  | string | 此 Bot 的链接 |

### $alert

| param            | type   | comment              |
| ---------------- | ------ | -------------------- |
| $alert.time      | string | alert 触发的时间，按照用户所在时区 |
| $alert.timestamp | uint64 | 时间戳                  |

### $chain

| param           | type   | comment                   |
| --------------- | ------ | ------------------------- |
| $chain.type     | string | ethereum                  |
| $chain.chainId  | uint64 | chain\_id                 |
| $chain.symbol   | string | 链 native token 的 symbol   |
| $chain.decimals | int    | 链 native token 的 decimals |
| $chain.explore  | string | 区块浏览器链接                   |

### $block

| param                 | type    | comment                    |
| --------------------- | ------- | -------------------------- |
| $block.hash           | string  | 区块 hash                    |
| $block.height         | uint64  | 区块高度                       |
| $block.minter         | string  | 区块挖掘者 address              |
| $block.baseFeePerGas  | float64 | 该 block 的 basefee, 单位 gwei |
| $block.gasUsedPercent | float64 | 该 block 的 gas 使用的百分比       |

### $tx

| param     | type   | comment         |
| --------- | ------ | --------------- |
| $tx.hash  | string | 交易 hash         |
| $tx.nonce | string | 交易 nonce        |
| $tx.from  | string | from address    |
| $tx.to    | string | to address      |
| $tx.value | string | tx value        |
| $tx.gas   | string | tx 花费的 gas 数量   |
| $tx.input | string | tx 的 input data |
| …         |        |                 |

### $event

| param           | type   | comment    |
| --------------- | ------ | ---------- |
| $event.contract | string | 触发事件的合约地址  |
| $event.params   | object | 解析后的事件参数对象 |

### $params

$params 是 $event.params 的别名，用于直接访问事件参数。具体的参数名称取决于监控的智能合约事件的 ABI 定义。

**常见 Event 参数示例：**

对于 ERC20 Token 的 Transfer 事件：

* $params.from - 转账发送者地址
* $params.to - 转账接收者地址
* $params.value - 转账金额

对于 Uniswap 的 Swap 事件：

* $params.sender - 交换发起者
* $params.recipient - 交换接收者
* $params.amount0In - 输入代币 0 的数量
* $params.amount1In - 输入代币 1 的数量
* $params.amount0Out - 输出代币 0 的数量
* $params.amount1Out - 输出代币 1 的数量

**使用示例：**

```
🎯 事件监控触发！
合约地址: $event.contract
交易哈希: $tx.hash
发送者: $tx.from

--- ERC20 Transfer 事件 ---
从: $params.from
到: $params.to
金额: $params.value

--- Uniswap Swap 事件 ---
交换者: $params.sender
接收者: $params.recipient
输入金额0: $params.amount0In
输入金额1: $params.amount1In
输出金额0: $params.amount0Out
输出金额1: $params.amount1Out

区块链浏览器: $chain.explore/tx/$tx.hash
Bot详情: $bot.url
```

### $nft

| param     | type   | comment         |
| --------- | ------ | --------------- |
| $tx.hash  | string | 交易 hash         |
| $tx.nonce | string | 交易 nonce        |
| $tx.from  | string | from address    |
| $tx.to    | string | to address      |
| $tx.value | string | tx value        |
| $tx.gas   | string | tx 花费的 gas 数量   |
| $tx.input | string | tx 的 input data |
| …         |        |                 |

### $dex

| param                    | type    | comment            |
| ------------------------ | ------- | ------------------ |
| $dex.name                | string  | dex name           |
| $dex.address             | string  | dex swap 合约地址      |
| $dex.tokenBase.symbol    | string  | tokenBase symbol   |
| $dex.tokenBase.address   | string  | tokenBase address  |
| $dex.tokenBase.decimals  | int     | tokenBase 精度       |
| $dex.tokenBase.amount    | decimal | tokenBase 数量       |
| $dex.tokenBase.balance   | decimal | tokenBase 流动性      |
| $dex.tokenQuote.symbol   | string  | tokenQuote symbol  |
| $dex.tokenQuote.address  | string  | tokenQuote address |
| $dex.tokenQuote.decimals | int     | tokenQuote 精度      |
| $dex.tokenQuote.amount   | decimal | tokenQuote 数量      |
| $dex.tokenQuote.balance  | decimal | tokenQuote 流动性     |
| $dex.value               | decimal | token 数量           |
| $dex.USDValue            | decimal | token usd 价值       |
| $dex.price               | decimal | 价格                 |
| $dex.priceUSD            | decimal | usd 本位价格           |
| $dex.action              | string  | 动作                 |
| $dex.tokenIn.symbol      | string  | tokenIn symbol     |
| $dex.tokenIn.address     | string  | tokenIn address    |
| $dex.tokenIn.decimals    | int     | tokenIn 精度         |
| $dex.tokenIn.amount      | decimal | tokenIn 数量         |
| $dex.tokenOut.symbol     | string  | tokenOut symbol    |
| $dex.tokenOut.address    | string  | tokenOut address   |
| $dex.tokenOut.decimals   | int     | tokenOut 精度        |
| $dex.tokenOut.amount     | decimal | tokenOut 数量        |
| $dex.direction           | 📈 📉   | 上涨 /下跌             |
| $dex.changed.duration    | string  | 变动时间区间             |
| $dex.changed.rate        | decimal | 变动速率               |
| $dex.changed.direction   | 📈 📉   | 上涨 /下跌             |

### $snapshot

| param                     | type   | comment       |
| ------------------------- | ------ | ------------- |
| $snapshot.event           | string | 回调事件          |
| $snapshot.time            | string | 时间            |
| $snapshot.proposal.id     | string | id            |
| $snapshot.proposal.title  | string | 标题            |
| $snapshot.proposal.author | string | 作者            |
| $snapshot.proposal.state  | string | 状态            |
| $snapshot.proposal.event  | string | 事件            |
| $snapshot.proposal.space  | string | space         |
| $snapshot.proposal.link   | string | 链接            |
| $snapshot.proposal.body   | string | 内容            |
| $snapshot.proposal.start  | string | 开始时间          |
| $snapshot.proposal.end    | string | 结束时间          |
| $snapshot.space.id        | string | space id      |
| $snapshot.space.name      | string | space 名字      |
| $snapshot.space.about     | string | space 介绍      |
| $snapshot.space.network   | string | space network |
| $snapshot.space.symbol    | string | space 符号      |

### $value

| param             | type   | comment                                                                 |
| ----------------- | ------ | ----------------------------------------------------------------------- |
| $value.values     | map    | formater 后的数值，为动态解析，比如 $value.values.balance, $value.values\["outpu0"]  |
| $value.condition  | string | 所有 condition 内容转为字符串                                                    |
| $value.conditions | map    | bot 配置的 condition 转为 map,key 为 condition 第一个字段， value 为 condition 转为字符串 |

### $intent

| param                                 | type   | comment |
| ------------------------------------- | ------ | ------- |
| $intent.swap\_intents                 | array  | 交换意图数组  |
| $intent.swap\_intents\[].sender       | string | 发送者地址   |
| $intent.swap\_intents\[].swap\_type   | string | 交换类型    |
| $intent.swap\_intents\[].buy\_token   | string | 购买代币地址  |
| $intent.swap\_intents\[].buy\_amount  | string | 购买代币数量  |
| $intent.swap\_intents\[].sell\_token  | string | 出售代币地址  |
| $intent.swap\_intents\[].sell\_amount | string | 出售代币数量  |

**使用示例：**

```
发送者: {$intent.swap_intents[0].sender}
购买代币: {$intent.swap_intents[0].buy_token}
购买数量: {$intent.swap_intents[0].buy_amount}
出售代币: {$intent.swap_intents[0].sell_token}
出售数量: {$intent.swap_intents[0].sell_amount}
交换类型: {$intent.swap_intents[0].swap_type}
```


# Condition(s) 说明


# Webhooks

使用 Webhook 的方式接收 Bot 监控告警的信息

你可以在 [如何设置 Webhook](/zh/basic-usage/notify-channels/webhook#ru-he-she-zhi-webhook) 里面配置选择使用 Webhook 接收数据，当该 Bot 监控告警被触发时，系统将会以`POST`的方式回调指定的 Webhook 中。

### Event 告警回调数据示例

```json
{
  "bot": {
    "id": "310921842431212166",
    "name": "ChainbotFactoryCN_Demo_event_formatTime"
  },
  "data": {
    "block": {
      "hash": "0x812c4e049074fc939f84a336b051d252ded717a00624659be5e9eaa0ea5c0e33",
      "height": 16145470,
      "time": "2022-12-09T06:49:47Z"
    },
    "chain": {
      "chain_id": "1",
      "explore": "https://etherscan.io",
      "type": "Ethereum"
    },
    "conditions": [],
    "event": {
      "contract": "0xdac17f958d2ee523a2206206994597c13d831ec7",
      "params": {
        "owner": "0x9173be58bf265c40385c6b3c4f8e80873c1255fd",
        "spender": "0x1111111254eeb25477b68fb85ed929f73a960582",
        "value": 1.157920892373162e+77
      },
      "rawEvent": {
        "address": "0xdac17f958d2ee523a2206206994597c13d831ec7",
        "blockHash": "0x812c4e049074fc939f84a336b051d252ded717a00624659be5e9eaa0ea5c0e33",
        "blockNumber": "0xf65c3e",
        "data": "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
        "logIndex": "0x1b",
        "removed": false,
        "topics": [
          "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925",
          "0x0000000000000000000000009173be58bf265c40385c6b3c4f8e80873c1255fd",
          "0x0000000000000000000000001111111254eeb25477b68fb85ed929f73a960582"
        ],
        "transactionHash": "0xc0c8954508021711575e2e2261bf934f3228eb3cf51d5e836eafeaf66f7c9c86",
        "transactionIndex": "0xe"
      }
    },
    "transaction": {
      "hash": "0xc0c8954508021711575e2e2261bf934f3228eb3cf51d5e836eafeaf66f7c9c86"
    }
  },
  "subscription": {
    "id": "310921842766756486",
    "name": "ChainbotFactoryCN_Demo_event_formatTime1"
  },
  "time": "2022-12-09T06:49:49.993075864Z",
  "version": "1.0"
}
```

### DEX 告警回调数据示例

```json
{
  "bot": {
    "id": "311119159553604230",
    "name": "ChainbotFactoryCN_demo_dex"
  },
  "data": {
    "action": "sell",
    "block": {
      "hash": "0xdb082dbf8a51f4c7f2ff304329a133be42aeda04bad278b5a226c9c027ff9277",
      "height": 16145450,
      "time": "2022-12-09T06:45:47Z"
    },
    "chain": {
      "chain_id": "1",
      "explore": "https://etherscan.io",
      "type": "Ethereum"
    },
    "condition": {
      "param": "Swap",
      "symbol": "WhaleBuySell",
      "unit": "USD",
      "value": "1"
    },
    "dex": {
      "address": "0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45",
      "name": "UniswapV3"
    },
    "price": "0.0007780715056737",
    "priceUSD": "0.99746853486837753388444328412",
    "tokenBase": {
      "address": "0xdAC17F958D2ee523a2206206994597C13D831ec7",
      "amount": "100",
      "decimals": 6,
      "symbol": "USDT"
    },
    "tokenIn": {
      "address": "0xdAC17F958D2ee523a2206206994597C13D831ec7",
      "amount": "100",
      "decimals": 6,
      "symbol": "USDT"
    },
    "tokenOut": {
      "address": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
      "amount": "-0.077807150567369",
      "decimals": 18,
      "symbol": "WETH"
    },
    "tokenQuote": {
      "address": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
      "amount": "-0.077807150567369",
      "decimals": 18,
      "symbol": "WETH"
    },
    "transaction": {
      "hash": "0x26ebda9060af58a0eb8097faa3afeab0694db52169d0bd0d6570a18bc60ff7cb"
    },
    "value": "0"
  },
  "subscription": {
    "id": "311120377680149126",
    "name": "ChainbotFactoryCN_demo_dex"
  },
  "time": "2022-12-09T06:45:50.911504167Z",
  "version": "1.0"
}
```

### Value 告警回调数据示例

```json
{
  "bot": {
    "id": "306859121112954304",
    "name": "ChainbotFactoryCN_demo_reserve_percent1"
  },
  "data": {
    "chain": {
      "chain_id": "1",
      "explore": "",
      "type": "Ethereum"
    },
    "conditions": {
      "_reserve0": {
        "field": "_reserve0",
        "method": "last",
        "result": 5394298.279736,
        "symbol": ">",
        "threshold": 546000,
        "timeRange": "5m",
        "value": 5394298.279736
      },
      "_reserve1": {
        "field": "_reserve1",
        "method": "last",
        "result": 5399252.162221,
        "symbol": ">",
        "threshold": 546000,
        "timeRange": "5m",
        "value": 5399252.162221
      },
      "percent": {
        "field": "percent",
        "method": "last",
        "result": 0.999082,
        "symbol": ">",
        "threshold": 0.9,
        "timeRange": "5m",
        "value": 0.9990824872896912
      }
    },
    "fields": [
      {
        "index": "0",
        "key": "_reserve0",
        "modifier": "function format(values){\n    return values['_reserve0']/1e6;\n}"
      },
      {
        "index": "1",
        "key": "_reserve1",
        "modifier": "function format(values){\n    return values['_reserve1']/1e6;\n}"
      },
      {
        "index": "percent",
        "key": "percent",
        "modifier": "function format(values){\n    return values['_reserve0']/values['_reserve1'];\n}"
      }
    ],
    "time_range": "60s",
    "values": {
      "_reserve0": 5394298.279736,
      "_reserve1": 5399252.162221,
      "percent": 0.9990824872896912
    }
  },
  "subscription": {
    "id": "306863510603150784",
    "name": "ChainbotFactoryCN_demo_reserve_percent1"
  },
  "time": "2022-12-09T07:23:12.18185473Z",
  "version": "1.0"
}
```

### Transaction 告警回调数据示例

```json
{
  "bot": {
    "id": "311120108020152966",
    "name": "ChainbotFactoryCN_test_tx_timeFormat"
  },
  "data": {
    "block": {
      "hash": "0x8bd5331676d308b7abfed895da1a68177661b4c9aee970702fb6c18eb3988e6e",
      "height": 16145663,
      "time": "2022-12-09T07:28:23Z"
    },
    "chain": {
      "chain_id": "1",
      "type": "Ethereum"
    },
    "conditions": [],
    "transaction": {
      "arguments": null,
      "chainId": "1",
      "from": "0xc7c669ad7cfaaaf77da193daf0967b38dea34437",
      "gas": "0x10e07",
      "gasPrice": "",
      "hash": "0x79ca5a9a1dd9000f41c73887a9391fc21652974102926c4cb002a2e5e7692168",
      "height": 16145663,
      "input": "0x23b872dd0000000000000000000000003ee764a5a659ba9ad28e3cf3fa467e75dad5a090000000000000000000000000bf69d9d87cc310544db068e5198c25e738a806ac0000000000000000000000000000000000000000000000000000000000000000",
      "maxFeePerGas": "0xda979d87c",
      "maxPriorityFeePerGas": "0x59682f00",
      "method": "transferFrom(address,address,uint256)",
      "nonce": "0xf65",
      "r": "0x4c520e66df875e38cf9d058ac679ce5c862a948d1c7e56156e736d8f98f9a7d8",
      "s": "0x498ae192afd44defdd06fb4d44cf2f158a60fb7d565a624af5f604d1cd236f1a",
      "success": false,
      "to": "0xdac17f958d2ee523a2206206994597c13d831ec7",
      "type": "0x2",
      "type_arguments": null,
      "v": "0x0",
      "value": "0"
    }
  },
  "subscription": {
    "id": "311120108288522886",
    "name": "ChainbotFactoryCN_demo_tx_timeFormat"
  },
  "time": "2022-12-09T07:28:27.122532348Z",
  "version": "1.0"
}
```

### Block 告警回调数据示例

```json
{
  "bot": {
    "id": "296436117295614241",
    "name": "ChainbotFactoryCN_demo_block_gasused<60%"
  },
  "data": {
    "block": {
      "baseFeePerGas": 27.617106321,
      "gasUsedPercent": 9.64783,
      "hash": "0xd99db0bb07609f60fcfff475247826633ee8245fde944e115dca5d27ffc891e7",
      "height": 16145678,
      "minter": "0x5c647ca5e2bc5bd17c40410fcb8003d38879ae50",
      "time": "2022-12-09T07:31:23Z"
    },
    "chain": {
      "chain_id": "1",
      "type": "Ethereum"
    },
    "conditions": [
      {
        "param": "gasUsedPercent",
        "symbol": "<",
        "unit": "Percent",
        "value": "60"
      }
    ]
  },
  "subscription": {
    "id": "310931430308166278",
    "name": "ChainbotFactoryCN_demo_block_gasused<60%"
  },
  "time": "2022-12-09T07:31:33.011598237Z",
  "version": "1.0"
}
```

### NFT 告警回调数据示例

```json
{
  "bot": {
    "id": "311159164322167430",
    "name": "ChainbotFactoryCN Demo"
  },
  "data": {
    "chain": {
      "chain_id": "1",
      "explore": "https://etherscan.io/",
      "type": "Ethereum"
    },
    "collection": {
      "slug": "cockpunch"
    },
    "conditions": [],
    "event": {
      "time": "2022-12-09T08:16:59+00:00",
      "timestamp": 1670573819000,
      "type": "Sold"
    },
    "item": {
      "market_link": "https://opensea.io/collection/cockpunch",
      "opensea_link": "https://opensea.io/collection/cockpunch",
      "token_id": "3462"
    },
    "maker": {
      "address": "0x0fe0e246423e61dae865bf1bf9a8e28344788c87"
    },
    "market": {
      "name": "opensea"
    },
    "payment": {
      "price": "0.92",
      "symbol": "ETH",
      "usd_price": "1280.8900000000001"
    },
    "quantity": "1",
    "taker": {
      "address": "0x54edade621180c64dd55b5b49f1541deb33a0c30"
    },
    "transaction": {
      "hash": "0xd70d5603b24ccb9d04b5304ff5e3a0abc00579180a9085eb0b53a791e9a2d221",
      "time": "2022-12-09T08:16:59+00:00",
      "timestamp": 1670573819000
    }
  },
  "subscription": {
    "id": "311159238225607302",
    "name": "ChainbotFactoryCN demo"
  },
  "time": "2022-12-09T08:16:59+00:00",
  "version": "1.0"
}
```

### Snapshot 告警回调数据示例

```json
{
  "bot": {
    "id": "310930122406673030",
    "name": "ChainbotFactoryCN_demo_snapshot_timeFormat"
  },
  "data": {
    "conditions": [
      {
        "field": "event",
        "symbol": "in",
        "value": "proposal/created,proposal/start,proposal/end,proposal/deleted"
      },
      {
        "field": "space",
        "symbol": "=",
        "value": "stgdao.eth"
      }
    ],
    "proposal": {
      "author": "0xE2D48F03082deeF8eb557B00a54aC9fc38Aa4709",
      "event": "proposal/start",
      "expire": 1663107416,
      "id": "0xe6fef4aa9c8e9d162f694ab764b11c06918b9f199aafe43e0d85b12d8271011c",
      "link": "https://snapshot.org/#/stgdao.eth/proposal/0xe6fef4aa9c8e9d162f694ab764b11c06918b9f199aafe43e0d85b12d8271011c",
      "network": "1",
      "space": "stgdao.eth",
      "state": "closed",
      "title": "SIP #16 - New Assets - DAI, FRAX, sUSD, LUSD"
    }
  },
  "subscription": {
    "id": "311139153012505222",
    "name": "ChainbotFactoryCN_demo_snapshot_timeFormat"
  },
  "time": "2022-12-09T07:13:14.208602165Z",
  "version": "1.0"
}
```

### Arweave 告警回调数据示例

```json
{
  "bot": {
    "id": "311124588459309702",
    "name": "ChainbotFactoryCN_demo_Arweave"
  },
  "data": {
    "block": {
      "hash": "4uamc6mU6VnKjkYptP_2oSGPoiX4QPl-BxJABAmNG2FI_65V_xuG3LVEBkzyKtX0",
      "height": 1073786,
      "time": "2022-12-09T06:57:37Z"
    },
    "conditions": [
      {
        "Field": "app-name",
        "Symbol": "==",
        "Type": "tags",
        "Value": "mirrorxyz"
      }
    ],
    "raw": {
      "authorship": {
        "algorithm": {
          "hash": "SHA-256",
          "name": "ECDSA"
        },
        "contributor": "0x4FF7fBEc585a2f3aEfc114Cf2e1daA04F377279e",
        "signature": "0x579405f6e09fafa64fe54390477ad2bfb0794d85f928507ef925aa13e7e5eca836a738a1b0bb263e9c3f4e37447758fe6c97e938592f37109f1ec0d50724ade31b",
        "signingKey": "{\"crv\":\"P-256\",\"ext\":true,\"key_ops\":[\"verify\"],\"kty\":\"EC\",\"x\":\"TyanSrigZWN0t1CfU0vJG7j46EbEEsfwv1zeM_s_BdA\",\"y\":\"_-gw58cXZTFcGgr_Kh5fp-bKl2TJW8q3IcIyVlQ8ly4\"}",
        "signingKeyMessage": "I authorize publishing on mirror.xyz from this device using:\n{\"crv\":\"P-256\",\"ext\":true,\"key_ops\":[\"verify\"],\"kty\":\"EC\",\"x\":\"TyanSrigZWN0t1CfU0vJG7j46EbEEsfwv1zeM_s_BdA\",\"y\":\"_-gw58cXZTFcGgr_Kh5fp-bKl2TJW8q3IcIyVlQ8ly4\"}",
        "signingKeySignature": "bBBjSXDS7XmGxLEHeiLtS3HuUpJPwz2rkFXntKZPJtW_40iUo-4Ce6H3eddh5-Ri0eR0kpf6n-iZJyKodWjo-g"
      },
      "content": {
        "body": "Nature",
        "timestamp": "1670568886",
        "title": "Natural Plants"
      },
      "digest": "_g_wWPCtW9zr0iCqw_RwdOXF4fwed668LUIridt3Jgw",
      "version": "04-25-2022",
      "wnft": {
        "chainId": 10,
        "description": "Nature\n",
        "fee": 250,
        "fundingRecipient": "0x4FF7fBEc585a2f3aEfc114Cf2e1daA04F377279e",
        "imageURI": "QmTRPi7K4NPiG4wRzto73rr5oX7ywGWYiraofc9hXF9pTM",
        "mediaAssetId": 308504,
        "name": "Natural Plants",
        "nonce": 7567765,
        "owner": "0x4FF7fBEc585a2f3aEfc114Cf2e1daA04F377279e",
        "price": 0,
        "proxyAddress": "0xA895b770e24f67fC07D9a20159322F431BE4EbCd",
        "renderer": "0x0000000000000000000000000000000000000000",
        "supply": 500,
        "symbol": "NATURALPLANTS"
      }
    },
    "tags": [
      {
        "name": "Content-Type",
        "value": "application/json"
      },
      {
        "name": "App-Name",
        "value": "MirrorXYZ"
      },
      {
        "name": "Contributor",
        "value": "0x4FF7fBEc585a2f3aEfc114Cf2e1daA04F377279e"
      },
      {
        "name": "Content-Digest",
        "value": "_g_wWPCtW9zr0iCqw_RwdOXF4fwed668LUIridt3Jgw"
      },
      {
        "name": "Original-Content-Digest",
        "value": "5K_-qHI1g5UR_Am2Ywa3a8fXzTRWOAJE0s0g_7Xy_D4"
      }
    ],
    "transaction": {
      "id": "8fVNscLRfvdkeM4EbVox8fK89oKdVo0ZlMWwfZmwSIg",
      "owner": {
        "address": "Ky1c1Kkt-jZ9sY1hvLF5nCf6WWdBhIU5Un_BMYh-t3c"
      }
    }
  },
  "subscription": {
    "id": "311124647330953862",
    "name": "ChainbotFactoryCN_demo_Arweave"
  },
  "time": "2022-12-09T07:00:50.708175204Z",
  "version": "1.0"
}
```


# 支持的数据源

### 公链

#### EVM 兼容

* Ethereum
* Binance smart chain
* Avalanche
* Polygon
* Fantom

**Arweave**

* Mainnet

### 三方数据

* [Snapshot](https://snapshot.org/)
* [OpenSea](https://opensea.io/)


# API


# Api Key申请

### 申请 Api Key

在<https://chainbot.io/中正常注册一个账号并购买成为Pro用户，提供账号关联的邮箱给团队申请，> 每个账号会分配一个 `client_id` 和 `secret_key`

### 认证方式

认证方式为 `Base Auth`, 即 `Basic: base64(client_id:secret_key)` 作为 `Authorization`

#### 示例

比如分配到的 `client_id` 为 `test_client_id` , `secret_key` 为 `test_secret_key`

则 `base64(test_client_id:test_secret_key) = dGVzdF9jbGllbnRfaWQ6dGVzdF9zZWNyZXRfa2V5`

发送请求的代码为

```
curl "https://api.chainbot.io" \
     -H 'Authorization: Basic dGVzdF9jbGllbnRfaWQ6dGVzdF9zZWNyZXRfa2V5'
```


# Api Doc

### Api Base Host

`https://api.chainbot.io/api/v1`

### Channel

#### 查询channel

**GET** `/notify/channels`

**Parameters**

* `current_page` int， 当前查询页，从 1 开始计数
* `per_page` : int, 每页返回数量

**Response**

```
{
    "code": 0,
    "msg": "success",
    "data": {
        "data": [
            {
                "id": 1367,
                "user_id": 2137,
                "name": "Pushover",
                "platform": "Pushover",
                "token": "token",
                "channel": "channel",
                "channel_type": "",
                "is_default": 0,
                "priority": 1,
                "others": null
            },
            {
                "id": 1075,
                "user_id": 2137,
                "name": "Webhook",
                "platform": "Webhook",
                "token": "",
                "channel": "http://webhook.io/url",
                "channel_type": "",
                "is_default": 1,
                "priority": 0,
                "others": null
            }
        ],
        "current_page": 1,
        "per_page": "999",
        "total": 2
    }
}
```

#### 添加 channel

**POST** `/notify/channels`

**Parameters**

```
{
    "name": "web",
    "platform": "Webhook",
    "token": "",
    "channel_type": "",
    "channel": "http://webhook.com/url",
    "priority": 0,
    "others": {
        "retryExpire": "0",
        "retryInterval": "0"
    }
}
```

**Response**

```
{
  "code": 0,
  "msg": "success",
  "data": {
    "id": 2879,   // channel id, 在订阅 bot 时需要用到
    "user_id": 2137,
    "name": "Webhook",
    "platform": "Webhook",
    "token": "",
    "channel": "http://sda.dfa",
    "channel_type": "",
    "is_default": 0,
    "priority": 0,
    "others": {}
  }
}
```

#### 删除 channel

**DELETE** `/notify/channels/{channel_id}`

**Parameters**

* `channel_id`

**Response**

```
{
    "code": 0,
    "msg": "success",
    "data": {}
}
```

### Bot

#### 创建 bot

**POST** `/bots`

**Parameters**

Address Bot Example

```
{
    "info": {
        "type": "Wallet",  // address bot 固定为 Wallet
        "name": "address bot",
        "tags": [
            "tag1"  // 标签，统计展示用
        ],
        "status": "Public",   // 可选 Public/Private, 只有 vip 用户允许创建 Private bot 
        "notify_template": "[{$subscription.name}]\nFrom: {$tx.from}\nTo: {$tx.to}\nMethod: {$tx.method}\nStatus: {$tx.status}\nExplore: {$chain.explore}/tx/{$tx.hash}\nTime: {$block.time}",
        "description": "desc"
    },
    "driver": {
        "chains": [
            {
                "chain_id": "1",
                "type": "Ethereum"
            }
        ],
        "addresses": [
            "0x114910771af9ca656af840dff83e8264ecf986ca"
        ],
        "strategies": [
            {
                "func": "eth_transfer",  // 监控 eth 转账
                "params": {
                    "direction": "out",  //可选值 both/out/in
                    "minimum_amount": "100000000000000000000",  //eth金额，单位 wei
                    "minimum_usd": 1   //eth 换算成 usd 金额
                }
            },
            {
                "func": "token_transfer",  // 监控 erc 20 转账
                "params": {
                    "direction": "both",  //可选值 both/out/in
                    "minimum_usd": 6
                }
            },
            {
                "func": "nft_transfer",   // 监控 nft 转账
                "params": {
                    "direction": "both"
                }
            },
            {
                "func": "contract_deploy",  // 监控合约部署
                "params": {}
            },
            {
                "func": "contract_call", // 监控合约调用
                "params": {}
            }
        ]
    }
}
```

**Response**

```
{
  "code": 0,
  "msg": "success",
  "data": {
    "id": "461170869663212058",  // bot id, 创建完成后用来订阅
    "info": {
      "type": "Wallet",
      "name": "address bot",
      "tags": [
        "tag1"
      ],
      "description": "desc",
      "notify_template": "[{$subscription.name}]\nFrom: {$tx.from}\nTo: {$tx.to}\nMethod: {$tx.method}\nStatus: {$tx.status}\nExplore: {$chain.explore}/tx/{$tx.hash}\nTime: {$block.time}",
      "status": "Public"
    },
    "driver": {
      "addresses": [
        "0x114910771af9ca656af840dff83e8264ecf986ca"
      ],
      "chains": [
        {
          "chain_id": "1",
          "type": "Ethereum"
        }
      ],
      "strategies": [
        {
          "func": "eth_transfer",
          "params": {
            "direction": "both",
            "minimum_amount": "0",
            "minimum_usd": 0
          }
        },
        {
          "func": "token_transfer",
          "params": {
            "direction": "both",
            "minimum_usd": 0
          }
        }
      ]
    },
    "subscribe_num": 0,
    "fork_num": 0,
    "view_times": 0,
    "triggered_times": 0,
    "last_trigger_time": 0,
    "readme": "",
    "created_at": "2024-05-09T17:40:29.336Z",
    "user": {},
    "notifies": null,
    "forked_bot": null,
    "original_bot": null,
    "sub_users": null
  }
}
```

#### 删除 bot

**DELETE** `/bots/{bot_id}`

**Parameters**

* `bot_id`

**Response**

```
{
    "code": 0,
    "msg": "success",
    "data": {}
}
```

#### 更新 bot

**PUT** `/bots/{bot_id}`

**Parameters**

Address Bot Example

```
{
    "info": {
        "type": "Wallet",
        "name": "test address",
        "tags": [],
        "status": "Private",
        "notify_template": "[{$subscription.name}]\nFrom: {$tx.from}\nTo: {$tx.to}\nMethod: {$tx.method}\nStatus: {$tx.status}\nExplore: {$chain.explore}/tx/{$tx.hash}\nTime: {$block.time}\nCreated By chainbot.io",
        "description": ""
    },
    "driver": {
        "chains": [
            {
                "chain_id": "1",
                "type": "Ethereum"
            }
        ],
        "addresses": [
            "0x114910771af9ca656af840dff83e8264ecf986ca"
        ],
        "strategies": [
            {
                "func": "eth_transfer",
                "params": {
                    "direction": "both",
                    "minimum_amount": "0",
                    "minimum_usd": 1
                }
            },
            {
                "func": "token_transfer",
                "params": {
                    "direction": "both",
                    "minimum_usd": 1
                }
            },
            {
                "func": "contract_deploy",
                "params": {}
            }
        ]
    }
}
```

**Response**

```
{
    "code": 0,
    "msg": "success",
    "data": {
        "id": "464062092614790430",
        "info": {
            "type": "Wallet",
            "name": "test address",
            "notify_template": "[{$subscription.name}]\nFrom: {$tx.from}\nTo: {$tx.to}\nMethod: {$tx.method}\nStatus: {$tx.status}\nExplore: {$chain.explore}/tx/{$tx.hash}\nTime: {$block.time}\nCreated By chainbot.io",
            "status": "Private"
        },
        "driver": {
            "addresses": [
                "0x114910771af9ca656af840dff83e8264ecf986ca"
            ],
            "chains": [
                {
                    "chain_id": "1",
                    "type": "Ethereum"
                }
            ],
            "strategies": [
                {
                    "func": "eth_transfer",
                    "params": {
                        "direction": "both",
                        "minimum_amount": "0",
                        "minimum_usd": 1
                    }
                },
                {
                    "func": "token_transfer",
                    "params": {
                        "direction": "both",
                        "minimum_usd": 1
                    }
                },
                {
                    "func": "contract_deploy",
                    "params": {}
                }
            ]
        },
        "subscribe_num": null,
        "fork_num": null,
        "view_times": 0,
        "triggered_times": 0,
        "last_trigger_time": 0,
        "readme": "",
        "created_at": null,
        "user": {},
        "notifies": null,
        "forked_bot": null,
        "original_bot": null,
        "sub_users": null
    }
}
```

### Subscribe

#### 订阅 bot

POST `/subscriptions`

**Parameters**

```
{
  "bot_id": "461170869663212058",  // 需要订阅的 bot id
  "info": {
    "name": "address bot",   // 订阅名称
    "status": "Enabled",  // 固定为Enabled
    "actions": [
      {
        "type": "Notify",  // 固定为 Notify
        "params": {
          "channel_ids": [
            2877    // channel id
          ]
        }
      }
    ],
    "notify": {
      "frequency": "5m", // 推送频率， 可选值Always OnlyOnce 5m 10m 30m 1h 4h 12h 24h
      "template": ""
    }
  },
  "driver": {}  // 已废弃，固定传{}就可以
}
```

**Response**

```
{
    "code": 0,
    "msg": "success",
    "data": {
        "id": "464064078080863518",  //
        "info": {
            "name": "safa",
            "status": "Enabled",
            "actions": [],
            "notify": {
                "frequency": "Always",
                "template": "[{$subscription.name}]\nFrom: {$tx.from}\nTo: {$tx.to}\nMethod: {$tx.method}\nStatus: {$tx.status}\nExplore: {$chain.explore}/tx/{$tx.hash}\nTime: {$block.time}\nCreated By chainbot.io"
            }
        },
        "user_id": 2137,
        "bot_id": "464063535924735262",
        "trigger_times": 0,
        "last_trigger_time": 0,
        "trigger_last_update_at": 1716138672,
        "created_at": "2024-05-19T17:11:12.64Z"
    }
}
```

#### 取消订阅 bot

**DELETE** `/subscriptions/{subscription_id}`

**Parameters**

* `subscription_id`

**Response**

```
{
    "code": 0,
    "msg": "success",
    "data": {}
}
```


# Event Bot 案例

> 已配置的典型 Event Bot 监控案例，你可以参照这些案例学习并配置你的 Bot 监控。

### USDC 增发 Bot 监控

<figure><img src="/files/p9It0DawM5Jbbq7egY1d" alt=""><figcaption><p>Mint USDC Bot for Event Monitor</p></figcaption></figure>

[跳转至该 Bot 案例](https://chainbot.io/bot/309141703208769299)

### USDC 销毁监控

<figure><img src="/files/IpJEXtReIU1FaXHpUbBC" alt=""><figcaption><p>Burn USDC Bot for Event Monitor</p></figcaption></figure>

[跳转至该 Bot 案例](https://chainbot.io/bot/309142198203815699)


# Dex Bot 案例

> 已配置的典型 Dex Bot 监控案例，你可以参照这些案例学习并配置你的 Bot 监控。

### Uniswap V2 币价监控

<figure><img src="/files/NJAV0Ats9MeupAE0Xjpn" alt=""><figcaption><p>Price Bot Monitor by Dex</p></figcaption></figure>

[跳转至该 Bot 案例](https://chainbot.io/bot/309115106724321043)

### Uniswap V2 大额 Swap 监控

<figure><img src="/files/8apn9Bb6c1sbk8lx9Giq" alt=""><figcaption><p>Swap Bot Monitor by Dex</p></figcaption></figure>

[跳转至该 Bot 案例](https://chainbot.io/bot/309115846817650451)

### Uniswap V3 大额 Swap 监控

<figure><img src="/files/r3qxSGtWXiWovtNmn76w" alt=""><figcaption><p>Swap Bot Monitor by Dex</p></figcaption></figure>

[跳转至该 Bot 案例](https://chainbot.io/bot/309135326927427347)

### Uniswap 添加流动性监控

<figure><img src="/files/jBH8RGeoL9QCkK5nTNC4" alt=""><figcaption><p>Add Liquidity Bot Monitor by Dex</p></figcaption></figure>

[跳转至该 Bot 案例](https://chainbot.io/bot/309118057065125651)

### Uniswap 移除流动性监控

<figure><img src="/files/BJgFsGQok5CZaCn3UGMK" alt=""><figcaption><p>Remove Liquidity Bot Monitor by Dex</p></figcaption></figure>

[跳转至该 Bot 案例](https://chainbot.io/bot/309118450188916499)


# Value Bot 案例

> 已配置的典型 Value Bot 监控案例，你可以参照这些案例学习并配置你的 Bot 监控。

### 单指标 Value 监控

<figure><img src="/files/usglKgt6rg0AKw7ij5ss" alt=""><figcaption></figcaption></figure>

[跳转至该 Bot 案例](https://chainbot.io/bot/308885297973003838)

### 多指标 Value 监控

<figure><img src="/files/BB31IOTpyd3ewXkV8mDn" alt=""><figcaption></figcaption></figure>

[跳转至该 Bot 案例](https://chainbot.io/bot/308891060913210942)

### TVL 监控

> 主要使用 ChainBot 提供的 tokenPrice(symbol: string) 的方法将 amount 转化成 U 计价的价格

<figure><img src="/files/brJoVsIqrEY8ySBor50z" alt=""><figcaption></figcaption></figure>

[跳转至该 Bot 案例](https://chainbot.io/bot/308892585995503166)

### Bot 引用监控

> Value 类型的 Bot 监控中，提供了引用其他 Bot 数值的功能。

<figure><img src="/files/V5tqipbNyxb00MNOLXmd" alt=""><figcaption></figcaption></figure>

[跳转至该 Bot 案例](https://chainbot.io/bot/308898889530902078)


# Transaction Bot 案例

> 已配置的典型 Transaction Bot 监控案例，你可以参照这些案例学习并配置你的 Bot 监控。

### 目标地址大额转出监控

<figure><img src="/files/8JARANu5Xiy3CIdd3Bpc" alt=""><figcaption></figcaption></figure>

[跳转至该 Bot 案例](https://chainbot.io/bot/308871909855036990)

### 目标地址接收转账监控

<figure><img src="/files/T4TObM8FcwTKdMH5fAVm" alt=""><figcaption></figcaption></figure>

[跳转至该 Bot 案例](https://chainbot.io/bot/308873369624151614)

### 多个目标地址转账交易

<figure><img src="/files/umq7qmDSytKS8xReS0HJ" alt=""><figcaption></figcaption></figure>

[跳转至该 Bot 案例](https://chainbot.io/bot/306173082463221184)

### 目标合约的目标方法的交易监控

<figure><img src="/files/fuhSvJauXuarHt4GnpVY" alt=""><figcaption></figcaption></figure>

[跳转至该 Bot 案例](https://chainbot.io/bot/308875461390599742)


# Block Bot 案例

> 已配置的典型 Block Bot 监控案例，你可以参照这些案例学习并配置你的 Bot 监控。

### Gas Fee 监控案例

<figure><img src="/files/nxWaVqN8itNTLoVbEvkk" alt=""><figcaption></figcaption></figure>

[跳转至该 Bot 案例](https://chainbot.io/bot/308869331734136382)

### 区块 Gas 使用率监控案例

<figure><img src="/files/ZHLt75z0OLLsMmIxgMCF" alt=""><figcaption></figcaption></figure>

[跳转至该 Bot 案例](https://chainbot.io/bot/308869734219613758)

### 矿工地址出块监控

<figure><img src="/files/8dk3EJBtPj0SuNXd83Td" alt=""><figcaption></figcaption></figure>

[跳转至该 Bot 案例](https://chainbot.io/bot/308870353030121022)


# NFT Bot 案例

> 已配置的典型 NFT Bot 监控案例，你可以参照这些案例学习并配置你的 Bot 监控。

### NFT 地板价监控

<figure><img src="/files/6K6m1EWrz8JA8eRseL3l" alt=""><figcaption></figcaption></figure>

[跳转至该 Bot 案例](https://chainbot.io/bot/308853533485598270)

### Opensea 上目标 NFT 有新的挂单 token 出售

> 对应 Opensea 平台的 buy now，即可以监控某个 NFT 大户的出售意向价格。

<figure><img src="/files/MejKvoLUfc4olxL3K4SK" alt=""><figcaption></figcaption></figure>

[跳转至该 Bot 案例](https://chainbot.io/bot/308855519823824446)

### NFT 成交监控

<figure><img src="/files/la6KWGfpOyDrtT03xwCE" alt=""><figcaption></figcaption></figure>

[跳转至该 Bot 案例](https://chainbot.io/bot/308856215759390270)

### NFT metadata 更新监控

<figure><img src="/files/UyNU2K39OBktDrVscvyu" alt=""><figcaption></figcaption></figure>

[跳转至该 Bot 案例](https://chainbot.io/bot/308856442302531134)

### NFT 大户所有权转移监控

<figure><img src="/files/VxXBjUdaWWBwTZl0r9os" alt=""><figcaption></figcaption></figure>

[跳转至该 Bot 案例](https://chainbot.io/bot/308858653874882110)

### NFT 有新的 bid 监控

<figure><img src="/files/KXJw5WImaR83tKlarbcw" alt=""><figcaption></figcaption></figure>

[跳转至该 Bot 案例](https://chainbot.io/bot/308859223780329022)

### 关注的 NFT 收到新的 offer 监控

<figure><img src="/files/AEB1CJlpp37lVPCPExv1" alt=""><figcaption></figcaption></figure>

[跳转至该 Bot 案例](https://chainbot.io/bot/308860068865279550)

### NFT 撤销 bid, offer 监控

<figure><img src="/files/vO4LuuUG4F2AMkuQqsOS" alt=""><figcaption></figcaption></figure>

[跳转至该 Bot 案例](https://chainbot.io/bot/308860714838296126)


# Snapshot Bot 案例

> 已配置的典型 Snasphot Bot 监控案例，你可以参照这些案例学习并配置你的 Bot 监控。

### 监控目标 Space 的所有提案

<figure><img src="/files/7jFRw2kTVI4xFL8DRplQ" alt=""><figcaption></figcaption></figure>

[跳转至该 Bot 案例](https://chainbot.io/bot/308847499324786238)

### 监控目标 Space 的特定事件提案

<figure><img src="/files/6nFe6zyt8XvnUtEZWNuf" alt=""><figcaption></figcaption></figure>

[跳转至该 Bot 案例](https://chainbot.io/bot/308847997305849406)


# Arweave Bot 案例

> 由于目前使用 Arweave 存储数据形成规模的只有 Mirror 平台，因此以下案例都是使用 Mirror 展示。
>
> 已配置的典型 Arweave Bot 监控案例，你可以参照这些案例学习并配置你的 Bot 监控。

### Mirror 全平台文章监控

<figure><img src="/files/TmXVSltxEqFPOZ6VcERS" alt=""><figcaption></figcaption></figure>

[跳转至该 Bot 案例](https://chainbot.io/bot/308846134615836222)

### 监控 Mirror 多个目标作者的文章

<figure><img src="/files/WlWMZNvHN9EQVeIKmVwG" alt=""><figcaption></figcaption></figure>

[跳转至该 Bot 案例](https://chainbot.io/bot/308846177162528318)

### 监控 Mirror 包含关键词的文章

<figure><img src="/files/y2vMw8UggOcTg2IbvBAu" alt=""><figcaption></figcaption></figure>

[跳转至该 Bot 案例](https://chainbot.io/bot/308846213250385470)


# Privacy Policy

Last updated: Oct 14, 2022

Please read this Privacy Policy carefully before using the Chainbot websites, including <https://www.chainbot.io> and all other subdomains, (the "Service") operated by Ltd. ("us", "we", or "our"), a company incorporated in Singapore. This Privacy Policy outlines which of your personal data we collect, how we use this data and your data privacy rights as a user of the Service.

In this Privacy Policy, by personal data we mean information that identifies you as an individual. Personal data does not include non-personally identifying information.

**We have a few fundamental principles that we follow:**

Data you provide to Chainbot (such as labels added to "My Chainbot") will not be made available to other users - nor will they be used for our own internal labeling - without your permission.

Aggregate statistics from user behavior on the Chainbot platform may be used whenever there's no risk of displaying user-sensitive data. An example of such a feature would be top-ranked tokens that Chainbot users have recently viewed - across all users. Conversely, we would not surface top blockchain addresses that have been viewed, since this could involve a risk of displaying user-sensitive data.

We never use customer data (nor your activity data from using Chainbot) to add new labels.

We do not share your personal data with anyone except to develop our products, protect our rights, or comply with the law.

We do not store personal data on our servers unless required for the on-going operation of our service.

It is our policy to respect your privacy regarding any information we may collect while operating our service.

**NON-PERSONALLY IDENTIFYING INFORMATION WE COLLECT**

Our purpose in collecting non-personally identifying information is to better understand how visitors use our website. We do not use non-personally identifying information in a way that would enable us to identify you personally.

**Log files**

We collect non-personally identifying information of the sort that web browsers and servers typically make available, such as the browser type, language preference, referring site, and the date and time of each visitor request.

**Aggregated statistics**

We may collect statistics about the behaviour of visitors and users of the Service. For instance, we may monitor the most popular dashboards or queries. We may display this information publicly or provide it to others.

**PERSONAL DATA WE COLLECT**

Sometimes, you may choose to interact with the Service in ways that require us to gather your personal data. The amount and type personal data that we gather depends on the nature of the interaction. You may always refuse to supply personal data, with the caveat that it may prevent you from using certain parts of the Service.

**Signing up for an account**

If you sign up for an account with the Service, we will ask to provide an email address. We do this simply because it is the most convenient way to persist a user account over time, while having the possibility to communicate with you as a user.

**Marketing material**

When signing up for an account with the Service, you are automatically enrolled into our email communication. We may occasionally send you an email to tell you about new features, solicit your feedback, or just keep you up to date with what’s going on with our products. You can unsubscribe at any time by clicking the "Unsubscribe" button in our emails.

**Billing information**

A trusted third party is used to manage payment processing. This third party is not permitted to store, retain, or use your billing information for any purpose except for payment processing on our behalf.

**Cookies**

A cookie is a string of information that a website stores on a visitor’s computer, and that the visitor’s browser provides to the website each time the visitor returns. We use cookies to help us track your usage of our website, and your website access preferences. If you do not wish to have cookies placed on your computer, you may set your browser to refuse cookies before using our websites, with the caveat that certain features of our websites may not function properly without the aid of cookies.

**PROTECTION OF PERSONAL DATA**

We disclose personal data only to our employees, contractors, related companies and trusted third parties that:

* Need to know that information in order to process it on our behalf or to provide services available at our websites, and
* That have agreed not to disclose it to others.

Some of those employees, contractors, related companies and trusted third parties may be located outside of your home country which may have different privacy laws than your home country. By using the Service, you consent to the processing and transfer of your personal data to them.

Other than to our employees, contractors, related companies and trusted third parties, as described above, we disclose personal data only as necessary to comply with our legal obligations, maintain accurate accounting, resolve disputes and enforce our agreements.

We take all measures reasonably necessary to protect against the unauthorised access of your personal data.

**BUSINESS TRANSFERS**

If we or substantially all of our assets are acquired, or in the unlikely event that we go out of business or become insolvent, your personal data could be one of the assets that is transferred or acquired. You acknowledge that such transfers may occur, and that any acquirer may continue to use your personal data as set forth in this Privacy Policy.

**YOUR RIGHTS**

You may request access to your personal data, as well as information on how we process your personal data. You may also request to erase, restrict or rectify such processing. Additionally, you may request to receive your personal data exported in a structured, commonly used and machine-readable format.

Upon your request, we will delete your personal data.

For further information about your data protection rights, you may contact our Data Protection Officer at the email address below.

Attention: Data Protection Officer <support@chainbot.io>

**PRIVACY POLICY CHANGES**

We may change this Privacy Policy from time to time, and at our sole discretion. We will inform you in advance of any material changes. You are encouraged to review this page for the latest version of this Privacy Policy. Your continued use of this site after any change in this Privacy Policy will constitute your acceptance of such change.


# Terms of Services

Last updated: Oct 14, 2022

Please read these Terms of Service ("Terms", "Terms of Service") carefully before using the Chainbot websites, including <https://www.chainbot.io> and all other subdomains, (the "Service") operated by Chainbot Ltd. ("us", "we", or "our"), a company incorporated in Singapore.

Your access to and use of the Service is conditioned on your acceptance of and compliance with these Terms. These Terms apply to all visitors, users and others who access or use the Service.

By accessing or using the Service you agree to be bound by these Terms. If you disagree with any part of the terms then you may not access the Service.

**DISCLAIMER**

To the maximum extent permitted under applicable law, the Service is provided on an “as is” and “as available” basis. We expressly disclaim, and you waive, all warranties of any kind, whether express or implied, including, without limitation, implied warranties of merchantability, fitness for a particular purpose, title and non-infringement as to the Service, including the information, content and materials contained therein.

**ACCEPTABLE USE**

You agree to use the Service in accordance with the applicable law and regulations and in accordance with these Terms. You are solely responsible for your conduct while using the Service. You must not:

1. Copy, reproduce, modify, distribute, duplicate, copy, sell, resell, license, publicly display or disclose the Service without our prior consent.
2. Share, recompile, decompile, disassemble, reverse engineer, or make or distribute any other form of, or any derivative work from the Service;
3. Use the Service, directly or indirectly, in any manner that could cause the Service so used to: (i) be a substitute for the Service by a third party, (ii) affect Chainbot's ability to realize revenue in connection with the Service, or (iii) compete with Chainbot's business;
4. Store or use data or content in an archival file site, database or other searchable repository except as expressly permitted by this agreement or in an applicable order form.
5. Use any robot, spider, crawler, scraper or other automated means or interface not provided by us to access the Service or to extract data;
6. Use or attempt to use another user’s account without authorization;
7. Attempt to circumvent any content filtering techniques we employ, or attempt to access any service or area of the Service that you are not authorised to access;
8. Introduce to the Service any virus, trojan worms, logic bombs or other harmful material or otherwise hack the Service;
9. Develop any third-party applications that interact with the Service without our prior written consent;

We reserve the right to determine whether a use of the Service is in violation of these Terms or fails to constitute acceptable use.

**ACCESSING CHAINBOT USING WEB3 SERVICES:**

Chainbot leverages web3 services to provide our end users the ability to sign up with, or associate their existing account, to their blockchain address which functions as an extension of their personal identity and can be used to as a form of accessing the platform.

By using this feature Chainbot assumes the right to collect your blockchain wallet address, completed transaction information and token identifiers for the purpose of enabling this feature.

Wallets are not maintained by, operated by, or affiliated with Chainbot. Chainbot has no control over the contents of your wallet and does not accept any responsibility for, or liability to you, in connection with your usage of a wallet on the Chainbot platform. You, as the user and owner of the wallet, are solely responsible for keeping your wallet secure. You should never share credentials or seed phrases of your wallet with anyone and Chainbot will never ask for this information under any circumstances. Any issues noted with your wallet, should be directed to and discussed with your wallet provider.

**THIRD-PARTY LINKS**

The Service may contain links to third-party web sites or services that are not owned or controlled by Chainbot.

Chainbot has no control over, and assumes no responsibility for, the content, privacy policies, or practices of any third party web sites or services. You further acknowledge and agree that Chainbot shall not be responsible or liable, directly or indirectly, for any damage or loss caused or alleged to be caused by or in connection with use of or reliance on any such content, goods or services available on or through any such web sites or services.

We strongly advise you to read the terms and conditions and privacy policies of any third-party web sites or services that you visit.

**INTELLECTUAL PROPERTY RIGHTS**

We retain all rights, including all copyright and other intellectual property rights, in all content and other materials contained on our website or provided in connection with the Service.

You receive no license or usage rights to the Service other than what is explicitly stated in these Terms.

**LIMITATION**

Except as otherwise required by law, in no event shall we be liable for any special, indirect or consequential damages, or any other damages of any kind, including but not limited to loss of use, loss of profits or loss of data, arising out of or in any way connected with the use of or inability to use the Service, including without limitation any damages resulting from reliance by you on any information obtained from using the Service.

**MAINTENANCE**

We may temporarily suspend the Service from time to time for maintenance. We do not warrant any particular level of Service availability.

**TERMINATION**

We may terminate or suspend access to the Service immediately, without prior notice or liability, for any reason whatsoever, including without limitation if you breach the Terms.

All provisions of the Terms which by their nature should survive termination shall survive termination, including, without limitation, ownership provisions, warranty disclaimers, indemnity and limitations of liability.

**WAIVER**

Our failure to enforce any right or provision of these Terms will not be considered a waiver of those rights. If any provision of these Terms is held to be invalid or unenforceable by a court, the remaining provisions of these Terms will remain in effect. These Terms constitute the entire agreement between us regarding the Service, and supersede and replace any prior agreements we might have between us regarding the Service.

**CHANGES**

We reserve the right, at our sole discretion, to modify or replace these Terms at any time. If a revision is material we will try to notify you prior to any new terms taking effect. What constitutes a material change will be determined at our sole discretion. By continuing to access or use the Service after those revisions become effective, you agree to be bound by the revised terms. If you do not agree to the new terms, please stop using the Service.

**GOVERNING LAW AND JURISDICTION**

These Terms shall be governed and construed in accordance with the laws of Singapore, without regard to its conflict of law provisions.

You irrevocably agree that the Singapore courts shall have non-exclusive jurisdiction to hear and decide any suit, action or proceedings or settle any dispute arising out of or in connection with the Service.

**CONTACT US**

If you have any questions about these Terms, please contact us via email: <support@chainbot.io>




---

[Next Page](/llms-full.txt/1)

