Documentation ¶
Index ¶
- Constants
- func Assets2TradingPair(baseAsset, quoteAsset string) (symbol string)
- func CalBigNotional(price, qty int64) *big.Int
- func CalBigNotionalInt64(price, qty int64) int64
- func CalcLotSize(price int64) int64
- func CalcPriceWMA(prices *utils.FixedSizeRing) int64
- func CalcTickSize(price int64) int64
- func IsExceedMaxNotional(price, qty int64) bool
- func IsMiniTokenTradingPair(symbol string) bool
- func IsUnderMinNotional(price, qty int64) bool
- func TradingPair2Assets(symbol string) (baseAsset, quoteAsset string, err error)
- func TradingPair2AssetsSafe(symbol string) (baseAsset, quoteAsset string)
Constants ¶
View Source
const DELIMITER = "_"
Variables ¶
This section is empty.
Functions ¶
func Assets2TradingPair ¶
func CalBigNotional ¶
func CalBigNotionalInt64 ¶
CalBigNotionalInt64() calculate the multiply value of notional based on price and qty both price and qty are in int64 with 1e8 as decimals TODO: here the floor divide is used. there may cause small residual.
func CalcLotSize ¶
func CalcPriceWMA ¶
func CalcPriceWMA(prices *utils.FixedSizeRing) int64
func CalcTickSize ¶
Price ≥1e9 ≥1e10 ≥1e11 ≥1e12 ≥1e13 ≥1e14 ≥1e15 ≥1e16 ≥1e17 TickSize 1e4 1e5 1e6 1e7 1e8 1e9 1e10 1e11 1e12 LotSize 1e4 1e3 1e2 1e1 1 1 1 1 1
func IsExceedMaxNotional ¶
IsExceedMaxNotional return the result that is the product of price and quantity exceeded max notional
func IsMiniTokenTradingPair ¶
func IsUnderMinNotional ¶
min notional is 1, so we need to ensure price * qty / 1e8 >= 1
func TradingPair2Assets ¶
func TradingPair2AssetsSafe ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.