aoki-h-jp / funding-rate-arbitrage

Funding rate arbitrage on cryptocurrency.
MIT License
143 stars 33 forks source link

Errors on Bybit, OKX, Gate #18

Open Chebakul opened 6 months ago

Chebakul commented 6 months ago

There are errors of this kind:

[22:32:58] ERROR    BTC/USDC:USDC-240405 is not perp.               frarb.py:51
                    ┌───── Traceback (most recent call last) ─────┐            
                    │ D:\Dwnld\pyProject\funding-rate-arbitrage-m │            
                    │ ain\funding_rate_arbitrage\frarb.py:49 in   │            
                    │ fetch_all_funding_rate                      │            
                    │                                             │            
                    │    46 │   │   fr_d = {}                     │            
                    │    47 │   │   for p in perp:                │            
                    │    48 │   │   │   try:                      │            
                    │ >  49 │   │   │   │   fr_d[p] = ex.fetch_fu │            
                    │    50 │   │   │   except ExchangeError:     │            
                    │    51 │   │   │   │   log.exception(f"{p} i │            
                    │    52 │   │   return fr_d                   │            
                    │                                             │            
                    │ D:\Dwnld\pyProject\funding-rate-arbitrage-m │            
                    │ ain\.venv\Lib\site-packages\ccxt\base\excha │            
                    │ nge.py:4798 in fetch_funding_rate           │            
                    │                                             │            
                    │   4795 │   │   │   symbol = market['symbol' │            
                    │   4796 │   │   │   if not market['contract' │            
                    │   4797 │   │   │   │   raise BadSymbol(self │            
                    │        only')                               │            
                    │ > 4798 │   │   │   rates = self.fetchFundin │            
                    │   4799 │   │   │   rate = self.safe_value(r │            
                    │   4800 │   │   │   if rate is None:         │            
                    │   4801 │   │   │   │   raise NullResponse(s │            
                    │        + symbol)                            │            
                    │                                             │            
                    │ D:\Dwnld\pyProject\funding-rate-arbitrage-m │            
                    │ ain\.venv\Lib\site-packages\ccxt\bybit.py:2 │            
                    │ 325 in fetch_funding_rates                  │            
                    │                                             │            
                    │   2322 │   │   type = None                  │            
                    │   2323 │   │   type, params = self.handle_m │            
                    │        params)                              │            
                    │   2324 │   │   if type != 'swap':           │            
                    │ > 2325 │   │   │   raise NotSupported(self. │            
                    │        + ' markets')                        │            
                    │   2326 │   │   else:                        │            
                    │   2327 │   │   │   subType = None           │            
                    │   2328 │   │   │   subType, params = self.h │            
                    │        market, params, 'linear')            │            
                    └─────────────────────────────────────────────┘            
                    NotSupported: bybit fetchFundingRates() does               
                    not support future markets

And on the OKX exchange:

ExchangeError: okx fetchFundingRate() is only              
                    valid for swap markets 

And on the GATE exchange

gate fetchFundingRate() supports                
                    swap contracts only 

I tried to figure it out myself, but my level of code writing is 0 :D

aoki-h-jp commented 6 months ago

@Chebakul Thanks for report! I'll check it.

WangRu222 commented 3 months ago

hello, I have faced the same question. May I ask is there any solution?