storage

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChainData

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

type Storage

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

func NewStorage

func NewStorage(log *zap.SugaredLogger) *Storage

func (*Storage) AddSolanaTradeLogs

func (s *Storage) AddSolanaTradeLogs(logs []common.SolanaTradelog)

func (*Storage) AddSolanaTransferLogs

func (s *Storage) AddSolanaTransferLogs(logs []common.SolanaTransferlog)

func (*Storage) GetLastBigTx added in v0.0.4

func (s *Storage) GetLastBigTx(chain common.Chain, action common.SmartMoneyActivities, last int) ([]common.BigTx, error)

func (*Storage) GetLastBigTxForToken added in v0.0.8

func (s *Storage) GetLastBigTxForToken(chain common.Chain, action common.SmartMoneyActivities, last int, tokenAddress string) ([]common.BigTx, error)

func (*Storage) GetLastBigTxForUser added in v0.0.9

func (s *Storage) GetLastBigTxForUser(chain common.Chain, action common.SmartMoneyActivities, last int, userAddress string) ([]common.BigTx, error)

func (*Storage) GetTokenInFlow added in v0.0.2

func (s *Storage) GetTokenInFlow(duration time.Duration) (map[string]float64, error)

func (*Storage) GetTokenInFlowInUsdt added in v0.0.2

func (s *Storage) GetTokenInFlowInUsdt(duration time.Duration) (map[string]float64, error)

func (*Storage) GetTokenInfo

func (s *Storage) GetTokenInfo() map[string]common.Token

func (*Storage) GetTokenOutFlow added in v0.0.2

func (s *Storage) GetTokenOutFlow(duration time.Duration) (map[string]float64, error)

func (*Storage) GetTokenOutFlowInUsdt added in v0.0.2

func (s *Storage) GetTokenOutFlowInUsdt(duration time.Duration) (map[string]float64, error)

func (*Storage) GetTokenUsdtRate

func (s *Storage) GetTokenUsdtRate() map[string]float64

func (*Storage) GetTokens

func (s *Storage) GetTokens(chain common.Chain) []string

func (*Storage) GetTradeLogs

func (s *Storage) GetTradeLogs(duration time.Duration) (TradeStorageByRange, error)

func (*Storage) GetTradeLogsForToken

func (s *Storage) GetTradeLogsForToken(from time.Time, token string) []common.SolanaTradelog

heavy action

func (*Storage) GetTradeLogsForUser

func (s *Storage) GetTradeLogsForUser(from time.Time, user string) []common.SolanaTradelog

heavy action

func (*Storage) GetTransferLogs

func (s *Storage) GetTransferLogs(duration time.Duration) (TransferStorageByRange, error)

func (*Storage) GetTransferLogsForToken

func (s *Storage) GetTransferLogsForToken(from time.Time, token string) []common.SolanaTransferlog

func (*Storage) GetTrendingToken added in v0.0.9

func (s *Storage) GetTrendingToken() coingecko.CoingeckoTrending

func (*Storage) GetUsers

func (s *Storage) GetUsers(chain common.Chain) []string

func (*Storage) RemoveTrades

func (s *Storage) RemoveTrades(sugar *zap.SugaredLogger)

func (*Storage) RemoveTransfer

func (s *Storage) RemoveTransfer(sugar *zap.SugaredLogger)

func (*Storage) SetAddrToTokenInfo

func (s *Storage) SetAddrToTokenInfo(tokens []common.Token)

func (*Storage) SetTokenUsdtRate

func (s *Storage) SetTokenUsdtRate(rates []common.Token)

func (*Storage) SetTrendingToken added in v0.0.9

func (s *Storage) SetTrendingToken(t coingecko.CoingeckoTrending)

type StorageByRangeIndex

type StorageByRangeIndex struct {
	StartIndex   int       // point to first trade logs of this chain that in duration
	StartBlockTs time.Time // use to debug, blockTs of StartIndex block
	StartBlock   uint64    // use to debug, block number of StartIndex block
	EndBlockTs   time.Time // use to debug, end block ts
	EndBlock     uint64    // use to debug, end block number
}

type TradeStorageByRange

type TradeStorageByRange struct {
	UserProfit  map[string]float64
	TokenProfit map[string]float64

	TokenInFlowInUsdt map[string]float64
	TokenInFlow       map[string]float64

	TokenOutFlowInUsdt map[string]float64
	TokenOutFlow       map[string]float64
	StorageByRangeIndex
	// contains filtered or unexported fields
}

func NewTradeStorageByRange

func NewTradeStorageByRange(duration time.Duration) TradeStorageByRange

type TransferStorageByRange

type TransferStorageByRange struct {
	CexInFlow       map[string]float64
	CexInFlowInUsdt map[string]float64

	CexOutFlow       map[string]float64
	CexOutFlowInUsdt map[string]float64

	StorageByRangeIndex
	// contains filtered or unexported fields
}

func NewTransferStorageByRange

func NewTransferStorageByRange(duration time.Duration) TransferStorageByRange

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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