Skip to main content
Yanked

This release has been yanked by its maintainers, and will be ignored by installers, except when explicitly specified.
Consider using release 2.2.7 instead.

Crypto exchanges API/WSS wrapper with grpc powered server

Binance, Bitfinex, Huobi, OKX, Bybit,

For SPOT markets


PyPI version DeepSource DeepSource sonarcloud Downloads


On Binance: now API key type Ed25519 is used instead of HMAC

From 2.1.34 must be updated exch_srv_cfg.toml from exchanges_wrapper/exch_srv_cfg.toml.template


exchanges-wrapper vs binance.py

The main difference is the development of the project for trading with many exchanges.

Next is adding a new module exchanges_wrapper/exch_srv.py as a multiplexer layer, providing simultaneous async interaction for many accounts and many trading pairs through one connection. It's powered by gRPC Remote Procedure Call framework.

Warning. Coverage of overridden binance.py packages is significant but not complete. Served methods describes into example/exch_client.py

Initial capabilities (inherited from binance.py)

  • Covers general endpoints (test connectivity and get exchange information's)
  • Covers market data endpoints
  • Covers Account endpoints (create and manage orders)
  • Covers user data stream (receive real time user updates)
  • Covers web socket streams (receive real time market updates)
  • Async support
  • Auto reconnect after exchanges API or network failure
  • Completely free and without limitations

Added Features

Extra exchanges implementation features

  • Binance REST API and WSS are accepted as basic, connection of other exchanges wrapped their API to Binance compatible
  • For other, some data cannot be obtained by directly calling one method, it is generated by a synthetic or calculation method
  • Some exchanges have not any testing or "paper trading" features, therefore, application development and testing is possible only at real bidding. First, run applications on the Binance Spot Test Network or (Bitfinex, OKX, Bybit) test account.

Get started

Prepare exchange account

Create account on Binance and get 10% discount on all trading fee

Create account on HTX

Create account on Bitfinex and get 6% rebate fee

Create account on OKX and will be in for the chance to earn up to 100 USDT

Create account on Bybit and get exclusive referral rewards

Also, you can start strategy on Hetzner cloud VPS only for 4.75 € per month

  • For test purpose log in at Binance Spot Test Network
  • Create API Key
  • After install and create environment specify api_key and api_secret in /home/ubuntu/.MartinBinance/config/exch_srv_cfg.toml

Install use PIP

To install just run the following command:

pip install exchanges-wrapper

After first install create environment by run exchanges-wrapper-init in terminal window.

The structure of the working directory will be created and the necessary files will be copied: For Ubuntu it will be here: home/user/.MartinBinance/

For upgrade to latest versions use:

pip install -U exchanges-wrapper

Start server

  • Run in terminal window
    exchanges-wrapper-init
    

and

exchanges-wrapper-srv
  • Use an example to study

Use Docker image

docker pull ghcr.io/dogstailfarmer/exchanges-wrapper:latest

First run

The structure of the working directory will be created and the necessary files will be copied: For Ubuntu it will be here: home/user/.MartinBinance/

docker run --rm --entrypoint /bin/sh exchanges-wrapper -c "cat ./exchanges_wrapper/__init__.py" > init.py && \
docker run --rm --entrypoint /bin/sh exchanges-wrapper -c "cat ./exchanges_wrapper/exch_srv_cfg.toml.template" > exch_srv_cfg.toml.template &&\
 python3 init.py && rm init.py && rm exch_srv_cfg.toml.template

Start server

docker run -itP \
 --mount type=bind,source=/home/ubuntu/.MartinBinance,target=/home/appuser/.MartinBinance \
 --network=host \
 --restart=always \
 --name=exchanges-wrapper \
 exchanges-wrapper

Documentations

  • Served methods and examples of their use are described at example/exch_client.py
  • For Protocol Buffers serializing structured data see exchanges_wrapper/proto/martin.proto

Donate

USDT (TRC20) TN8F3Dz8BU8VwECRh3LTKi7FrsU8eWfsZz

Powered by exchanges-wrapper

martin-binance

Free trading system for crypto exchanges SPOT markets. Adaptive customizable reverse grid strategy based on martingale.

Metadata

Release files for exchanges-wrapper 2.2.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for exchanges-wrapper 2.2.6
File Size Uploaded Provenance Actions
exchanges_wrapper-2.2.6.tar.gz 60.2 kB Without provenance Details for exchanges_wrapper-2.2.6.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for exchanges-wrapper 2.2.6
File Interpreter ABI Platform Actions
exchanges_wrapper-2.2.6-py3-none-any.whl Python 3 none any Details for exchanges_wrapper-2.2.6-py3-none-any.whl

Total release size: 127.0 kB

Release files / exchanges_wrapper-2.2.6.tar.gz

Download URL exchanges_wrapper-2.2.6.tar.gz
Size 60.2 kB
Tags Source
SHA-256 checksum
How to use checksums
1be640238b45a101177a215dccb955e57dce48463fbdbdd6f889de505ec9e7d6
BLAKE2b-256 checksum
How to use checksums
b130e3e1bfc9b76bdbf4cf394408f3c7f8391547be7915795198d37f2843ca91
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.25

Release files / exchanges_wrapper-2.2.6-py3-none-any.whl

Download URL exchanges_wrapper-2.2.6-py3-none-any.whl
Size 66.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
53c1ce3ae1971ca4dda6ebe884fdf06623a5e11c4b76cd80a5b790ba7a98528c
BLAKE2b-256 checksum
How to use checksums
450f288fb4f55d521aeeb95add1d1b3c880368a146270a9a260a6bf4e6aade1c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.25

Security for exchanges-wrapper 2.2.6

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page