diff --git a/src/ExchangeSharp/API/Exchanges/Coinbase/ExchangeCoinbaseAPI.cs b/src/ExchangeSharp/API/Exchanges/Coinbase/ExchangeCoinbaseAPI.cs index 8f255eb5..3e7c660a 100644 --- a/src/ExchangeSharp/API/Exchanges/Coinbase/ExchangeCoinbaseAPI.cs +++ b/src/ExchangeSharp/API/Exchanges/Coinbase/ExchangeCoinbaseAPI.cs @@ -652,6 +652,26 @@ protected override async Task> OnGetAmountsAvailable return amounts; } + protected override async Task> OnGetFeesAsync() + { + var symbols = await OnGetMarketSymbolsAsync(); + + Dictionary fees = new Dictionary(StringComparer.OrdinalIgnoreCase); + + JObject token = await MakeJsonRequestAsync("/fees", null, await GetNoncePayloadAsync(), "GET"); + /* + * We can chose between maker and taker fee, but currently ExchangeSharp only supports 1 fee rate per symbol. + * Here, we choose taker fee, which are usually higher + */ + decimal makerRate = token["taker_fee_rate"].Value(); //percentage between 0 and 1 + + fees = symbols + .Select(symbol => new KeyValuePair(symbol, makerRate)) + .ToDictionary(kvp => kvp.Key, kvp => kvp.Value); + + return fees; + } + protected override async Task OnWithdrawAsync(ExchangeWithdrawalRequest request) { var nonce = await GenerateNonceAsync();