dashboard

package
v0.0.0-...-5cadadf Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActiveAccount

type ActiveAccount struct {
	ActiveAccount uint64
	Timestamp     time.Time
}

type ActiveAccounts

type ActiveAccounts = []ActiveAccount

type Addr

type Addr string

type Apr

type Apr struct {
	Apr       string
	Timestamp time.Time
}

type Aprs

type Aprs = []Apr

type Dashboard

type Dashboard interface {
	Recent() (Recent, error)
	RecentOf(addr Addr) (Recent, error)

	Statistic(...Addr) (Statistic, error)

	Pools(tokens ...Addr) (Pools, error)
	PoolDetail(Addr) (PoolDetail, error)

	Tokens() (Tokens, error)
	Token(addr Addr) (Token, error)

	TokenVolumes(addr Addr, itv Duration) (TokenChart, error)
	TokenTvls(addr Addr, itv Duration) (TokenChart, error)
	TokenPrices(addr Addr, itv Duration) (TokenChart, error)

	Txs(txType TxType, addr ...Addr) (Txs, error)
	TxsOfToken(txType TxType, token Addr) (Txs, error)

	Volumes(Duration) (Volumes, error)
	VolumesOf(Addr, Duration) (Volumes, error)

	Fees(Duration) (Fees, error)
	FeesOf(Addr, Duration) (Fees, error)

	Tvls(Duration) (Tvls, error)
	TvlsOf(Addr, Duration) (Tvls, error)

	Aprs(Duration) (Aprs, error)
	AprsOf(Addr, Duration) (Aprs, error)
}

func NewDashboardService

func NewDashboardService(chainId string, db *gorm.DB) Dashboard

type Duration

type Duration string
const (
	Month   Duration = "month"
	Quarter Duration = "quarter"
	Year    Duration = "year"
	All     Duration = "all"
)

type Fee

type Fee struct {
	Fee       string
	Timestamp time.Time
}

type Fees

type Fees = []Fee

type PoolDetail

type PoolDetail struct {
	Recent Recent
	Txs    Txs
}

type Pools

type Pools []struct {
	Address string
	Symbols string
	Tvl     string
	Volume  string
	Fee     string
	Apr     string
}

type Price

type Price struct {
	Price     string
	Timestamp time.Time
}

type Prices

type Prices = []Price

type Recent

type Recent struct {
	PoolExists       bool    `gorm:"pool_exists"`
	Volume           string  `gorm:"volume"`
	VolumeChangeRate float32 `gorm:"volume_change_rate"`
	Fee              string  `gorm:"fee"`
	FeeChangeRate    float32 `gorm:"fee_change_rate"`
	Tvl              string  `gorm:"tvl"`
	TvlChangeRate    float32 `gorm:"tvl_change_rate"`
	Apr              float32 `gorm:"apr"`
	AprChangeRate    float32 `gorm:"apr_change_rate"`
}

type Statistic

type Statistic = []StatisticItem

type StatisticItem

type StatisticItem struct {
	AddressCount uint64
	TxCount      uint64
	Fee          string
	Timestamp    time.Time
}

type Token

type Token struct {
	Addr           Addr
	Price          string
	PriceChange    float32
	Volume         string
	VolumeChange   string
	Volume7d       string
	Volume7dChange string
	Tvl            string
	TvlChange      string
	Commission     string
}

type TokenChart

type TokenChart []TokenValue

type TokenValue

type TokenValue struct {
	Timestamp string
	Value     string
}

type Tokens

type Tokens []Token

type Tvl

type Tvl struct {
	Tvl       string
	Timestamp time.Time
}

type Tvls

type Tvls = []Tvl

type Tx

type Tx struct {
	Action       string
	Hash         string
	Sender       string
	Address      string
	Asset0       string
	Asset0Symbol string
	Asset0Amount string
	Asset1       string
	Asset1Symbol string
	Asset1Amount string
	TotalValue   string
	Timestamp    time.Time
}

type TxType

type TxType string
const (
	TX_TYPE_SWAP     TxType = "swap"
	TX_TYPE_PROVIDE  TxType = "provide"
	TX_TYPE_WITHDRAW TxType = "withdraw"
	TX_TYPE_ALL      TxType = ""
)

type Txs

type Txs []Tx

type Volume

type Volume struct {
	Volume    string
	Timestamp time.Time
}

type Volumes

type Volumes = []Volume

Jump to

Keyboard shortcuts

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