This is a set of scripts for analyzing trading history on the Bitshares DEX and thus for all exchanges running on top (RuDEX, Cryptobridge, Openledger, SparkDex etc).
Supported inventory accounting methods:
- FIFO (first-in/first-out)
- LIFO (last-in/first-out)
- LPFO (lowest-price/first-out)
- Install pipenv.
- Run the following code
pipenv install
- Prepare working environment using virtualenv (see above)
- Copy
common.yml.example
tocommon.yml
and change variables according to your needs - Run the scripts:
pipenv shell
./script.py
exit
Use ./download_history.py account_name
to get transfers and trading history. Export format is generic
ccGains format.
Features:
- History obtained from public elasticsearch wrapper node
- Trading history aggregated by price, e.g. if you had single order for example of buying 1000 BTS at 0.10 USD/BTS and
it was filled in small chunks of BTS, this feature will aggregate all these trades into single trade. Use
'--no-aggregate'
to disable - The script can continue previously exported data from the previous point, e.g. download fresh history and append it to the existing files
- Fixed-point math is used to maintain strict precision in records