kanekoshoyu / kucoin_arbitrage

KuCoin Cyclic Arbitrage, using Event-Driven Async Rust
https://docs.rs/kucoin_arbitrage
MIT License
124 stars 14 forks source link

digit arithmetics #39

Open kanekoshoyu opened 9 months ago

kanekoshoyu commented 9 months ago
[2023-10-28 15:01:18][INFO][kucoin_arbitrage::broker::gatekeeper::kucoin] All Taker Chance found!
[2023-10-28 15:01:18][INFO][kucoin_arbitrage::broker::gatekeeper::kucoin] TriangularArbitrageChance { profit: OrderedFloat(0.0004159016320031128), actions: [ActionInfo { Buy LINK-USDT at 11.1751 for 4.474200000000001}, ActionInfo { Sell LINK-BTC at 0.00032844 for 4.4697000000000005}, ActionInfo { Sell BTC-USDT at 34127.8 for 0.00146656}] }
[2023-10-28 15:01:18][ERROR][kucoin_arbitrage::broker::order::kucoin] Invalid order size increment LimitOrder { id: "78570f60-1db6-4f81-ad08-3b56633c7b2a", order_type: Limit, side: Buy, symbol: "LINK-USDT", amount: "4.474200000000001", price: "11.1751" }
kanekoshoyu commented 9 months ago

find a way we can either format or store these atihtmetics properly.

kanekoshoyu commented 9 months ago

Buy LINK-USDT at 11.1751 for 4.474200000000001, Sell LINK-BTC at 0.00032844 for 4.4697000000000005 Sell BTC-USDT at 34127.8 for 0.00146656 round to 9dp with format!("{:.9}") to see if we can place order with API first