Skip to main content

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.

Download files

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

Source Distribution

exchanges_wrapper-2.1.51.tar.gz (59.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

exchanges_wrapper-2.1.51-py3-none-any.whl (66.7 kB view details)

Uploaded Python 3

File details

Details for the file exchanges_wrapper-2.1.51.tar.gz.

File metadata

  • Download URL: exchanges_wrapper-2.1.51.tar.gz
  • Upload date:
  • Size: 59.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.25

File hashes

Hashes for exchanges_wrapper-2.1.51.tar.gz
Algorithm Hash digest
SHA256 6df06aef8143412f66fa8f4c61ee16af55cdcb4763d73dcfeea1912c620126e5
MD5 6cb98fc60d1bdb2f3e82de28d1974f3d
BLAKE2b-256 08810f74ef0528ef1f58a2c0b1c85f508b7073d496d8cc1c78a1ac57f39a5630

See more details on using hashes here.

File details

Details for the file exchanges_wrapper-2.1.51-py3-none-any.whl.

File metadata

File hashes

Hashes for exchanges_wrapper-2.1.51-py3-none-any.whl
Algorithm Hash digest
SHA256 af1e21dae86fa9143d08f68896017b1c3c836dae16b66774d6ec614c559728ae
MD5 5c45e53ad2c968eb9c8f2d3cf5922bc3
BLAKE2b-256 dd14108dcef85ceeb2421358ea9952171185b7b76e9e5025048ec0850460f382

See more details on using hashes here.

Release history Release notifications | RSS feed

2.1.52

2 files

This release

2.1.51 This release

2 files

2.1.50.post1

2 files

2.1.49

2 files

2.1.48

2 files

2.1.47

2 files

2.1.46

2 files

2.1.45

2 files

2.1.43

2 files

2.1.42

2 files

2.1.41

2 files

2.1.40

2 files

2.1.37

2 files

2.1.36

2 files

2.1.35

2 files

2.1.34

2 files

2.1.33

2 files

2.1.32

2 files

2.1.31

2 files

2.1.30

2 files

2.1.29

2 files

2.1.28

2 files

2.1.27

2 files

2.1.26

2 files

2.1.25

2 files

2.1.24

2 files

2.1.23

2 files

2.1.22

2 files

2.1.20

2 files

2.1.19

2 files

2.1.18

2 files

2.1.17

2 files

2.1.16

2 files

2.1.15

2 files

2.1.13

2 files

2.1.12

2 files

2.1.11

2 files

2.1.10

2 files

2.1.9

2 files

2.1.8

2 files

2.1.7

2 files

2.1.6

2 files

2.1.5

2 files

2.1.3

2 files

2.1.2

2 files

2.1.0

2 files

2.0.1

2 files

2.0.0.post1

2 files

2.0.0

2 files

1.4.16

2 files

1.4.15

2 files

1.4.14

2 files

1.4.13

2 files

1.4.12

2 files

1.4.11.post1

2 files

1.4.11

2 files

1.4.10

2 files

1.4.9

2 files

1.4.8

2 files

1.4.7

2 files

1.4.6

2 files

1.4.5

2 files

1.4.4

2 files

1.4.3

2 files

1.4.2

2 files

1.4.1

2 files

1.4.0

2 files

1.3.7.post4

2 files

1.3.7.post3

2 files

1.3.7.post2

2 files

1.3.7.post1

2 files

1.3.7

2 files

1.3.6

2 files

1.3.4.post2

2 files

1.3.4.post1

2 files

1.3.4

2 files

1.3.3

2 files

1.3.2

2 files

1.3.1

2 files

1.3.0.post2

2 files

1.3.0.post1

2 files

1.3.0

2 files

1.2.10.post6

2 files

1.2.10.post5

2 files

1.2.10.post4

2 files

1.2.10.post3

2 files

1.2.10.post2

2 files

1.2.10

2 files

1.2.9.post2

2 files

1.2.9.post1

2 files

1.2.9

2 files

1.2.8

2 files

1.2.7.post7

2 files

1.2.7.post6

2 files

1.2.7.post5

2 files

1.2.7.post4

2 files

1.2.7.post3

2 files

1.2.7.post2

2 files

1.2.7.post1

2 files

1.2.7

2 files

1.2.6.post2

2 files

1.2.6

2 files

1.2.5.post3

2 files

1.2.5.post2

2 files

1.2.5.post1

2 files

1.2.5

2 files

1.2.4.post5

2 files

1.2.4

2 files

1.2.3

2 files

1.2.2

2 files

1.2.1

2 files

1.2.0

2 files

1.0.post2

2 files

1.0.post1

2 files

1.0.post0

2 files

1.0.0

2 files

Supported by

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