Skip to main content

Utilities for searchers and protocols to interact with the Express Relay protocol.

Project description

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 the old Anchor IDL standard. You will need to use anchor 0.29.0: make sure you modify anchor_version in Anchor.toml to 0.29.0 and run anchor idl parse --file to generate the IDL.

You can generate the Python client from the IDL via:

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

express_relay-0.28.0.tar.gz (40.5 kB view details)

Uploaded Source

Built Distribution

express_relay-0.28.0-py3-none-any.whl (74.1 kB view details)

Uploaded Python 3

File details

Details for the file express_relay-0.28.0.tar.gz.

File metadata

  • Download URL: express_relay-0.28.0.tar.gz
  • Upload date:
  • Size: 40.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.11.12 Linux/6.8.0-1027-azure

File hashes

Hashes for express_relay-0.28.0.tar.gz
Algorithm Hash digest
SHA256 23e96a5eafba959d158a3710263d010b8a36cda7e28ab6b2172652864627627f
MD5 eab7a6ef5c7446d88a4948398e2d78dc
BLAKE2b-256 f76349fb79b3223f2f32bb532949fdd814be2e1bb234ec0180636bad207ca363

See more details on using hashes here.

File details

Details for the file express_relay-0.28.0-py3-none-any.whl.

File metadata

  • Download URL: express_relay-0.28.0-py3-none-any.whl
  • Upload date:
  • Size: 74.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.11.12 Linux/6.8.0-1027-azure

File hashes

Hashes for express_relay-0.28.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8added87b4e696d65d380c2736563723b133e2bc7118f0cb21859258532ec640
MD5 87d7a9c65334588c2954c9a0a7f2d8ac
BLAKE2b-256 b31ad0f4c6d40cf441b0925f5225cbda07e7dff7fee304d0ba70c0f733d44947

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page