2024-09-09 06:41:27 +00:00
|
|
|
package testhelper
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
|
|
|
|
"github.com/c9s/bbgo/pkg/fixedpoint"
|
|
|
|
"github.com/c9s/bbgo/pkg/types"
|
|
|
|
)
|
|
|
|
|
2024-10-04 11:45:07 +00:00
|
|
|
var _markets = types.MarketMap{
|
2024-09-09 06:41:27 +00:00
|
|
|
"BTCUSDT": {
|
|
|
|
Symbol: "BTCUSDT",
|
|
|
|
PricePrecision: 2,
|
|
|
|
VolumePrecision: 8,
|
|
|
|
QuoteCurrency: "USDT",
|
|
|
|
BaseCurrency: "BTC",
|
2024-10-04 11:45:07 +00:00
|
|
|
MinNotional: fixedpoint.MustNewFromString("10.0"),
|
2024-09-09 06:41:27 +00:00
|
|
|
MinAmount: fixedpoint.MustNewFromString("10.0"),
|
|
|
|
MinQuantity: fixedpoint.MustNewFromString("0.001"),
|
|
|
|
TickSize: fixedpoint.MustNewFromString("0.01"),
|
|
|
|
},
|
|
|
|
|
|
|
|
"ETHUSDT": {
|
2024-10-04 11:45:07 +00:00
|
|
|
Symbol: "ETHUSDT",
|
2024-09-09 06:41:27 +00:00
|
|
|
PricePrecision: 2,
|
|
|
|
VolumePrecision: 8,
|
|
|
|
QuoteCurrency: "USDT",
|
|
|
|
BaseCurrency: "ETH",
|
2024-10-04 11:45:07 +00:00
|
|
|
MinNotional: fixedpoint.MustNewFromString("10.0"),
|
2024-09-09 06:41:27 +00:00
|
|
|
MinAmount: fixedpoint.MustNewFromString("10.0"),
|
|
|
|
MinQuantity: fixedpoint.MustNewFromString("0.001"),
|
|
|
|
TickSize: fixedpoint.MustNewFromString("0.01"),
|
|
|
|
},
|
2024-10-04 11:45:07 +00:00
|
|
|
|
|
|
|
"USDCUSDT": {
|
|
|
|
Symbol: "USDCUSDT",
|
|
|
|
PricePrecision: 5,
|
|
|
|
VolumePrecision: 2,
|
|
|
|
QuoteCurrency: "USDT",
|
|
|
|
BaseCurrency: "USDC",
|
|
|
|
MinNotional: fixedpoint.MustNewFromString("10.0"),
|
|
|
|
MinAmount: fixedpoint.MustNewFromString("10.0"),
|
|
|
|
MinQuantity: fixedpoint.MustNewFromString("10.0"),
|
|
|
|
TickSize: fixedpoint.MustNewFromString("0.0001"),
|
|
|
|
},
|
|
|
|
|
|
|
|
"USDTTWD": {
|
|
|
|
Symbol: "USDTTWD",
|
|
|
|
PricePrecision: 2,
|
|
|
|
VolumePrecision: 1,
|
|
|
|
QuoteCurrency: "TWD",
|
|
|
|
BaseCurrency: "USDT",
|
|
|
|
MinNotional: fixedpoint.MustNewFromString("10.0"),
|
|
|
|
MinAmount: fixedpoint.MustNewFromString("10.0"),
|
|
|
|
MinQuantity: fixedpoint.MustNewFromString("10.0"),
|
|
|
|
TickSize: fixedpoint.MustNewFromString("0.01"),
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
func AllMarkets() types.MarketMap {
|
|
|
|
return _markets
|
2024-09-09 06:41:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func Market(symbol string) types.Market {
|
2024-10-04 11:45:07 +00:00
|
|
|
market, ok := _markets[symbol]
|
2024-09-09 06:41:27 +00:00
|
|
|
if !ok {
|
2024-10-04 11:45:07 +00:00
|
|
|
panic(fmt.Errorf("%s test market not found, valid markets: %+v", symbol, _markets))
|
2024-09-09 06:41:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return market
|
|
|
|
}
|