burakoner / Bybit.Api

Bybit API Wrapper. Up-to-date, most-complete, well-organized, well-documented, easy-to-use, multi-task and multi-thread compatible Bybit Cryptocurrency Exchange Rest and Websocket Api Wrapper
MIT License
1 stars 0 forks source link

GetLinearTickersAsync() results in an error #1

Closed brightb1ue closed 1 year ago

brightb1ue commented 1 year ago

Deserialize JsonSerializationException: Error converting value {null} to type 'System.Decimal'. Path 'result.list[0].predictedDeliveryPrice', line 1, position 492. [Data only available in Trace LogLevel]

error occurs when calling the GetLinearTickersAsync() function.

burakoner commented 1 year ago

Checking..

burakoner commented 1 year ago

Fixed. Plesase check https://github.com/burakoner/Bybit.Api/commit/86600864ece1012bba322e3a1b1e468998410614 and https://www.nuget.org/packages/Bybit.Api/1.1.1

brightb1ue commented 1 year ago

@burakoner

{"symbol":"10000NFTUSDT","lastPrice":"0.003690","indexPrice":"0.003692","markPrice":"0.003692","prevPrice24h":"0.003665","price24hPcnt":"0.006821","highPrice24h":"0.003700","lowPrice24h":"0.003635","prevPrice1h":"0.003685","openInterest":"83657260","openInterestValue":"308862.60","turnover24h":"116621.9975","volume24h":"31803260.0000","fundingRate":"-0.000603","nextFundingTime":"1682784000000","predictedDeliveryPrice":"","basisRate":"","deliveryFeeRate":"","deliveryTime":"0","ask1Size":"1103300","bid1Price":"0.003685","ask1Price":"0.003695","bid1Size":"876700","basis":""}

same error occurs on 'basisRate'. it looks like it needs to be revised 'basisRate', 'deliveryFeeRate', 'basis' section that has null value

burakoner commented 1 year ago

Hi

I always do a deep inspection for all issues. When I look at Api docs for predictedDeliveryPrice, I released that documentation says "Predicated delivery price. It has value when 30 min before delivery". I missed this explanation while I was building this data model. But there is no extra information for other nulled properties.

The main problem is Bybit keep this values in string. So they can be empty as you wrote. I'm fixing them now. Despite I and other users tested too much, there will be issues like this.

Thank you for your feedback. Please check new version in 10 minutes.

DEvCohn commented 1 year ago

@burakoner

Hi, I've tried it, but it seem there's still an error.

Deserialize JsonSerializationException: Error converting value {null} to type 'System.Decimal'. Path 'result.list[46].fundingRate', line 1, position 26081. [Data only available in Trace LogLevel]

You'd better try 'Market.GetLinearTickersAsync()' function on the entire symbol without parameters and check if it's work.

burakoner commented 1 year ago

I've fixed it in my codes. There will be some extra updates according to bybit api updates. I'll release new version today. Thank you for feedback

burakoner commented 1 year ago

Please check these out

https://github.com/burakoner/Bybit.Api/commit/f6a08048dfb69ff3f74b9b9592367fb7efb272dc https://www.nuget.org/packages/Bybit.Api/1.1.3