fundingRate, previousFundingRate and nextFundingRate
See original GitHub issuerelated: PR #10512 #10225
I think in the return data structure of fetchFundingRate api, should contain fundingRate
and nextFundingRate
, but not previousFundingRate
.
previousFundingRate
means the fundingRate that already been charged, this field should not be included in fetchFundingRate api.
fundingRate
means the fundingRate that will be charged in the next 1-8hours(or according to the exchange settings). fundingRate should never be None.
nextFundingRate
means the fundingRate that will be charged next time, after fundingRate being charged. Some exchanges don’t have this field, like ftx.
In the current ccxt implementation, previousFundingRate
is confused with fundingRate
. In the most exchanges’ ccxt implementation, previousFundingRate
should rename to fundingRate
. In ftx, nextFundingRate
should rename to fundingRate
. In okex, nextFundingRate
should rename to fundingRate
, and in okex, nextFundingRate
itself should be reimplemented.
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (7 by maintainers)
I made a graph to explain this. Suppose that the exchange charges the funding rate every 8 hours.
@kroitor Thank you very much!
@frosty00 Actually, you called huobi, gateio, aax’s
previousFundingRate
, in my definition, it isfundingRate
. We distinguishfundingRate
andpreviousFundingRate
by if user has been charged. In the current ccxt implementation, the meaning of huobi, gateio, aax’spreviousFundingRate
and ftx’snextFundingRate
is the same, representing the fundingRate that will be charged in the next 1-8hours.