question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

fundingRate, previousFundingRate and nextFundingRate

See original GitHub issue

related: 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:closed
  • Created 2 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
zsyhcommented, Jan 17, 2022

I made a graph to explain this. Suppose that the exchange charges the funding rate every 8 hours.

previousFundingRate                  fundingRate                              nextFundingRate
-------------------------current-------------------- UTC00:00(fundingTime)------------------------UTC08:00(nextFundingTime)
0reactions
zsyhcommented, Jan 17, 2022

@kroitor Thank you very much!

That is not true, huobi, gateio, aax all provide the previousFundingRate as well as the current rate in the same response

@frosty00 Actually, you called huobi, gateio, aax’s previousFundingRate, in my definition, it is fundingRate. We distinguish fundingRate and previousFundingRate by if user has been charged. In the current ccxt implementation, the meaning of huobi, gateio, aax’s previousFundingRate and ftx’s nextFundingRate is the same, representing the fundingRate that will be charged in the next 1-8hours.

fundingRate means the fundingRate that will be charged in the next 1-8hours(or according to the exchange settings). fundingRate should never be None.

Read more comments on GitHub >

github_iconTop Results From Across the Web

What is a funding rate? - Medium
The final Funding Rate is calculated based on the initial Funding Rate, previous Funding Rate (T-1), Initial Margin, and Maintenance Margin ...
Read more >
Crypto Futures Funding Rate Arbitrage - Binance
Previous Funding Rate. 0.0094%. Next Funding Rate. NaN%. Spread Rate. 0.0000%. Daily/Yearly Interest (Borrowable). 0.005699% / 2.08 %. Open Interest (Cont).
Read more >
What is a funding rate? | Polopedia - Poloniex
The final Funding Rate is calculated based on the initial Funding Rate, previous Funding Rate (T-1), Initial Margin, and Maintenance Margin ...
Read more >
Exchanges — ccxt 2.4.71 documentation
Returns. a dictionary of funding rate structures indexed by market symbols ... nextFundingDatetime: undefined, previousFundingRate: undefined, ...
Read more >
Funding Rates For Perpetual Swaps - Coinglass
Negative funding rates suggests speculators are bearish and short traders pay funding to long traders.Click Exchange to sort ,Click on the funding rate...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found