FTX Exchange API wrapper in python3
This is an UNOFFICIAL wrapper for FTX exchange HTTP API written in Python 3.7
The library can be used to fetch market data, make trades, place orders or create third-party clients
USE THIS WRAPPER AT YOUR OWN RISK, I WILL NOT CORRESPOND TO ANY LOSES
If useful, buy me a coffee?
$ git clone https://github.com/LeeChunHao2000/ftx-api-wrapper-python3
This is an introduction on how to get started with FTX client. First, make sure the FTX library is installed.
The next thing you need to do is import the library and get an instance of the client:
from FTX.client import Client
client = Client('PUY_MY_API_KEY_HERE', 'PUY_MY_API_SECRET_HERE')
>>> from FTX.client import Client
>>> client = Client('PUY_MY_API_KEY_HERE', 'PUY_MY_API_SECRET_HERE')
>>> result = client.get_public_orderbook('BTC/USD', 1)
>>> result
{'asks': [[10854.5, 11.856]], 'bids': [[10854.0, 0.4315]]}
>>> result['asks']
[[10854.5, 11.856]]
>>> result['bids']
[[10854.0, 0.4315]]
>>> import pandas as pd
>>> result = pd.DataFrame(client.get_private_account_positions())
>>> result = result.sort_values(by=['realizedPnl'], ascending=False)
>>> result
collateralUsed cost entryPrice ... side size unrealizedPnl
0 0.00000 0.000 NaN ... buy 0.00 0.0
49 0.00000 0.000 NaN ... buy 0.00 0.0
4 535.09500 2972.750 594.5500 ... buy 5.00 0.0
35 206.93750 2069.375 82.7750 ... buy 25.00 0.0
3 0.00000 0.000 NaN ... buy 0.00 0.0
5 152.28000 1522.800 2.5380 ... buy 600.00 0.0
Bugfixes
Features