Giter Site home page Giter Site logo

kucoin_rs's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

kucoin_rs's Issues

Use `thiserror` instead of `failure`

thiserror implements std::error::Error so that users don't have to depend on failure crate externally or this library doesn't have to re-export failure crate.

Another reason is thiserror has become a defacto crate for error handling in rust and hence might provide better interoperability with other crates

I'll send a PR if this sounds good to you

Trades placed from the web UI crash websocket

First off, just want to say amazing work on this.

I've discovered a bug where a websocket which is subscribed to WSTopic::TradeOrders crashes when an order is placed via the Kucoin website.

Here is the raw response message (with some private data xd out):

{
   "data":{
      "symbol":"VET-USDT",
      "orderType":"limit",
      "side":"buy",
      "orderTime":1607489362287360739,
      "size":"44",
      "orderId":"xxxxxxxxxxxxxxxxxxxxxxxx",
      "filledSize":"0",
      "price":"0.0161091",
      "type":"open",
      "remainSize":"44",
      "status":"open",
      "ts":1607489362287360739
   },
   "subject":"orderChange",
   "topic":"/spotMarket/tradeOrders",
   "channelType":"private",
   "type":"message",
   "userId":"xxxxxxxxxxxxxxxxxxxxxxxx"
}

The problem is that when the trade is placed from the web UI no clientOid is present. Deserialization fails with Error: Serde(Error("missing field `clientOid`", line: 1, column: 253)). Just to check, I placed an order via the API and confirmed that clientOid is in fact present.

I'm fairly new to Serde and Rust in general but I'll dig around and see if I can find a workable solution.

-d

Update for Tokio 1.x

The underlying libraries required for updating kucoin_rs to using tokio 1.x are:

The latter two have been updated to support it now, but haven't released those updates yet through cargo. Updating kucoin_rs would therefore require using a git link in Cargo.toml and I'm worried that could cause breaking issues in the future. So once the versions that include tokio 1.x support are published to Cargo, it will be integrated into kucoin_rs.

The only other necessary change will be replacing the deprecated tokio-tls with tokio-native-tls and adjusting a few types appropriately in ./src/kraken/websocket.rs.

I'm going to leave this open until the update is complete.

Crate name change

Crate name 'kucoin' seems to be available on crates.io. Would you like to rename this crate?

Repository name can remain the same to not clash with other language implementations

Websocket parse error for market orders

parse_message in websocket.rs fails when parsing a market fill with error Serde(Error("missing field `price`", line: 1, column: 336)). I placed the order from the web UI, but my guess is that this is an issue with match orders since there's no price associated with the order; only with the match.

Example JSON:

{
   "data":{
      "symbol":"VET-USDT",
      "orderType":"market",
      "side":"sell",
      "orderId":"5fdxxxxxxxxxxxxxxxxx",
      "liquidity":"taker",
      "type":"match",
      "orderTime":1608101947404986582,
      "size":"10",
      "filledSize":"10",
      "matchPrice":"0.0163897",
      "matchSize":"10",
      "tradeId":"5fdxxxxxxxxxxxxxxxxx",
      "remainSize":"0",
      "status":"match",
      "ts":1608101947404986582
   },
   "subject":"orderChange",
   "topic":"/spotMarket/tradeOrders",
   "channelType":"private",
   "type":"message",
   "userId":"xxxxxxxxxxxxxxxxx"
}

Why do you write the api with rust?

I noticed that you have write the kucoin api the node, and why do you rewrite it with rust? Just for fun or any necessity? And the performance of node is enough for high frequency trading?

Documentation uses a try_next method for KucoinWebsocket; which is not implemented.

I'm trying to get the websocket code excerpt in the documentation to work; however the following line is throwing an error:
while let Some(msg) = ws.try_next().await? {...

The rust analyzer is saying that there is no method named 'try_next', and after looking through the source, I don't see it either. I guess that I should call poll_next, but at the moment, I'm not sure what the context would be in this case.

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.