service

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: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Getter

type Getter[T any] interface {
	Get(key string) (*T, error)
	GetAll() ([]T, error)
}

func NewPairService

func NewPairService(chainId string, db *gorm.DB) Getter[Pair]

func NewPoolService

func NewPoolService(chainId string, db *gorm.DB) Getter[Pool]

func NewStatService

func NewStatService(chainId string, db *gorm.DB) Getter[PairStats]

func NewTokenService

func NewTokenService(chainId string, db *gorm.DB) Getter[Token]

type Pair

type Pair struct {
	ID      string
	ChainId string
	Address string
	Asset0  Token `gorm:"embedded;embeddedPrefix:asset0_"`
	Asset1  Token `gorm:"embedded;embeddedPrefix:asset1_"`
	Lp      Token `gorm:"embedded;embeddedPrefix:lp_"`
}

type PairStat

type PairStat struct {
	Address           string
	VolumeInPrice     string
	CommissionInPrice string
	AprInPrice        string
}

type PairStats

type PairStats []PairStat

type PeriodTypeIdx

type PeriodTypeIdx int
const (
	Period24h PeriodTypeIdx = 0 + iota
	Period7d
	Period1mon
	CountOfPeriodType
)

type Pool

type Pool = indexer.LatestPool

type Token

type Token = indexer.Token

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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