From 3cbaf60060e92bc5148d27843297380f8a1327b5 Mon Sep 17 00:00:00 2001 From: Dmitriy Ugarov Date: Thu, 28 Jul 2022 19:46:05 +0300 Subject: [PATCH] Order fees added --- .../API/Exchanges/Bitstamp/ExchangeBitstampAPI.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/ExchangeSharp/API/Exchanges/Bitstamp/ExchangeBitstampAPI.cs b/src/ExchangeSharp/API/Exchanges/Bitstamp/ExchangeBitstampAPI.cs index b5d38a6f..596b8f22 100644 --- a/src/ExchangeSharp/API/Exchanges/Bitstamp/ExchangeBitstampAPI.cs +++ b/src/ExchangeSharp/API/Exchanges/Bitstamp/ExchangeBitstampAPI.cs @@ -286,7 +286,10 @@ protected override async Task OnGetOrderDetailsAsync(string } string _symbol = $"{baseCurrency}-{quoteCurrency}"; - decimal amountFilled = 0, spentQuoteCurrency = 0, price = 0; + decimal amountFilled = 0; + decimal spentQuoteCurrency = 0; + decimal price = 0; + decimal fees = 0; foreach (var t in transactions) { @@ -294,6 +297,7 @@ protected override async Task OnGetOrderDetailsAsync(string if (type != 2) { continue; } spentQuoteCurrency += t[quoteCurrency].ConvertInvariant(); amountFilled += t[baseCurrency].ConvertInvariant(); + fees += t["fee"].ConvertInvariant(); //set price only one time if (price == 0) { @@ -309,6 +313,8 @@ protected override async Task OnGetOrderDetailsAsync(string MarketSymbol = _symbol, AveragePrice = spentQuoteCurrency / amountFilled, Price = price, + Fees = fees, + FeesCurrency = quoteCurrency, Result = status, ResultCode = statusCode };