Power Trade client for receiving market data updates via async (websocket) channel
- Install Python (any version above 3.10)
- Install Python libraries used in client.py and other files
pip install -r requirements.txt
- Ensure the data & log folders exist in home/root directory
ls data
ls log
- Run the APi client
python client.py
- Monitor message processing using the log file in /data folder using current UTC data e.g. 'client.2024-10-09.log' for date 09-10-2024
tail -f log/client.20241009.log
- Adjust the endpoints in client.py to include/exclude data required. By default all 3 endpoints are listed.
endpoints = [
"wss://api.wss.prod.power.trade/v1/feeds?type[]=top_of_book"
"wss://api.wss.prod.power.trade/v1/feeds?type[]=reference_price",
"wss://api.wss.prod.power.trade/v1/feeds?type[]=last_trade_price"
]
- Run the python client using installed version of Python
python client.py
- Monitor message processing using the log file in /data folder using current UTC data e.g. 'client.2024-10-09.log' for date 09-10-2024
tail -f log/client.20241009.log
-
Adjust the endpoints to include/exclude data required. By default all 3 endpoints are listed.
See here for more details on configuring the target WS endspoints to filter product type (spot, perpertuals, options, ...) and message types (risk, top_of_book, ...)
REST Url: https://api.rest.prod.power.trade/v1/market_data/tradeable_entity/all/summary
Environment | URL |
---|---|
Test | wss://api.wss.test.power.trade/v1/feeds?type[]=top_of_book |
Production | wss://api.wss.prod.power.trade/v1/feeds?type[]=top_of_book |
Environment | URL |
---|---|
Test | wss://api.wss.test.power.trade/v1/feeds?type[]=last_trade_price |
Production | wss://api.wss.prod.power.trade/v1/feeds?type[]=last_trade_price |
Last Trade Price data structure
Environment | URL |
---|---|
Test | wss://api.wss.test.power.trade/v1/feeds?type[]=reference_price |
Production | wss://api.wss.prod.power.trade/v1/feeds?type[]=reference_price |