Coder Social home page Coder Social logo

djnicholson / binance-statement Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 4.0 813 KB

Command line tool to generate financial statements for the trading activity within a Binance account.

License: GNU General Public License v3.0

JavaScript 83.41% HTML 9.08% CSS 7.51%

binance-statement's Introduction

binance-statement

A command-line tool and library to create pretty financial statements for an arbitrary Binance account.

Usage

A command-line tool and an API are provided.

In both cases a standalone HTML file is generated that can be used to view the statement in a web browser.

Command line

At a command prompt:

npm install -g binance-statement
binance-statement --help
binance-statement --api-key "FOO" --api-key "BAR" --output-file "statement.html"
open statement.html

API

At a command prompt:

npm install --save binance-statement

In a JavaScript file:

const makeStatement = require('binance-statement');
// ...
await makeStatement(
    apiKey, 
    apiSecret, 
    startMonth, 
    startYear, 
    outputFile, 
    dataFile, 
    cacheFile, 
    syncFillsFromBinance, 
    speed, 
    unitsOfAccount);

Example statement

Screen shot of an example statement

Tips

  • Run the script about once per day
    • Certain transactions (e.g. selling dust, receiving affiliate commission, receiving dividends/airdrops) are only detected by polling of your account balance. Running the command regularly ensures these events have an accurate date on your statement.
  • The first time may take a while
    • The first time you generate a statement, price history must be obtained for all assets you have held; this can take a while, especially if your account has a lot of historic activity. Price information is cached and subsequent invocations will be faster. You can speed up this process by specifying a more recent statement start date using the --start-month and --start-year command line parameters.
  • Binance may throttle your API requests
    • If you get throttled, use the --speed comaand line parameter to add a delay between Binance calls.

binance-statement's People

Contributors

djnicholson avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.