Sync okx, binance, bybit, kucoin, bitget, htx, gateio klines and funding rate related functions output format
Sync function
This issue will ensure the above exchange will have the following function and input and output format will consistent with the following format.
get_current_candlestick
input format
{
"instrument_id": "BTC/USDT:USDT-PERP", // required
"interval": "1m", // required, vary from different exchanges
}
output format
{
"timestamp": 1629350400000, // timestamp in millisecond
"interval": "1m",
"instrument_id": "BTC/USDT:USDT-PERP",
"market_type": "perp", // "spot", "futures", "perp
"open": 10000.0, // open price
"high": 10100, // high price
"low": 9900, // low price
"close": 10050, // close price
"base_volume": 1000, // volume in base currency
"quote_volume": 10000000, // quote volume
"contract_volume": 1000, // contract volume
"raw_data": {} // raw data from exchange
}
get_history_candlesticks
input format
{
"instrument_id": "BTC/USDT:USDT-PERP", // required
"interval": "1m", // required, vary from different exchanges
"start": 1629350400000, // optional, timestamp in millisecond
"end": 1629350400000, // optional, timestamp in millisecond
"num": 100, // optional, number of data to return
}
output format
[
{
"timestamp": 1629350400000, // timestamp in millisecond
"interval": "1m",
"instrument_id": "BTC/USDT:USDT-PERP",
"market_type": "perp", // "spot", "futures", "perp
"open": 10000.0, // open price
"high": 10100, // high price
"low": 9900, // low price
"close": 10050, // close price
"base_volume": 1000, // volume in base currency
"quote_volume": 10000000, // quote volume
"contract_volume": 1000, // contract volume, if is spot then will equal to base_volume
"raw_data": {} // raw data from exchange
},
// many history candlesticks data
]
get_current_funding_rate
input format
{
"instrument_id": "BTC/USDT:USDT-PERP", // required, funding rate only support futures and perp
}
output format
{
"BTC/USDT:USDT-PERP": {
"timestamp": 1629350400000, // timestamp in millisecond
"next_funding_time": 1629350400000, // timestamp in milliseconds
"instrument_id": "BTC/USDT:USDT-PERP",
"market_type": "perp",
"funding_rate": 0.001, // funding rate in percentage, 0.01 means 1%
"raw_data": {} // raw data from exchange
}
}
get_history_funding_rate
input format
{
"instrument_id": "BTC/USDT:USDT-PERP", // required, funding rate only support futures and perp
"start": 1629350400000, // optional, timestamp in millisecond
"end": 1629350400000, // optional, timestamp in millisecond
"num": 100, // optional, number of data to return
}
(start, end) or num must be provided, if both provided, use start and end.
output format
[
{
"timestamp": 1629350400000, // timestamp in millisecond
"instrument_id": "BTC/USDT:USDT-PERP",
"market_type": "perp",
"funding_rate": 0.001, // funding rate in percentage, 0.01 means 1%
"realized_rate": 0.001, // realized rate in percentage, 0.01 means 1%
"raw_data": {} // raw data from exchange
}, // many history funding rate data
]
Issue purpose:
Sync
okx
,binance
,bybit
,kucoin
,bitget
,htx
,gateio
klines and funding rate related functions output formatSync function
This issue will ensure the above exchange will have the following function and input and output format will consistent with the following format.
get_current_candlestick
get_history_candlesticks
get_current_funding_rate
get_history_funding_rate
(
start
,end
) ornum
must be provided, if both provided, use start and end.Issue Progress
get_current_candlestick
okx
binance
bybit
kucoin
bitget
htx
gateio
get_history_candlesticks
okx
binance
bybit
kucoin
bitget
htx
gateio
get_current_funding_rate
okx
binance
bybit
kucoin
bitget
htx
gateio
get_history_funding_rate
okx
binance
bybit
kucoin
bitget
htx
gateio