Git Product home page Git Product logo

exc's Introduction

exc's People

Contributors

nouzan avatar rise0chen avatar

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

exc's Issues

Sometimes `QueryLastCandles` takes a long time (2m 11s)

impl<C, Req> Exchange<C, Req>
where
    Exc<C, Req>: ExcService<QueryLastCandles>,
{
    pub async fn get_price(&mut self, period: Period, num: usize) -> anyhow::Result<Vec<Decimal>> {
        let range = ..;
        let req = QueryLastCandles::new(&self.inst, period, range, num);
        let sub = (&mut self.public_exc).oneshot(req).await?;
        let data = sub.filter_map(|x| async { x.ok().map(|x|x.close) }).collect().await;
        Ok(data)
    }
}

Sometimes it takes a long time(2m 11s), but in most cases it only takes a short time(0.7s).

Do you know what causes it to take a long time?

Why delete `FetchLastCandlesService` in main branches

I want to wrap the interface, like this:

impl<C, Req> Exchange<C, Req>
where
    Exc<C, Req>: FetchCandlesService,
{
}

but, OKX not implement FetchCandlesService.
OKX had implement QueryLastCandles, but I can't find FetchLastCandlesService in main branches.

Cex Extends Api Scalability Suggestions

In addition to the general method, can you refer to the project Position to implement a comm utils lib for cex extends api request .
With it , we can use uniform parameters,such as uri and payload to implement method quickly.For example, sometime we need to transfer funds between sub-accounts.

Although I may be a little ambiguous, this is a good idea. It can help users quickly connect to non-core interfaces

into_fetch_candles_forward method not found

examples/examples
├── binance_candle.rs
├── binance_rate_limit.rs
├── box_exc_service.rs

These three files have the same error:

error[E0599]: no method named into_fetch_candles_forward found for struct Exc in the current scope
--> examples/examples/binance_rate_limit.rs:11:10
|
8 | let mut binance = Binance::usd_margin_futures()
| ______________-
9 | | .connect_exc()
10 | | .into_rate_limited(70, Duration::from_secs(60))
11 | | .into_fetch_candles_forward(1500);
| | -^^^^^^^^^^^^^^^^^^^^^^^^^^ method not found in Exc<RateLimit<IntoService<Binance, Request>>, Request>
| |
|
|

--> examples/examples/box_exc_service.rs:42:46
|
42 | candle: Box::new(binance.clone().into_fetch_candles_forward(1000)),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ method not found in Exc<Binance, Request>

Advice from a pragmatist

Preamble, I think this project does a really good job of abstracting the exchange interface, and I've been doing some promotion these days
image
However, from my previous long-term experience, the current demo way may not be enough.Sometimes it is necessary to implement a simple strategy based on a single transaction.
For example, many times the use of multiple exchanges and multiple accounts is very common. I need to dynamically add, enable, or disable accounts through ws, rpc, http, or even just listening for configuration file changes.
I have been using java to implement trading systems and am now switching to rust,Below are some of my current plans.
image
image
Hope to progress with you,HiHi.

Known bugs in `v0.5.2-rc.2`

  • OKX: the generated client id is too long.
  • OKX: instrument meta deserialization is not fully support in testing environment

Provide the `reconnect` request

By providing the reconnect request, the higher level system can reset the whole connection actively in the buggy cases that have not yet been considered by exc.

Make box service work

Problem
It would be great if we can do this:

struct Exchange {
    ticker: Box<dyn SubscribeTickersService>,
}

But for now, it requires the user to specify the associated type Future, which is difficult.

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.