Skip to content

Latest commit

 

History

History
74 lines (62 loc) · 3.37 KB

README.md

File metadata and controls

74 lines (62 loc) · 3.37 KB

Python Code Checks(Ruff)Security Check(Bandit)PyTest

client-python-async

Power Trade client for receiving market data updates via async (websocket) channel

Getting Started

  • 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, ...)

API Endpoints

List of tradeable entities

REST Url: https://api.rest.prod.power.trade/v1/market_data/tradeable_entity/all/summary

Tradeable Entity

Top of Book

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

Top of Book data structure

Last Traded Price

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

Reference Price

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

Reference Price data structure