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:
Scott
2019-04-09 19:38:31 +10:00
committed by Adrian Gallagher
parent eeda97bbaf
commit e56fc26d93
83 changed files with 814 additions and 136 deletions

View File

@@ -31,41 +31,42 @@ const (
)
// FeeType custom type for calculating fees based on method
type FeeType string
// InternationalBankTransactionType custom type for calculating fees based on fiat transaction types
type InternationalBankTransactionType string
type FeeType uint8
// Const declarations for fee types
const (
BankFee FeeType = "bankFee"
InternationalBankDepositFee FeeType = "internationalBankDepositFee"
InternationalBankWithdrawalFee FeeType = "internationalBankWithdrawalFee"
CryptocurrencyTradeFee FeeType = "cryptocurrencyTradeFee"
CyptocurrencyDepositFee FeeType = "cyptocurrencyDepositFee"
CryptocurrencyWithdrawalFee FeeType = "cryptocurrencyWithdrawalFee"
BankFee FeeType = iota
InternationalBankDepositFee
InternationalBankWithdrawalFee
CryptocurrencyTradeFee
CyptocurrencyDepositFee
CryptocurrencyWithdrawalFee
OfflineTradeFee
)
// InternationalBankTransactionType custom type for calculating fees based on fiat transaction types
type InternationalBankTransactionType uint8
// Const declarations for international transaction types
const (
WireTransfer InternationalBankTransactionType = "wireTransfer"
PerfectMoney InternationalBankTransactionType = "perfectMoney"
Neteller InternationalBankTransactionType = "neteller"
AdvCash InternationalBankTransactionType = "advCash"
Payeer InternationalBankTransactionType = "payeer"
Skrill InternationalBankTransactionType = "skrill"
Simplex InternationalBankTransactionType = "simplex"
SEPA InternationalBankTransactionType = "sepa"
Swift InternationalBankTransactionType = "swift"
RapidTransfer InternationalBankTransactionType = "rapidTransfer"
MisterTangoSEPA InternationalBankTransactionType = "misterTangoSepa"
Qiwi InternationalBankTransactionType = "qiwi"
VisaMastercard InternationalBankTransactionType = "visaMastercard"
WebMoney InternationalBankTransactionType = "webMoney"
Capitalist InternationalBankTransactionType = "capitalist"
WesternUnion InternationalBankTransactionType = "westernUnion"
MoneyGram InternationalBankTransactionType = "moneyGram"
Contact InternationalBankTransactionType = "contact"
WireTransfer InternationalBankTransactionType = iota
PerfectMoney
Neteller
AdvCash
Payeer
Skrill
Simplex
SEPA
Swift
RapidTransfer
MisterTangoSEPA
Qiwi
VisaMastercard
WebMoney
Capitalist
WesternUnion
MoneyGram
Contact
)
// SubmitOrderResponse is what is returned after submitting an order to an
@@ -78,25 +79,22 @@ type SubmitOrderResponse struct {
// FeeBuilder is the type which holds all parameters required to calculate a fee
// for an exchange
type FeeBuilder struct {
FeeType FeeType
// Used for calculating crypto trading fees, deposits & withdrawals
Pair currency.Pair
IsMaker bool
// Fiat currency used for bank deposits & withdrawals
IsMaker bool
PurchasePrice float64
Amount float64
FeeType FeeType
FiatCurrency currency.Code
BankTransactionType InternationalBankTransactionType
// Used to multiply for fee calculations
PurchasePrice float64
Amount float64
Pair currency.Pair
}
// OrderCancellation type required when requesting to cancel an order
type OrderCancellation struct {
AccountID string
OrderID string
CurrencyPair currency.Pair
WalletAddress string
Side OrderSide
CurrencyPair currency.Pair
}
// WithdrawRequest used for wrapper crypto and FIAT withdraw methods