GitXplorerGitXplorer
E

BinanceWatch

public
7 stars
3 forks
0 issues

Commits

List of commits on branch master.
Verified
7adbcf87b3fa81c02c182a63b50401bca152a052

Merge pull request #47 from EtWnn/develop

EEtWnn committed 4 years ago
Verified
fe8e17623542120c909aac3bb5f8fe98470b7195

bump to version 0.1.4 (#46)

EEtWnn committed 4 years ago
Verified
7be5da92205ab1df7e386aed743c10622bf40376

Margin tables (#45)

EEtWnn committed 4 years ago
Verified
e475f7b5963bdee296fe419bd13e37ccae486574

bump to version 0.1.4dev (#44)

EEtWnn committed 4 years ago
Verified
c7d6dddb94feb3c8019e1b846502125fff0fc959

Merge pull request #43 from EtWnn/develop

EEtWnn committed 4 years ago
Verified
f81b859e1c6e01e66d66dc044b1462db6614a8ae

bump version to 0.1.3 (#42)

EEtWnn committed 4 years ago

README

The README file for this repository.

=================================== Welcome to BinanceWatch v0.1.4

Note

This library is under development by EtWnn, feel free to drop your suggestions or remarks in the discussion tab of the git repo. You are also welcome to contribute by submitting PRs.

This is an unofficial tracker for binance accounts. I am in no way affiliated with Binance, use at your own risk.

Source Code: https://github.com/EtWnn/BinanceWatch Documentation: https://binancewatch.readthedocs.io

Features

If you used quite intensively Binance, it can take some time to retrieve everything that happened on your account. This library is made to save locally the events of your account so that you don't need to fetch your history from the beginning every time.

It currently supports:

  • Spot Trades

  • Spot Crypto Deposits

  • Spot Crypto Withdraws

  • Spot Dividends

  • Spot Dusts

  • Universal Transfers

  • Lending Purchases

  • Lending Interests

  • Lending Redemptions

  • Cross Margin Trades

  • Cross Margin Repayment

  • Cross Margin Loans

  • Cross Margin Interests

  • Isolated Margin Trades

  • Isolated Margin Repayment

  • Isolated Margin Loans

  • Isolated Margin Interests

  • Isolated Margin Transfers *

*: see Known Issues section below.

Quick Tour

Generate an API Key <https://www.binance.com/en/my/settings/api-management>_ in your binance account. Only read permissions are needed.

BinanceWatch is available on PYPI <https://pypi.org/project/BinanceWatch/>_, install with pip:

.. code:: bash

pip install BinanceWatch

If you prefer to install the latest developments use:

.. code:: bash

pip install git+https://github.com/EtWnn/BinanceWatch.git@develop

Use your Binance api keys to initiate the manager:

.. code:: python

from BinanceWatch.BinanceManager import BinanceManager

api_key = "<API_KEY>"
api_secret = "<API_SECRET>"

bm = BinanceManager(api_key, api_secret)

# fetch the latest spot trades from Binance
bm.update_all_spot_trades()

.. code:: bash

Out -> fetching BIFIBUSD: 100%|██████████████████████| 1349/1349 [06:24<00:00,  3.51it/s]

.. code:: python

from datetime import datetime
from BinanceWatch.utils.time_utils import datetime_to_millistamp


start_time = datetime_to_millistamp(datetime(2018,1,1))

# get the locally saved spot trades made after 2018/01/01
spot_trades = bm.db.get_trades('spot', start_time=start_time)

You can also call update functions at an account-type level, and it will call every update methods related to this account-type:

.. code:: python

bm.update_spot()  # (trades, transfers, deposits ...)

bm.update_cross_margin()  # (trades, loans, repays, interests...)

bm.update_lending()  # (purchases, interests, redemptions..)

Donation

If this library has helped you in any way, feel free to donate:

  • BTC: 14ou4fMYoMVYbWEKnhADPJUNVytWQWx9HG
  • ETH: 0xfb0ebcf8224ce561bfb06a56c3b9a43e1a4d1be2
  • LTC: LfHgc969RFUjnmyLn41SRDvmT146jUg9tE
  • EGLD: erd1qk98xm2hgztvmq6s4jwtk06g6laattewp6vh20z393drzy5zzfrq0gaefh

Known Issues:

Some endpoints are not yet provided by Binance, so they can't be implemented in this library:

  • Fiat withdraws and deposits
  • Locked stacking history
  • Direct purchases with debit card
  • Some isolated margin transfers are not picked up by the API, the reason is unknown at the moment (I am looking for testers)