Package: exchanges-wrapper
Crypto exchanges API/WSS wrapper with grpc powered serverBinance, Bitfinex, Huobi, OKX, Bybit,For SPOT marketsFromv1.4.0must be updatedexch_srv_cfg.tomlexchanges-wrapper vs binance.pyThe main difference is the development of the project for trading with many exchanges.Next is adding a new moduleexchanges_wrapper/exch_srv.pyas a multiplexer layer, providing simultaneous async interaction for many accounts
and many trading pairs through one connection. It's powered bygRPCRemote Procedure Call framework.Warning. Coverage of overridden binance.py packages is significant but not complete.
Served methods describes intoexample/exch_client.pyInitial capabilities (inherited from binance.py)Covers general endpoints (test connectivity and get exchange information's)Covers market data endpointsCovers 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 supportAuto reconnect after exchanges API or network failureCompletely free and without limitationsAdded FeaturesMulti exchanges supportAdaptive algorithm to ensure maximum performance and avoid exceeding the rates limitsPassthrough loggingWSS keepaliveReuse session for new client sessionsUtilizing Websocket API (bidirectional) for the most commonly used methods:Binance ws-api/v3Bitfinex Websocket Authenticated Inputs v2OKX WS v5Extra exchanges implementation featuresBinance REST API and WSS are accepted as basic, connection of other exchanges wrapped their API to Binance compatibleFor other, some data cannot be obtained by directly calling one method, it is generated by a synthetic or calculation
methodSome exchanges have not any testing or "paper trading" features, therefore, application development and testing is possible only
at real bidding. First, run applications on theBinance Spot Test Networkor (Bitfinex, OKX, Bybit) test account.Get startedPrepare exchange accountCreate account onBinanceand get 10% discount on all trading feeCreate account onBitfinexand get 6% rebate feeCreate account onHUOBIand get 10% cashback on all trading feeCreate account onOKXand get Mystery Boxes worth up to $10,000Create account onBybitand get exclusive referral rewardsFor test purpose log in atBinance Spot Test NetworkCreate API KeyAfter install and create environment specify api_key and api_secret in/home/ubuntu/.MartinBinance/config/exch_srv_cfg.tomlInstall use PIPTo install just run the following command:pip install exchanges-wrapperAfter first install create environment by runexchanges-wrapper-initin 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-wrapperStart serverRun in terminal windowexchanges-wrapper-srvUse an example to studyCopyexample/ms_cfg.tomlto/home/ubuntu/.MartinBinance/config/and select (uncomment) desired exchange. Don't change exchange name.Runexample/exch_client.pyin other terminal windowUse Docker imagedocker pull ghcr.io/dogstailfarmer/exchanges-wrapper:latestFirst runThe 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.templateStart serverdocker run -itP \--mount type=bind,source=/home/ubuntu/.MartinBinance,target=/home/appuser/.MartinBinance \--network=host \--restart=always \--name=exchanges-wrapper \exchanges-wrapperDocumentationsServed methods and examples of their use are described atexample/exch_client.pyForProtocol Buffersserializing structured data seeproto/exchanges_wrapper/api.protoDonateUSDT(TRC20) TN8F3Dz8BU8VwECRh3LTKi7FrsU8eWfsZzPowered by exchanges-wrappermartin-binanceFree trading system for crypto exchanges SPOT markets. Adaptive customizable reverse grid strategy based on martingale.