# What is Brist

Brist is the easiest way to listen for and build automations around on-chain events. With Brist, you can listen for arbitrarily specific events on any chain and pipe them to outcomes, all while writing little to no code.

Though we're starting out with Ethereum and EVM-based chains, we're adding new sources and sinks as fast as we can. If there's a specific workflow that you'd like that isn't currently enabled, reach out to[ jagath@usebrist.com](mailto:jagath@usebrist.com) and we'll get it up and running ASAP.

## Getting Started

**Got 2 minutes?** Check out a video overview of our product:

{% embed url="<https://www.loom.com/share/e0229be4d9614037bac2a128f676d8fd>" %}

### Guides: Jump right in

Follow our handy guides to get started on the basics as quickly as possible:

{% content-ref url="/pages/dtOSz4rEIp5GEFxNaT5l" %}
[Creating your first alert](/guides/creating-your-first-alert)
{% endcontent-ref %}

{% content-ref url="/pages/MVrSoTV9kSSM5chRKY0w" %}
[Setting up Discord Output](/guides/setting-up-discord-output)
{% endcontent-ref %}

{% content-ref url="/pages/zwQyYRErYzWchZCZ5R3v" %}
[Setting up Telegram Output](/guides/setting-up-telegram-output)
{% endcontent-ref %}

### Fundamentals: Dive a little deeper

Learn the fundamentals of Brist to get a deeper understanding of our main features:

{% content-ref url="/pages/8OwbClw2AxOSIVnPt6qO" %}
[How Brist Works](/fundamentals/how-brist-works)
{% endcontent-ref %}

{% content-ref url="/pages/dUc2BltuebygE2i7YWin" %}
[On-chain events](/fundamentals/on-chain-events)
{% endcontent-ref %}

{% content-ref url="/pages/2eNyJtPXtcoQ47Zuw5VH" %}
[Filters](/fundamentals/filters)
{% endcontent-ref %}

{% content-ref url="/pages/z9OO50Alm9v3nQxiwVA5" %}
[Outputs](/fundamentals/outputs)
{% endcontent-ref %}

### Need help?&#x20;

{% content-ref url="/pages/lKCJg6pmOaqkG4duhkfr" %}
[Support and Feedback](/extras/support-and-feedback)
{% endcontent-ref %}


# Creating your first alert

## The basics

Alerts are the core of Brist: they're configurable combinations of chains, filters, and outputs that make up Brist's automations.&#x20;

The **chain** is the blockchain you're listening for events on. When you choose a chain, you're enabling alerts for every transaction on the chain.

Once you choose a chain, you can create **filters** to select the events you're interested in using as triggers. At the moment, we support wallet- and token-based filters.&#x20;

**Outputs** are the channels you can pipe your selected events to. At the moment, we support automated messages to Telegram and Discord, as well as posting to custom Webhooks (which is likely preferable if you're a dev integrating this into your product).&#x20;

You can learn more about each of the output channels (as well as how to set them up) in their respective Guides. You can also learn more about Events and Filters in their respectives Fundamentals sections.

## Creating an alert

In this tutorial, you'll learn how to trigger a Telegram message every time a Bored Ape is transferred.

Navigate to the Workflows tab, then click "New" to set up a new alert. At the top of the page, enter the alert's name.&#x20;

![The alert creation screen](https://4074459715-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDuEIe1RiqxEMHjbyhQYC%2Fuploads%2FjzWH39tWCdrPecpZM6An%2Fimage.png?alt=media\&token=e7078c9a-2673-44a0-b3dd-e0ba0d9da93e)

The first step in defining your automation is to select the chain to listen to. As BAYC is an Ethereum collection, choose "Ethereum. Then, click the "+" button to add a filter for a specific type of event.

![Selecting Ethereum as our chain](https://4074459715-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDuEIe1RiqxEMHjbyhQYC%2Fuploads%2FNwqbivAcVLZ27hKalb5r%2Fimage.png?alt=media\&token=b37c40a2-6603-4a8c-a49c-925ec573addc)

As we want to filter for BAYC NFT's, choose the NFT/Token filter, and enter the address of the Bored Ape ERC 721 contract: 0xBC4CA0EdA7647A8aB7C2061c2E118A18a936f13D. Then, click the "+" button to add an output channel for these transfers.&#x20;

![Filtering for Bored Ape transfers](https://4074459715-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDuEIe1RiqxEMHjbyhQYC%2Fuploads%2FAHHUcv8X5t4QSxxBlAnt%2Fimage.png?alt=media\&token=fd91765d-2d86-4695-84e2-e6df8af32518)

In this tutorial, we'll be outputting event notifications to a channel in the Brist Discord -- if you haven't already, be sure to join the Discord at <https://discord.gg/5djY3xv5>. To send the messages to Discord, select the "Discord" option from the dropdown, and paste the webhook URL for the #test-messages channel in the Brist Discord: <https://discord.com/api/webhooks/979514914831990804/0GeGYt2aBFSXBIKIeVZwdt0bzD6wi-T8VA3NUWTbQ26IokqdYuQYBZlcRCCwOZK174I->

![Adding a Discord Webhook](https://4074459715-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDuEIe1RiqxEMHjbyhQYC%2Fuploads%2FjH2Um7guyi6yqdEPQnDr%2Fimage.png?alt=media\&token=eee0ab6e-c69a-453e-acab-7a038ca01c0e)

Finally, click save at the top, and you're done! Be sure to go back to the Workflows screen to turn on the automation (they are default off when created).&#x20;

![Be sure to turn on your alert!](https://4074459715-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDuEIe1RiqxEMHjbyhQYC%2Fuploads%2FaJHPDaOPb1GhTgo5EOYp%2Fimage.png?alt=media\&token=943a20ac-6665-41a2-aa37-a514721a62de)

You'll be able to view fired notifications from your alerts (and those of other people who followed this tutorial) in the `#test-messages` channel on the Brist Discord.&#x20;

![The completed alert!](https://4074459715-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDuEIe1RiqxEMHjbyhQYC%2Fuploads%2Fb7PpEuRK9feGlmo4DM7N%2Fimage.png?alt=media\&token=9005300d-7431-4877-97ae-d9a82d981f9a)


# Setting up Discord Output

This guide will walk you through obtaining a Webhook URL for a Discord channel to enable Discord alerts with Brist.&#x20;

{% hint style="warning" %}
You can only forward Brist alerts to a channel if you're an admin of the server. If you don't currently have a server, you can create one by following the instructions [here](https://support.discord.com/hc/en-us/articles/204849977-How-do-I-create-a-server-)
{% endhint %}

1. Identify the channel you'd like Brist to post to, and click on the settings icon on the right side (the tooltip should say "Edit Channel").

![Find your channel on the left side of the Discord client.](https://4074459715-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDuEIe1RiqxEMHjbyhQYC%2Fuploads%2Fd5KiEmJGQILKzumVSjOF%2Fimage.png?alt=media\&token=72a36b27-3188-4962-a6a7-a64f97406139)

2\. Navigate to the "Integrations" tab, then click "Webhooks"

![](https://4074459715-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDuEIe1RiqxEMHjbyhQYC%2Fuploads%2FKKiDoX4RiE8X8mEkRO3t%2Fimage.png?alt=media\&token=6b618f8d-4b6d-451c-bf58-1bc09631aa38)

3\. Click "New Webhook." Name your webhook "Brist," and ensure that the selected channel is the one you want Brist to post to.&#x20;

![Setting up the webhook](https://4074459715-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDuEIe1RiqxEMHjbyhQYC%2Fuploads%2FULzfqvxf2WGOvtMH8ZNS%2Fimage.png?alt=media\&token=3bf15c1b-9527-4323-8aa4-fe13eb0c5093)

4\. Finally, click "Copy Webhook URL" and paste it into the "Discord Webhook URL" field in the Brist Action edit screen. Make sure to save your action once you're done!

![The output block of a Brist alert on the edit screen](https://4074459715-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDuEIe1RiqxEMHjbyhQYC%2Fuploads%2Fgp5PX7ZKdw4fu2KKXUOM%2Fimage.png?alt=media\&token=019b14bd-7602-4f31-8443-4827fa7f6e5e)


# Setting up Telegram Output

This guide will walk you through creating a Telegram channel or group for Brist alerts and obtaining the Chat ID from the Brist Bot.&#x20;

Adding Brist to a Telegram Group is slightly different from adding it to a Telegram channel; here, we cover both processes.

### Setting up a Telegram Group

1. Create a **New Group.**
2. Name the group and add the users you'd like to join, then confirm the group's creation.
3. Click on the three dots on the top right corner of the screent, select **Info,** then click **Add Members**

![Navigating to group info](https://4074459715-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDuEIe1RiqxEMHjbyhQYC%2Fuploads%2F1lTziN4bd7FtoxHAHs72%2Fimage.png?alt=media\&token=4426cbde-7115-47a6-8455-26e58f286495)

4\. Invite `@brist_alerts_bot` to your new group (its name is BristBot).

![Be sure to choose "BristBot"](https://4074459715-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDuEIe1RiqxEMHjbyhQYC%2Fuploads%2FsE40Xnfh0pyruEw1lv84%2Fimage.png?alt=media\&token=b41db5ac-63a9-438f-adc7-980f0f02bc40)

5\. Message the group with `/chat_id`; BristBot will respond with this chat's Telegram ChatID.&#x20;

![](https://4074459715-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDuEIe1RiqxEMHjbyhQYC%2Fuploads%2FbPCft0Wl9mhkekQb5VL3%2Fimage.png?alt=media\&token=a17d2eb9-1edc-453d-bbe8-1f11cdc893c4)

6\. Finally, paste the Chat ID (including the "-" sign, if present) into the Chat ID field in the Brist alert UI.&#x20;

![](https://4074459715-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDuEIe1RiqxEMHjbyhQYC%2Fuploads%2FNfG1XP3x6BT8qOOoT9Ll%2Fimage.png?alt=media\&token=6dcfb698-f73c-47b2-ba9e-ae70469c7231)

### Setting up a Telegram Channel&#x20;

{% hint style="info" %}
You'll need to use the Telegram Desktop client to create a new channel
{% endhint %}

1. Select **New Channel**, and follow the instructions to complete creation of the channel.
2. Click on the three dots on the top-right corner, then click **Info**
3. Go to **Administrators->Add Admin**, and look for `brist_alert_bot`

![Be sure to choose BristBot](https://4074459715-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDuEIe1RiqxEMHjbyhQYC%2Fuploads%2FAglsGW7u8xfaXGwXzSOk%2Fimage.png?alt=media\&token=add05b69-c38c-487a-b2ce-d9392d858993)

4\. Message the group with `/chat_id`; BristBot will respond with this chat's Telegram ChatID.&#x20;

![](https://4074459715-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDuEIe1RiqxEMHjbyhQYC%2Fuploads%2FbPCft0Wl9mhkekQb5VL3%2Fimage.png?alt=media\&token=a17d2eb9-1edc-453d-bbe8-1f11cdc893c4)

6\. Finally, paste the Chat ID (including the "-" sign, if present) into the Chat ID field in the Brist alert UI.&#x20;

![](https://4074459715-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDuEIe1RiqxEMHjbyhQYC%2Fuploads%2FNfG1XP3x6BT8qOOoT9Ll%2Fimage.png?alt=media\&token=6dcfb698-f73c-47b2-ba9e-ae70469c7231)


# How Brist Works

At a high level, Brist maintains nodes on multiple chains, dispatches workers to listen for potentially relevant events, enriches these events to be human-understandable, then passes events through user-stipulated filters into designated output channels.

For more information on each step, see the other pages in this section.&#x20;

{% content-ref url="/pages/dUc2BltuebygE2i7YWin" %}
[On-chain events](/fundamentals/on-chain-events)
{% endcontent-ref %}

{% content-ref url="/pages/2eNyJtPXtcoQ47Zuw5VH" %}
[Filters](/fundamentals/filters)
{% endcontent-ref %}

{% content-ref url="/pages/z9OO50Alm9v3nQxiwVA5" %}
[Outputs](/fundamentals/outputs)
{% endcontent-ref %}

####

At the moment, we primarily enable alert creation through the Brist app's no-code interface. Programmatic alert creation is in closed alpha -- if you're interested in using it, please reach out to <jagath@usebrist.com>


# On-chain events

#### Event parsing

Brist parses each new block for transactions in which at least one of the following occurs:&#x20;

* A transfer of ETH
* A transfer of an ERC-20 token
* A transfer of an ERC-721 token (NFT)

Brist then enriches these transactions and passes them forward through each filter, before dispatching the filtered messages to the output channels.


# Filters

Once incoming blocks are condensed into enriched events, Brist matches these events with user-defined filters before funneling them into the designated output channels. Filters can be stacked, with AND logic applying to the filters in a series.

Currently, Brist supports two kinds of filters (with more on the way!):&#x20;

### Wallet Filters

Wallet filters match the sending and/or receiving addresses of events. Wallet filters can be used to, for example:&#x20;

* Create an alert whenever a certain wallet makes a trade, or receives an asset
* Create an alert when a certain smart contract (e.g. OpenSea, a Uniswap pool) is interacted with, by entering the contract address in the "To" section

### Token/NFT Filters

Token/NFT filters match the smart contract that facilitated a transfer. You can use Token/NFT filters to match with a specific NFT collection (e.g. Bored Ape Yacht Club) or ERC-20 token (e.g. USDC).&#x20;

To create a Token/NFT filter, you just need to indicate the contract address underlying the asset; you can find this information easily on Etherscan, OpenSea, Coingecko, and a variety of other services. We will be enabling token/NFT searches in the near future, so you won't have to know the contract address to create a filter.&#x20;


# Outputs

Brist pipes alerts and filtered & enriched event data to designated destinations. Currently, we support Discord, Telegram, and custom webhooks.&#x20;

### Discord

Brist uses Discord webhooks to send messages to Discord channels. You can learn more about how to set up webhooks in the "Setting up Discord Output" guide.&#x20;

{% content-ref url="/pages/MVrSoTV9kSSM5chRKY0w" %}
[Setting up Discord Output](/guides/setting-up-discord-output)
{% endcontent-ref %}

Note that anyone can POST to your Discord channel's webhook to create a message. If you'd like to guard against bad actors by requiring a signature, please reach out to <jagathvythee@gmail.com>

### Telegram

Brist operates a Telegram bot that can send messages to chats. To output Brist alerts to Telegram, you'll need to add the bot as an admin to a chat and find the chat URL. You can learn more about setting this up in the "Setting up Telegram Output" guide.&#x20;

{% content-ref url="/pages/zwQyYRErYzWchZCZ5R3v" %}
[Setting up Telegram Output](/guides/setting-up-telegram-output)
{% endcontent-ref %}

### Custom Webhooks

Brist also lets you enable your own custom actions through sending POST requests to user-defined webhook URL's for each filter-matched transfer event.

#### Webhook Payload Properties

| Key               | Type              | Description                                                                                                        |
| ----------------- | ----------------- | ------------------------------------------------------------------------------------------------------------------ |
| `transactionHash` | `string`          | Hash of the transaction in which the event took place                                                              |
| `transferEvents`  | `[]TransferEvent` | The transfer events that took place in the transaction. At least one of these matched the criteria from the filter |
| `textMessage`     | `string`          | The alert message formulated by Brist                                                                              |

#### TransferEvent Properties

| Key               | Type            | Description                                                                                 |
| ----------------- | --------------- | ------------------------------------------------------------------------------------------- |
| `sender`          | `string`        | The address of the sender                                                                   |
| `receiver`        | `string`        | The address of the recipient                                                                |
| `amount`          | `int`           | The (unadjusted) number of tokens transferred. Only applies to ETH or ERC20 transfers       |
| `nftMetadata`     | `NFTMetadata`   | Enriched information about the NFT. Only applies if the transferred asset was ERC721        |
| `tokenMetadata`   | `TokenMetadata` | Enriched information about the ERC20 token. Only applies if the transferred asset was ERC20 |
| `contractAddress` | `string`        | Address of the contract underlying the transfer                                             |
| `contractType`    | `string`        | One of `ETH Transfer`, `ERC20 Transfer`, or `ERC721 Transfer`                               |

#### NFTMetadata Properties

Note that the NFT Metadata object is only present if the transferred asset in this event was an NFT.

| Key                | Type     | Description                                                  |
| ------------------ | -------- | ------------------------------------------------------------ |
| `tokenID`          | `uint`   | The ID of the token in the NFT collection                    |
| `collectionName`   | `string` | The name of the NFT collection (e.g. `Bored Ape Yacht Club`) |
| `collectionSymbol` | `string` | The symbol of the NFT collection (e.g. `BAYC`)               |

For information on how to set up the Webhook output, see the relevant Guide below.

{% content-ref url="/pages/X3m4SK8Bee8zdd466Zey" %}
[Broken mention](broken://pages/X3m4SK8Bee8zdd466Zey)
{% endcontent-ref %}

{% hint style="warning" %}
Brist's POST requests are not authenticated, though this feature will be released soon. If you need authentication to ensure that the requests come from Brist, please reach out to <jagath@usebrist.com>, and we'll add keys to your alerts. One workaround is to add a secret string to your webhook path.
{% endhint %}


# Support and Feedback

Please join the Discord community ([invite link](https://discord.gg/5djY3xv5)) to stay up-to-date, submit feature requests, and chat with the admins (reymdn#7119 and vigneshv#8625).&#x20;

You can also reach us over email at[ jagath@usebrist.com](mailto:jagath@usebrist.com), and on the chat widget in the app.


