Command line interface to interact and trade with the B2C2 api
- command line interface
- request instruments available to trade
- request prices from api for given instrument
- e.g. BTCUSD
- side (buy/sell)
- quantity
- execute orders
- display total balance of the account
- ping to check if the connection is ok
- ledgers to get trade history
- get specific information about a trade
- error handling:
- sending an outdated quote
- HTTP error from the server
- losing internet connection
logging
- Python 3
- Pip
- Git
- B2C2 sandbox API token
- Whitelist client machine IP address
- Open command prompt (windows) or terminal (mac/linux)
- Navigate to a path for which to host project files e.g
cd C:\project
- Clone repo
git clone https://github.com/kulsuri/B2C2
- Navigate to the project folder e.g.
cd C:\project\B2C2
- Install required modules
pip install -r requirements.txt
Navigate to the project folder and run the command:
python app.py
- View tradable instruments
python app.py view-instruments
- Request a quote
python app.py request-for-quote
ENTER INSTRUMENT NAME e.g. BTCUSD
> ethgbp
ENTER THE SIDE OF THE TRADE (buy, sell):
> buy
ENTER QUANTITY
> 2.345
- Execute a quote (order)
EXECUTE THIS QUOTE? (Y/n)
> Y
- View trade history
python app.py trade-history
- View ledger
python app.py view-ledger
- View balance
python app.py view-balance
- Check the connection status
python app.py connection-status
- requests
- click
- uuid
- datetime
File | Technology | What Does It Do |
---|---|---|
app.py |
click | runs the app, handles the CLI and calls objects from the other files |
library.py |
requests | library of functions for interacting with the B2C2 API |
❌ TBC
❌ TBC
🔲 Interactive and dynamic front-end built with React
🔲 Improved error handling
🔲 Improved logging