Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added premium index klines endpoint #222

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions binance/um_futures/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ def __init__(self, key=None, secret=None, **kwargs):
from binance.um_futures.market import klines
from binance.um_futures.market import continuous_klines
from binance.um_futures.market import index_price_klines
from binance.um_futures.market import premium_index_klines
from binance.um_futures.market import mark_price_klines
from binance.um_futures.market import mark_price
from binance.um_futures.market import funding_rate
Expand Down
22 changes: 22 additions & 0 deletions binance/um_futures/market.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,28 @@ def index_price_klines(self, pair: str, interval: str, **kwargs):
return self.query("/fapi/v1/indexPriceKlines", params)


def premium_index_klines(self, symbol: str, interval: str, **kwargs):
"""
|
| **Kline/Candlestick Data for the premium index of a pair.**
| *Klines are uniquely identified by their open time.*

:API endpoint: ``GET /fapi/v1/premiumIndexKlines``
:API doc: https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Premium-Index-Kline-Data

:parameter symbol: string; the trading symbol.
:parameter interval: string; the interval of kline, e.g 1m, 5m, 1h, 1d, etc. (see more in https://developers.binance.com/docs/derivatives/usds-margined-futures/common-definition)
:parameter limit: optional int; limit the results. Default 500, max 1000.
:parameter startTime: optional int
:parameter endTime: optional int
|
"""

check_required_parameters([[symbol, "symbol"], [interval, "interval"]])
params = {"symbol": symbol, "interval": interval, **kwargs}
return self.query("/fapi/v1/premiumIndexKlines", params)


def mark_price_klines(self, symbol: str, interval: str, **kwargs):
"""
|
Expand Down