repo

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Liquidity0 = 0 + iota
	Liquidity1
	Liquidity0InPrice
	Liquidity1InPrice
	TupleLength
)

Variables

Functions

This section is empty.

Types

type Repo

type Repo interface {
	LatestTimestampOfPairStats() (float64, error)
	LastHeightOfPairStatsRecent() (uint64, error)
	LastLpHistory(height uint64) ([]schemas.LpHistory, error)
	LastLiquidity(pairId uint64, timestamp float64) ([TupleLength]string, error)
	BeginTx() (*gorm.DB, error)
	UpdatePairStatsRecent(tx *gorm.DB, stats []schemas.PairStatsRecent) error
	UpdateLpHistory(history []schemas.LpHistory) error
	DeletePairStatsRecent(tx *gorm.DB, deleteBefore time.Time) error

	DeleteDuplicates(end time.Time) error
	UpdatePairStats(stats []schemas.PairStats30m) error
	UpdateAccountStats(stats schemas.HAccountStats30m) error
	CreateAccounts(addresses []string) error
	HoldingPairIds(accountId uint64) ([]uint64, error)
	Accounts(endTs float64) (map[uint64]string, error)
	Close() error
}

func New

func New(chainId string, dbConfig configs.RdbConfig) Repo

Jump to

Keyboard shortcuts

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