Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Kraken fetch_funding_rates needs to be capped between -0.02/0.02 #27109

@lucasjamar

Description

@lucasjamar

Operating System

Windows

Programming Language

Python

CCXT Version

4.5.8

Description

Kraken caps the funding rate at +/- 0.25% / hour (2% per 8 hour) but it is not done in fetch_funding_rates.
Currently, krakenfutures fetch_funding_rate does fundingRate*8/markPrice but this leads to huge values at time (50%). We need to add a capping between -0.02 and 0.02.

ex = ccxt.krakenfutures()
ex = CCXTPandasExchange(ex=ex)
markets = ex.load_markets().query("type == 'swap'")
funding_rates = ex.fetch_funding_rates(symbols=markets["symbol"].tolist())
print(funding_rates.query("~(-0.02 < fundingRate <0.02)"))

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions