Metadata-Version: 2.3
Name: express-relay
Version: 0.21.3
Summary: Utilities for searchers and protocols to interact with the Express Relay protocol.
License: Apache-2.0
Author: dourolabs
Requires-Python: >=3.11,<4.0
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Dist: anchorpy (>=0.20.1,<0.21.0)
Requires-Dist: argparse (>=1.4.0,<2.0.0)
Requires-Dist: eth_abi (>=5.2.0,<6.0.0)
Requires-Dist: eth_account (>=0.13.5,<0.14.0)
Requires-Dist: httpx (>=0.28.1,<0.29.0)
Requires-Dist: pydantic (>=2.10.6,<3.0.0)
Requires-Dist: solana (>=0.34.3,<0.35.0)
Requires-Dist: web3 (>=7.8.0,<8.0.0)
Requires-Dist: websockets (>=10.0,<11.0)
Description-Content-Type: text/markdown

# Express Relay Python SDK

Utility library for searchers and protocols to interact with the Express Relay API.

The SDK includes searcher-side utilities and protocol-side utilities. The searcher-side utilities include a basic Searcher client for connecting to the Express Relay server as well as an example SimpleSearcher class that provides a simple workflow for assessing and bidding on liquidation opportunities.

## Installation

### poetry

```
$ poetry add express-relay
```

## Development

You can use `anchorpy` to generate a Python client of the Express Relay program. `anchorpy` only works with anchor versions `>=0.29`, so you will need to use such a version. Building may fail due to backward incompatibility with anchor `0.29.0`, so you may have to use `anchor idl parse --file` to generate the IDL.

You can generate the Python client from the IDL via:

```bash
poetry run anchorpy client-gen express_relay/idl/idlExpressRelay.json express_relay/svm/generated/express_relay --program-id PytERJFhAKuNNuaiXkApLfWzwNwSNDACpigT3LwQfou
```

## Quickstart

To run the simple searcher script, navigate to `python/` and run the following command:

### Evm

```
$ poetry run python3 -m express_relay.searcher.examples.simple_searcher_evm \
--private-key <PRIVATE_KEY_HEX_STRING> \
--chain-id development \
--verbose \
--server-url https://per-staging.dourolabs.app/
```

This simple example runs a searcher that queries the Express Relay liquidation server for available liquidation
opportunities and naively submits a bid on each available opportunity.

### Svm

```
$ poetry run python3 -m express_relay.searcher.examples.simple_searcher_svm \
--endpoint-express-relay https://per-staging.dourolabs.app/ \
--chain-id development-solana \
--private-key-json-file <PATH_TO_JSON_FILE> \
--endpoint-svm https://api.mainnet-beta.solana.com \
--bid 10000000 # Bid amount in lamports
```

