thrasher-corp / gocryptotrader

A cryptocurrency trading bot and framework supporting multiple exchanges written in Golang.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Binance spot] Wrong order status: PARTIALLY_FILLED instead of FILLED

ydm opened this issue · comments

What you can see here is a LIMIT order submitted and executed in a few seconds. Sadly the managed state of the order is absolutely wrong -- it says PARTIALLY_FILLED, when the order is actually FILLED.

$ gctcli submitorder --asset spot binance eth-usdt BUY LIMIT 0.02 2760.01
{
 "order_placed": true,
 "order_id": "5284042583"
}

$ gctcli getmanagedorders binance spot eth-usdt
{
 "orders": [
  {
   "exchange": "binance",
   "id": "5284042583",
   "base_currency": "ETH",
   "quote_currency": "USDT",
   "asset_type": "spot",
   "order_side": "BUY",
   "order_type": "LIMIT",
   "creation_time": 1628181191,
   "update_time": 1628181194,
   "status": "PARTIALLY_FILLED",
   "price": 2760.01,
   "amount": 0.02
  }
 ]
}

$ gctcli getorders binance spot eth-usdt
{}

$ gctcli getmanagedorders binance spot eth-usdt
{
 "orders": [
  {
   "exchange": "binance",
   "id": "5284042583",
   "base_currency": "ETH",
   "quote_currency": "USDT",
   "asset_type": "spot",
   "order_side": "BUY",
   "order_type": "LIMIT",
   "creation_time": 1628181191,
   "update_time": 1628181194,
   "status": "PARTIALLY_FILLED",
   "price": 2760.01,
   "amount": 0.02
  }
 ]
}

I started debugging this and it turns out the websocket yields the following two events through the ToRoutine channel:

ON SUBMISSION:
{false false false false 0 2772.2 0.02063 0 0 0 0 0 0.02063 0 0 Binance 5283881596 and_a1a0b07a18a243859d7070363a6cdc73 LIMIT BUY NEW spot 2021-08-05 19:17:28.108 +0300 EEST 0001-01-01 00:00:00 +0000 UTC 0001-01-01 00:00:00 +0000 UTC ETHUSDT []}

ON EXECUTION:
{false false false false 0 2772.2 0.02063 0 0 0 0 0.02063 0 0 0 Binance 5283881596 and_a1a0b07a18a243859d7070363a6cdc73 LIMIT BUY PARTIALLY_FILLED spot 2021-08-05 19:17:28.108 +0300 EEST 0001-01-01 00:00:00 +0000 UTC 0001-01-01 00:00:00 +0000 UTC ETHUSDT []}