danielliwd / binance_rs_test

2 stars 0 forks source link

Todo/Request #1

Open xiandong79 opened 6 months ago

xiandong79 commented 6 months ago
lijiachang commented 6 months ago

mark

danielliwd commented 5 months ago

https://github.com/danielliwd/binance_rs_async_test

lijiachang commented 5 months ago

https://github.com/matrix-tang/Futures-Spot-Arbitrage-Binance-V1

个人的一些看法,慢慢补充:

  1. 账户模式应该优化:当前的双腿下单是先买现货->现货划转到合约->卖合约的步骤,应该改为类似于OKX多币种保证金模式,使用batch create order接口下单,在一个API中同时下两单
  2. 多余的状态判断:单一条策略的处理流程中,每一步都要先进行MySQL查询,通过arb_strategy_ex的状态来推进策略的进行,这完全没有必要。
  3. 平仓风险:当策略需要平仓的时候,合约平仓没有使用【reduce only】模式。
  4. websocket连接不完善:没有处理交易所的ping/pong心跳; 还缺少了websocket断连重连机制。
xiandong79 commented 5 months ago

“使用batch create order接口下单,在一个API中同时下两单”

这想法不对。一定是maker 开仓,另一侧 taker 对冲掉,更厉害的团队是 双maker,那么包含一些价格趋势预测。 要考虑手续费的cost @lijiachang

xiandong79 commented 5 months ago

在这个 更高级的项目中 https://github.com/featherenvy/botvana

也有很多适合于 低延迟交易系统、行情系统的方案.

且 botnode/src/exchange/adapter.rs 能保证 统一的 interface (函数输入参数)可以适用到所有的交易所,是非常香的 adapter 或者 称作 wrapper


不过,我觉得 这种分布式(Deployment architecture)的理念还是太复杂了。 适合我们当前的 junior 开发能力,还是直接 callback 函数吧, 类似 aioquant python版本。

xiandong79 commented 5 months ago

https://github.com/crypto-crawler/crypto-crawler-rs

https://github.com/monomadic/cryptotrader-core

https://github.com/Nouzan/exc The abstraction layer of exchanges.

https://github.com/kanekoshoyu/kucoin_arbitrage 期待 类似 aioquant 那种多交易所包装好的 统一接口的 项目

https://github.com/ybangaru/arbitrage_trading_rust_bot 这个套利资金费率

lijiachang commented 5 months ago

https://github.com/crypto-crawler/crypto-crawler-rs 说到adapter模式,这个项目做的非常好,上层不用关心交易所的实现,使用common trait(接口)抽象,来让各个交易所各自的实现

我的能力还不能理解他的写法,但是明白他抽象的能力

lijiachang commented 5 months ago

https://github.com/Goodnessuc/cex-aggregator 是不是一个 很好的 统一的API interface @xiandong79 这个项目文件是空的呀,是我打开的方式不对吗😂

xiandong79 commented 5 months ago

https://github.com/Goodnessuc/cex-aggregator 是不是一个 很好的 统一的API interface @xiandong79 这个项目文件是空的呀,是我打开的方式不对吗😂

那就忽略它。