adshao / go-binance

A Go SDK for Binance API
MIT License
1.53k stars 677 forks source link

TRADE_LITE user-data WS event #612

Closed vlw closed 2 days ago

vlw commented 1 week ago

Binance introduced new event in userdata WS: https://www.binance.com/en/support/announcement/introducing-trade-lite-for-usd%E2%93%A2-m-futures-websocket-2024-09-03-f2809259702b46f7abdc9c97b977908f

https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Event-Trade-Lite

it's incompatible with our futures.WsUserDataEvent

type WsUserDataEvent struct {
    Event               UserDataEventType     `json:"e"`
    Time                int64                 `json:"E"`
    CrossWalletBalance  string                `json:"cw"`
    MarginCallPositions []WsPosition          `json:"p"`
    TransactionTime     int64                 `json:"T"`
    AccountUpdate       WsAccountUpdate       `json:"a"`
    OrderTradeUpdate    WsOrderTradeUpdate    `json:"o"`
    AccountConfigUpdate WsAccountConfigUpdate `json:"ac"`
}

json: cannot unmarshal string into Go struct field .p of type []futures.WsPosition

vlw commented 1 week ago

Previously all WS responses were compatible with each other, looks like a malformed API on Binance's part

xyq-c-cpp commented 1 week ago

Previously all WS responses were compatible with each other, looks like a malformed API on Binance's part

does that problem still occur? @vlw

vlw commented 1 week ago

does that problem still occur?

yes

xyq-c-cpp commented 1 week ago

does that problem still occur?

yes

okay, it's great if you can check what exactly happens and open a PR to fix this issue, if you have free time. @vlw