types: add IsUSDFiatCurrency helper

This commit is contained in:
c9s 2022-08-05 18:42:04 +08:00
parent 99121d19c0
commit dce64871e8
No known key found for this signature in database
GPG Key ID: 7385E7E464CB0A54

View File

@ -1,10 +1,12 @@
package types
import "math/big"
import (
"math/big"
import "github.com/leekchan/accounting"
"github.com/leekchan/accounting"
import "github.com/c9s/bbgo/pkg/fixedpoint"
"github.com/c9s/bbgo/pkg/fixedpoint"
)
type Acc = accounting.Accounting
@ -24,6 +26,17 @@ var BNB = wrapper{accounting.Accounting{Symbol: "BNB ", Precision: 4}}
var FiatCurrencies = []string{"USDC", "USDT", "USD", "TWD", "EUR", "GBP", "BUSD"}
var USDFiatCurrencies = []string{"USDT", "USDC", "USD", "BUSD"}
func IsUSDFiatCurrency(currency string) bool {
for _, c := range USDFiatCurrencies {
if c == currency {
return true
}
}
return false
}
func IsFiatCurrency(currency string) bool {
for _, c := range FiatCurrencies {
if c == currency {