Metadata-Version: 2.4
Name: silverback
Version: 0.7.38
Summary: Listen and respond to on-chain events in real-time
Author-email: "ApeWorX Ltd." <admin@apeworx.io>
License-Expression: Apache-2.0
Project-URL: Homepage, https://silverback.apeworx.io
Project-URL: Repository, https://github.com/ApeWorX/silverback.git
Project-URL: Issues, https://github.com/ApeWorX/silverback/issues
Project-URL: Documentation, https://docs.apeworx.io/silverback
Project-URL: Funding, https://github.com/sponsors/ApeWorX
Project-URL: Twitter / X, https://x.com/ApeFramework
Keywords: silverback,bots,crypto,ethereum,automation,defi
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Natural Language :: English
Classifier: Operating System :: MacOS
Classifier: Operating System :: POSIX
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Python: <4,>=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: apepay<1,>=0.3.5
Requires-Dist: click
Requires-Dist: eth-ape<1,>=0.8.38
Requires-Dist: ethpm-types>=0.6.10
Requires-Dist: eth-pydantic-types
Requires-Dist: exceptiongroup; python_version < "3.11"
Requires-Dist: httpx<1,>=0.28
Requires-Dist: jwcrypto<2,>=1.4
Requires-Dist: packaging
Requires-Dist: pycron<4,>=3.1
Requires-Dist: pydantic_settings
Requires-Dist: python-dotenv<2,>=1.1.1
Requires-Dist: quattro<26,>=25.2
Requires-Dist: taskiq[metrics]<0.13,>=0.12.1
Requires-Dist: tomlkit<1,>=0.12
Requires-Dist: yaspin<4,>=3.1
Provides-Extra: mcp
Requires-Dist: fastmcp; extra == "mcp"
Provides-Extra: build
Requires-Dist: taskiq-aio-pika<1,>=0.5; extra == "build"
Requires-Dist: taskiq-redis<2,>=1.2; extra == "build"
Provides-Extra: recommended-plugins
Requires-Dist: ape-arbitrum; extra == "recommended-plugins"
Requires-Dist: ape-avalanche; extra == "recommended-plugins"
Requires-Dist: ape-base; extra == "recommended-plugins"
Requires-Dist: ape-bsc; extra == "recommended-plugins"
Requires-Dist: ape-optimism; extra == "recommended-plugins"
Requires-Dist: ape-polygon; extra == "recommended-plugins"
Requires-Dist: ape-sonic; extra == "recommended-plugins"
Requires-Dist: ape-etherscan; extra == "recommended-plugins"
Requires-Dist: ape-ens; extra == "recommended-plugins"
Requires-Dist: ape-tokens; extra == "recommended-plugins"
Requires-Dist: ape-alchemy; extra == "recommended-plugins"
Requires-Dist: ape-infura; extra == "recommended-plugins"
Requires-Dist: ape-drpc; extra == "recommended-plugins"
Requires-Dist: ape-erpc; extra == "recommended-plugins"
Requires-Dist: ape-aws; extra == "recommended-plugins"
Dynamic: license-file

# Overview

Silverback lets you create your own Python bots that respond in real-time to blockchain events.
The Silverback library leverages the [Ape](https://docs.apeworx.io/ape/stable/userguides/quickstart)
development framework, as well as it's ecosystem of plugins and packages, to let you to develop
capable automated bots that trigger your own custom Python logic whenever a specific event occurs.

Silverback bots are excellent for use cases that require continuous monitoring for specific conditions,
and then require a direct response such as sending a notification or submitting a transaction.

Some examples of these types of bots:

- Index raw events from a protocol, and derive bespoke metrics in real-time
- Monitor new pool creations, and deposit liquidity if conditions are favorable
- Measure trading activity of a pool, and use those metrics to inform your own trading algorithm
- Listen for large swaps by whales, in order to update a Telegram group or Discord channel
- Perform protocol actions such as liquidations or oracle updates

## Dependencies

- [python3](https://www.python.org/downloads) version 3.10 or greater, python3-dev

## Installation

Silverback relies heavily on the Ape development framework, so it's worth it to familarize yourself
with how to install Ape and any necessary plugins using the
[Ape installation userguide](https://docs.apeworx.io/ape/stable/userguides/quickstart#installation).

```{note}
It is suggested that you use a virtual environment of your choosing,
and then install the Silverback package via one of the following options.
```

### via `pip`

You can install the latest release via [`pip`](https://pypi.org/project/pip):

```bash
pip install silverback
```

### via `uv`

You can install the latest release via [`uv`](https://docs.astral.sh/uv/getting-started/installation)

```bash
uv tool install silverback
```

```{note}
To install 2nd/3rd party Ape plugins using `uv tool`, you will need to add
`--with ape-<plugin name>` to ensure the environment has them.
```

## Quick Usage

View [the example](https://github.com/ApeWorX/silverback/blob/main/bots/example.py)
to see how to use the library to build a bot.
The example shows off a variety of Silverback's features and functionality,
and you can learn more about this in the [development guide](https://docs.apeworx.io/silverback/stable/userguides/development).

### Running Locally

Download the example to `bots/example.py`.

```{note}
The example makes use of the [Ape Tokens](https://github.com/ApeWorX/ape-tokens) plugin.
Be sure to properly configure your environment for the USDC and YFI tokens on Ethereum mainnet.
```

To run this bot against a live network, this SDK includes a simple command you can use as follows:

```sh
silverback run example --network :mainnet:alchemy
```

### Running from a Container

Silverback makes it really easy to containerize your bots in order to run them inside of a container orchestrator.
This makes running our example even easier, all you need is `docker` (or `podman`) installed and then you can run via:

```sh
$ docker run -it ghcr.io/apeworx/silverback-example:latest -- run --network :mainnet
```

```{note}
The base silverback image we publish uses Python 3.11 for it's runtime.
Make sure all your packages are installable using this version.
```

For convienence, we offer the [Silverback Platform](https://silverback.apeworx.io),
which is a hosted service that allows you to run many of your bots concurrently on different blockchain networks.

## Development

This project is under active development to match the capabilities of the
[Silverback Platform](https://silverback.apeworx.io).
Things might not be in their final state and breaking changes may occur in minor revisions.
Comments, questions, criticisms and pull requests are welcomed.

See [Contributing](https://github.com/ApeWorX/silverback?tab=contributing-ov-file) for more information.
