market

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 13, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(cfg config.CoinMarketCapConfig) *Client

NewClient creates new resty client.

func (*Client) GetGlobalPrices

func (c *Client) GetGlobalPrices(ctx context.Context, targetDenoms []string) ([]sdk.Dec, error)

func (*Client) GetTargetPools

func (c *Client) GetTargetPools(ctx context.Context) ([]uint64, error)

type CoinMarketCapResponse

type CoinMarketCapResponse struct {
	Status struct {
		Timestamp    time.Time `json:"timestamp"`
		ErrorCode    int       `json:"error_code"`
		ErrorMessage string    `json:"error_message"`
		Elapsed      int       `json:"elapsed"`
		CreditCount  int       `json:"credit_count"`
	} `json:"status"`
	Data json.RawMessage `json:"data"`
}

type PoolsCache

type PoolsCache struct {
	BlockHeight      int64            `json:"blockHeight"`
	Pools            []PoolsCachePool `json:"pools"`
	TotalValueLocked float64          `json:"totalValueLocked"`
	UpdatedAt        time.Time        `json:"updatedAt"`
}

type PoolsCacheCoin

type PoolsCacheCoin struct {
	Denom       string  `json:"denom"`
	Amount      int64   `json:"amount"`
	GlobalPrice float64 `json:"globalPrice"`
}

type PoolsCachePool

type PoolsCachePool struct {
	ID                        uint64           `json:"id"`
	ReserveCoins              []PoolsCacheCoin `json:"reserveCoins"`
	PoolCoin                  PoolsCacheCoin   `json:"poolCoin"`
	SwapFeeValueSinceLastHour float64          `json:"swapFeeValueSinceLastHour"`
	APY                       float64          `json:"apy"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL