Files
bitfinex-api-py/examples/rest/get_positions_history.py
2023-01-26 17:58:18 +01:00

18 lines
396 B
Python

# python -c "import examples.rest.get_positions_history"
import os
import time
from bfxapi.client import Client, Constants
bfx = Client(
REST_HOST=Constants.REST_HOST,
API_KEY=os.getenv("BFX_API_KEY"),
API_SECRET=os.getenv("BFX_API_SECRET")
)
now = int(round(time.time() * 1000))
positions_history = bfx.rest.auth.get_position_history(end=now, limit=50)
print(positions_history)