mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-06-08 15:11:07 +00:00
Offline worst case trade fees (#274)
* Really basic getSimulated fee function everywhere * Worst case fees for all exchanges * Adds tests, fixes comment spacing. Adds wrapper logic. Makes test api key var name consistent. Removes some okcoin ETT tests * Removes redundant functions * linting issues. Fixes introduces huobi issues * More linting * Stops trying to hide ETT problems, uses iota * Skips ETT tests for now
This commit is contained in:
@@ -530,6 +530,8 @@ func (b *Bittrex) GetFee(feeBuilder *exchange.FeeBuilder) (float64, error) {
|
||||
fee = calculateTradingFee(feeBuilder.PurchasePrice, feeBuilder.Amount)
|
||||
case exchange.CryptocurrencyWithdrawalFee:
|
||||
fee, err = b.GetWithdrawalFee(feeBuilder.Pair.Base)
|
||||
case exchange.OfflineTradeFee:
|
||||
fee = calculateTradingFee(feeBuilder.PurchasePrice, feeBuilder.Amount)
|
||||
}
|
||||
if fee < 0 {
|
||||
fee = 0
|
||||
@@ -554,7 +556,7 @@ func (b *Bittrex) GetWithdrawalFee(c currency.Code) (float64, error) {
|
||||
}
|
||||
|
||||
// calculateTradingFee returns the fee for trading any currency on Bittrex
|
||||
func calculateTradingFee(purchasePrice, amount float64) float64 {
|
||||
var fee = 0.0025
|
||||
return fee * purchasePrice * amount
|
||||
func calculateTradingFee(price, amount float64) float64 {
|
||||
return 0.0025 * price * amount
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user