> For the complete documentation index, see [llms.txt](https://docs.treeofalpha.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.treeofalpha.com/tree-terminal/features/filters.md).

# Filters

The **Filters** function allows users to customize how specific events or keywords from various sources are processed and displayed within Tree Terminal. By selecting a source WebSocket, defining actions, and applying regex-based filters, users can create tailored responses to match their trading strategies.

***

## **How Filters Work**

1. **Source WebSocket**:
   * Users can select the WebSocket that acts as the input source for their filter.
   * **Any**: Applies the filter to all WebSockets.
2. **Sources**:
   * Within a selected WebSocket, users can further specify the exact data source
   * **e.g. Binance**, **Twitter**, **Telegram**, **Blogs**, and more.
   * For `Twitter` , we support `Any` as a handle as well, to indicate that this filter applies to all incoming tweets from source websocket.![](https://4050888585-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FCRtZpSFx87el6yevMYSx%2Fuploads%2Fa7ostOZXWTbzMQN6yrx1%2FScreenshot%202025-04-25%20at%2010.21.55%E2%80%AFAM.png?alt=media\&token=f710b8a6-b821-4fde-9c1e-6154109b3e36)
3. **Regex-Based Filtering**:
   * Filters use **regex (ECMA flavour)** to match patterns in the incoming data.
   * Tree Terminal's Regex are always case-insensitive (`/ /i` )
   * Examples:
     * `DUMPING`: Matches all data containing the word "DUMPING."
   * **We recommend using chatgpt to assist with regex creation, and specify `ECMA`flavour**
4. **Actions**:
   * Define what happens when a filter matches incoming data. Multiple actions can be applied.
   * Supported actions include:
     * `show_feed`: Display the matching content in the feed.
     * `show_search`: Make the match searchable in the terminal.
     * `show_notif`: Trigger a notification.
       * Supports screen location
         * `top` or`bottom`
         * `left` or `center` or `right`&#x20;
       * E.g. `show_notif left-center`
     * `pushover`: Send a push notification.
     * `play_sound <sound_name>`: Play specified sound
       * E.g. `play_sound sound3;`
     * `pin`: Pin the notification for greater visibility.
     * `highlight`: Highlight the notification for increased visibility.
     * `nothing`: Do nothing.
     * `default` : Have all basic behaviors
   * They must be segmented by `;`

{% hint style="info" %}
When defining actions, please remember that it will override the defaults. That means if you define an action without `default`, you will no longer receive notifications for that source, if the regex matches your requirement.&#x20;
{% endhint %}

***

## **How to Configure Filters**

1. **Navigate to Filters**:
   * Open the **Filters** section in Settings.
2. **Add a New Filter**:
   * Select the WebSocket source
   * Specify the exact source within the WebSocket if needed (e.g., Twitter)
   * Add the username if needed
3. **Define the Regex**:
   * Enter a regex pattern to match specific content.
   * Example:
     * To have the filter actions apply to every source, simply use `.` as the regex
     * To match news updates about "Added" on Coinbase:

       ```
       Added
       ```
4. **Set Actions**:
   * Choose one or more actions for the matched content.
   * Example:
     * `show_feed; show_notif; pushover` for high-priority events.
5. **Save and Test**:
   * Save your configuration and monitor the feed to ensure the filter behaves as expected.

***

## **Sample Use Cases for Filters**

Filters in Tree Terminal can be configured to perform specific actions based on matched content. Below are examples of practical use cases:

***

**Use Case 1: Someone Tweets**

* **Scenario**: You want to be notified in Discord whenever a specific user tweets.
* **Filter Configuration**:
  * **Source**: "Any", Twitter
  * **Regex**:

    ```arduino
    .
    ```
  * **Action**:

    ```
    discord_dm;
    ```
* **Outcome**: The tweet will be forwarded to your Discord dm.
* **Important**: We did not add `default;` and therefore this user will no longer appear on notifications. If you wish to retain it, you should instead do:
  * **Action**:

    ```
    discord_dm; default; 
    ```

***

**Use Case 2: Trading Activity**

* **Scenario**: You want to get notified on large trading activity updates to Discord or a Pushover.
* **Filter Configuration**:
  * **Source**: Community
  * **Regex**:

    ```css
    Trading Activity.*[\d.+]M
    ```

    * Matches updates like "Trading Activity: +2.3M."
  * **Action**:

    ```
    pushover; discord_dm; default;
    ```
* **Outcome**: High-volume trading activity notifications will be sent to your Discord and Pushover.

***

**Use Case 3:  Applying actions to a set of twitter users**

* **Scenario**: You want pushovers on a set of twitter users, and want to minimize the number of filters created.&#x20;
* **Filter Configuration**:
  * **Source**: Twitter
  * **Handle: `Any`**
  * **Regex**:

    ```css
    ^@(handle1|handle2|handle3)
    ```
  * **Action**:

    ```
    pushover; default;
    ```
* **Outcome**: Handle 1,2,3 will give a pushover when they tweet.

***

## **Tips for Using Filters**

* **Have a test twitter account**: Add yourself and test if your filters are functioning as expected.
* **Be Specific**: Use precise regex patterns to avoid unnecessary matches or spam.
* **Update Regularly**: Adjust your filters as market conditions and priorities change.
* **Combine Actions**: For critical updates, combine actions like notifications, push alerts, and sound cues.
* **Sequential logic**: Filters are applied from top to bottom, ordering matters.

The **Filters** feature in Tree Terminal ensures that you only receive relevant, actionable information, tailored to your trading strategy and preferences.
