forked from dwdwow/cex
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpair.go
40 lines (34 loc) · 1.24 KB
/
pair.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package cex
type PairType string
const (
PairTypeSpot PairType = "SPOT"
PairTypeFutures PairType = "FUTURES"
)
func NotPairType(t PairType) bool {
switch t {
case PairTypeSpot, PairTypeFutures:
return false
}
return true
}
type Pair struct {
// must be contained
Cex Name `json:"cex" bson:"cex"`
Type PairType `json:"type" bson:"type"`
Asset string `json:"asset" bson:"asset"`
Quote string `json:"quote" bson:"quote"`
PairSymbol string `json:"pairSymbol" bson:"pairSymbol"`
MidSymbol string `json:"midSymbol" bson:"midSymbol"`
QPrecision int `json:"qPrecision" bson:"qPrecision"`
PPrecision int `json:"pPrecision" bson:"pPrecision"`
// may be omitted
TakerFeeTier float64 `json:"takerFeeTier" bson:"takerFeeTier"`
MakerFeeTier float64 `json:"makerFeeTier" bson:"makerFeeTier"`
MinTradeQty float64 `json:"minTradeQty" bson:"minTradeQty"`
MinTradeQuote float64 `json:"minTradeQuote" bson:"minTradeQuote"`
Tradable bool `json:"tradable" bson:"tradable"`
CanMarket bool `json:"canMarket" bson:"canMarket"`
CanMargin bool `json:"canMargin" bson:"canMargin"`
IsCross bool `json:"isCross" bson:"isCross"`
IsPerpetual bool `json:"isPerpetual" bson:"isPerpetual"`
}