Documentation ¶
Index ¶
- func FetchHistoricalPrice(tokenSymbol string, timeStamp int64) (*big.Int, error)
- func GetCurrentHeight() (int64, error)
- func GetUniswapV2ROI(fromTokenName, toTokenName string, poolAddr common.Address) (*big.Int, *big.Int, error)
- func MinBigInt(a, b *big.Int) *big.Int
- func TokenDecimial(tokenSymbol string) *big.Int
- func TwoTokenWorth(token0Amount, token1Amount, token0Price, token1Price *big.Int, ...) *big.Int
- type ToUSDPrice
- type TokenPrice
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FetchHistoricalPrice ¶
FetchHistoricalPrice fetch token historical price (USD) * 10^6
func GetCurrentHeight ¶
GetCurrentHeight return current height of ethereum
func GetUniswapV2ROI ¶
func GetUniswapV2ROI(fromTokenName, toTokenName string, poolAddr common.Address) (*big.Int, *big.Int, error)
返回$ ROI & NET ROI 百分比,结果*10^6
func TokenDecimial ¶
TokenDecimial return token's decimial
when tokenDecimial is 10*6 will return: *big.NewInt(1000000)
Types ¶
type ToUSDPrice ¶
type ToUSDPrice struct {
USD float64 `json:"USD"`
}
type TokenPrice ¶
type TokenPrice struct {
TokenName ToUSDPrice `json:"tokenName"`
}
Click to show internal directories.
Click to hide internal directories.