parse QuoteQuantity

This commit is contained in:
c9s 2020-08-06 13:18:41 +08:00
parent 409332a56c
commit 887400eb83

View File

@ -15,8 +15,8 @@ import (
executionReport executionReport
{ {
"e": "executionReport", // KLineEvent type "e": "executionReport", // Event type
"E": 1499405658658, // KLineEvent time "E": 1499405658658, // Event time
"s": "ETHBTC", // Symbol "s": "ETHBTC", // Symbol
"c": "mUvoqJxFIILMdfAW5iGSOW", // Client order ID "c": "mUvoqJxFIILMdfAW5iGSOW", // Client order ID
"S": "BUY", // Side "S": "BUY", // Side
@ -79,6 +79,7 @@ type ExecutionReportEvent struct {
LastExecutedQuantity string `json:"l"` LastExecutedQuantity string `json:"l"`
CumulativeFilledQuantity string `json:"z"` CumulativeFilledQuantity string `json:"z"`
LastExecutedPrice string `json:"L"` LastExecutedPrice string `json:"L"`
LastQuoteAssetTransactedQuantity string `json:"Y"`
OrderCreationTime int `json:"O"` OrderCreationTime int `json:"O"`
} }
@ -94,6 +95,7 @@ func (e *ExecutionReportEvent) Trade() (*types.Trade, error) {
Symbol: e.Symbol, Symbol: e.Symbol,
Price: util.MustParseFloat(e.LastExecutedPrice), Price: util.MustParseFloat(e.LastExecutedPrice),
Quantity: util.MustParseFloat(e.LastExecutedQuantity), Quantity: util.MustParseFloat(e.LastExecutedQuantity),
QuoteQuantity: util.MustParseFloat(e.LastQuoteAssetTransactedQuantity),
Side: e.Side, Side: e.Side,
IsBuyer: e.Side == "BUY", IsBuyer: e.Side == "BUY",
IsMaker: e.IsMaker, IsMaker: e.IsMaker,