Giter VIP home page Giter VIP logo

io.contek.invoker's Issues

Bybit linear open_interest should be Double

io.contek.invoker.bybitlinear.api.websocket.market.InstrumentInfoChannel.InstrumentInfo
fields
open_interest

and other volumetric values should be Double, otherwise you will see notional value change in one unit of base currency (1 Bitcoin for example), Contracts in linears are expressed in coin fractions (Satoshis for BTC)

For both Linear and Inverse prices prev_price_24h_e4 etc, should be in Double too, most of the contracts tick size is not equal to 1.

Thanks

Correct JDK version

The file .github/workflows/main.yml says, the project uses JDK 15.
The build.gradle file configures the sourceCompatibility and targetCompatibility to JDK 1.8.
Which version should be used to build the project?

I could build the project with JDK 17, but it caused a bunch of warnings.
I could also build the project with JDK 1.8, except for the module bybitlinear-api.

The JDK version should be aligned over all project files.

Inconsistent dependencies in okhttp

[com.squareup.okhttp3/okhttp "4.10.0"] -> [org.jetbrains.kotlin/kotlin-stdlib "1.6.20"] -> [org.jetbrains.kotlin/kotlin-stdlib-common "1.6.20"]

but also

[com.squareup.okhttp3/okhttp "4.10.0"] -> [com.squareup.okio/okio-jvm "3.0.0"] -> [org.jetbrains.kotlin/kotlin-stdlib-common "1.5.31"]

Solution:
Update https://github.com/square/okhttp once they release their new version

EDIT: They seem to intend to release 4.11 still: square/okhttp#7358

ConsumerState

RateLimitRule need to have option to set rate limited per hour or per minute, Bitmex websocket api allows 30 conncetions per hour, Rate limiter limits 20 per minute

 RateLimiter createRateLimiter(String key, double cushion) {
    return RateLimiter.of(
        Joiner.on('_').join(type, name, key),
        RateLimiterConfig.custom()
            .limitForPeriod((int) (maxPermits * (1d - cushion)))
            .limitRefreshPeriod(Duration.of(1, MINUTES))
            .build());
  }

If IOException is common Okio keeps reconnecting more than 20 times per hour, which leads to
429 Too Many Requests' following '403 Forbidden' following permaban of IP

I guess simply changing

.limitRefreshPeriod(Duration.of(1, MINUTES))

with

 .limitRefreshPeriod(resetPeriod)

Will do the trick?

Bitmex _Instrument missing fields

io.contek.invoker.bitmex.api.common._Instrument
missing few very important fields, without which is impossible to work with USDT instrument:

"underlyingToPositionMultiplier"
"underlyingToSettleMultiplier"
"quoteToSettleMultiplier"

api...

Thanks.

Primitives in response models

Some response models, e.g. for the Deribit API (package io.contek.invoker.deribit.api.common), use primitive datatypes like double, long, boolean, etc. instead of the classes Double, Long, Boolean, etc.

The problem with this is, that primitive datatypes in Java cannot be null. If a JSON response from an exchange doesn't contain a value, Gson sets default values. For numbers the default value is 0 (long, int) resp. 0.0 (double), for boolean it is false.

The actual problem with this behaviour is that after deserialization one cannot distinguish anymore if the exchange actually returned the value 0 or false, or if the response didn't contain the value.

The solution is simple, use classes instead of primitives. Classes can be checked for null.

This change also preserves backwards compatibility.

I'm willing to do the update and create a pull request, but I need some kind of a confirmation that this change is accepted, because it's plenty of work and I don't want to waste time if this change is not wanted.

Wrong endpoint path

Is this library still working? I was trying to launch example and noticed it uses wrong url for binance api request - I mean "dapi/v1/depth" - doesnt work but I can get right responce using api/v3/depth. Is it ok?

Where is the source code of v3.8.0?

On Maven Central one can find v3.8.0 from Mar 2024 of parts of the modules (bitmex, bybit, deribit, okx). The source code of this version (and every other after 3.6.19) is not available here on this GitHub repository.

Is the source code now maintained somewhere else? Why is it not available here?

ForceOrderEvent.Order wrong filed

Binance ws api ForceOrderEvent.Order both for linears and inverse has wrong field for liqudation price.
As per manual it should be public Double ap; instead of a.

I dont think its worth pr, so just reporting.

Gate.io support

Hello!
Could anyone please add support for gate.io exchange?
I tried forking and copy/paste from binance and started to fill in for the gate.io api but it just got really complicated since I don't fully understand all the layers of the library.

I would be most interested in the WebSocket API that can be found here: https://www.gate.io/docs/developers/apiv4/ws/en/#api-overview

Or if someone can help me setup a new module for gateio spot api, then I could start filling in the blanks.
Thank you!

Binance spot Order Book Ticker API returns an object instead of array

As described in the binance api doc, when symbol parameter provided the order book API will returns an object instead of an array:
https://binance-docs.github.io/apidocs/spot/en/#symbol-order-book-ticker

Therefore https://github.com/contek-io/io.contek.invoker/blob/master/binancespot-api/src/main/java/io/contek/invoker/binancespot/api/rest/market/GetTickerBookTicker.java will fail to execute, when user provide the Symbol parameter since Gson fail to convert the json string back to array.

Suggest fix would be separate the command into two where one for all symbols and one for single symbol...

Incorrect import

Hello

  1. The readme contains incorrect dependencies:
io.contek.invoker deribit-api 2.15.0

Correct is:

io.contek.invoker
invoker-deribit-api
2.15.0

  1. When I add Deribit dependency - I find error:
    java: cannot access io.contek.invoker.security.ApiKey
    class file for io.contek.invoker.security.ApiKey not found

Different between bybitliner and bybit

Hello,

I am starting to use this SDK to integrate ByBit APIs in my project. There is one small confusion, which one is the correct one to use :

  1. Bybit-api
  2. Bybitlinear-api

Thanks.

BigDecimal vs Double

This library looks promising, but why do you use Double instead of BigDecimal? Any plans on using BigDecimal?

你好

你好,能帮忙写个基于xchange的币安期货接口吗,那边只有现货的,有偿,微信676821842

Add Bybit V5 API

Bybit has added a new API version V5, that unifies all old APIs (Spot, Derivatives, Options).

https://bybit-exchange.github.io/docs/v5/upgrade-guide

It's already helpful that the old derivatives API module "bybit-api" was renamed to "bybitinverse-api".

A new API module "bybit-api" could be added, implementing the Bybit V5 API. This preserves backwards compatibility for everyone using the existing modules.

binancelinear WebSocketCommand should be public

These classes should be pulbic:
io.contek.invoker.binancelinear.api.websocket.market.combined.WebSocketCommand
io.contek.invoker.binancelinear.api.websocket.market.combined.WebSocketCommandConfirmation

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.