Documentation ¶
Index ¶
Constants ¶
View Source
const ( DefaultLifeSpan = 30 * time.Second DefaultLifeSpanHalf = DefaultLifeSpan / 2 )
View Source
const ( DaemonNameSushiswapPools = "sushiswapPools" SushiswapGraphURI = "https://api.thegraph.com/subgraphs/name/zippoxer/sushiswap-subgraph-fork" )
View Source
const ( DaemonNameUniswapV2Pools = "uniswapV2Pools" UniswapV2GraphURI = "https://api.thegraph.com/subgraphs/name/uniswap/uniswap-v2" )
View Source
const ( DaemonNameTokenPriceBalancer = "tokenpriceBalancer" TokenPriceBalancerURI = "https://api.thegraph.com/subgraphs/name/balancer-labs/balancer" // #nosec G101 )
View Source
const (
DaemonNameBalancerPools = "balanerPools"
)
View Source
const (
DaemonNameMergedPoolInfos = "mergePoolInfos"
)
View Source
const (
DaemonNameTokenList = "tokenlist"
)
Variables ¶
This section is empty.
Functions ¶
func NewTokenPriceBalancer ¶
func NewTokenPriceBalancer(l Logger) *tokenPriceBalancer
Types ¶
type BalancerPoolInfo ¶
type BalancerPoolInfo struct { ID string `json:"id"` SwapFee string `json:"swapFee"` TotalSwapFee string `json:"totalSwapFee"` TotalSwapVolume string `json:"totalSwapVolume"` Liquidity string `json:"liquidity"` TotalWeight string `json:"totalWeight"` TotalSupply string `json:"totalSupply"` Tokens []struct { ID string `json:"id"` Address string `json:"address"` Balance string `json:"balance"` Decimals int `json:"decimals"` Symbol string `json:"symbol"` DenormWeight string `json:"denormWeight"` } `json:"tokens"` }
type Daemon ¶
func NewBalancerPoolsDaemon ¶
func NewSushiswapPoolsDaemon ¶
func NewTokenListDaemon ¶
func NewUniswapV2PoolsDaemon ¶
TODO:: a more versatile constrcutor
type PriceInfos ¶
type PriceInfos []PriceInfo
func (PriceInfos) Map ¶
func (p PriceInfos) Map(f func(ele interface{}))
type SushiswapPoolInfo ¶
type SushiswapPoolInfo struct { ID string `json:"id"` Token0 struct { ID string `json:"id"` Name string `json:"name"` Symbol string `json:"symbol"` TotalLiquidity string `json:"totalLiquidity"` } `json:"token0"` Token1 struct { ID string `json:"id"` Name string `json:"name"` Symbol string `json:"symbol"` TotalLiquidity string `json:"totalLiquidity"` } `json:"token1"` Reserve0 string `json:"reserve0"` Reserve1 string `json:"reserve1"` ReserveUSD string `json:"reserveUSD"` ReserveETH string `json:"reserveETH"` TotalSupply string `json:"totalSupply"` VolumeUSD string `json:"volumeUSD"` VolumeToken0 string `json:"volumeToken0"` VolumeToken1 string `json:"volumeToken1"` Token0Price string `json:"token0Price"` Token1Price string `json:"token1Price"` TrackedReserveETH string `json:"tracktedReserveETH"` UntractedVolumeUSD string `json:"untractedVolumeUSD"` }
type TokenInfos ¶
func NewTokenInfos ¶
func NewTokenInfos() TokenInfos
func (TokenInfos) HasSymbol ¶
func (t TokenInfos) HasSymbol(s string) bool
func (TokenInfos) Map ¶
func (t TokenInfos) Map(f func(ele interface{}))
type TokenListToken ¶
type UniswapV2PoolInfo ¶
type UniswapV2PoolInfo struct { ID string `json:"id"` Token0 struct { ID string `json:"id"` Name string `json:"name"` Symbol string `json:"symbol"` } `json:"token0"` Token1 struct { ID string `json:"id"` Name string `json:"name"` Symbol string `json:"symbol"` } `json:"token1"` Reserve0 string `json:"reserve0"` Reserve1 string `json:"reserve1"` ReserveUSD string `json:"reserveUSD"` ReserveETH string `json:"reserveETH"` TotalSupply string `json:"totalSupply"` VolumeUSD string `json:"volumeUSD"` VolumeToken0 string `json:"volumeToken0"` VolumeToken1 string `json:"volumeToken1"` Token0Price string `json:"token0Price"` Token1Price string `json:"token1Price"` }
Click to show internal directories.
Click to hide internal directories.