statistics

package
v0.0.0-...-989067b Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Controller

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

func NewController

func NewController(serv *Service, logger *zap.Logger) *Controller

func (*Controller) GetAllTokens

func (c *Controller) GetAllTokens(ctx *fiber.Ctx) error

func (*Controller) NotionalTVL

func (c *Controller) NotionalTVL(ctx *fiber.Ctx) error

func (*Controller) TotalMessages

func (c *Controller) TotalMessages(ctx *fiber.Ctx) error

func (*Controller) TotalNotionalTransferred

func (c *Controller) TotalNotionalTransferred(ctx *fiber.Ctx) error

func (*Controller) TotalNotionalTransferredTo

func (c *Controller) TotalNotionalTransferredTo(ctx *fiber.Ctx) error

type EmitterKey

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

type Repository

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

func NewRepository

func NewRepository(ctx context.Context, db *mongo.Database, logger *zap.Logger) (*Repository, error)

func (*Repository) Query

func (r *Repository) Query(ctx context.Context, days int, projection bson.D, fn func(*StatisticDoc) error) error

func (*Repository) TVL

func (r *Repository) TVL(ctx context.Context) (*TVL, error)

func (*Repository) TotalMessages

func (r *Repository) TotalMessages(ctx context.Context) (*TotalMessages, error)

func (*Repository) TotalNotionalTransferred

func (r *Repository) TotalNotionalTransferred(ctx context.Context) (*TotalNotionalTransferred, error)

func (*Repository) TotalNotionalTransferredTo

func (r *Repository) TotalNotionalTransferredTo(ctx context.Context) (*TotalNotionalTransferredTo, error)

type Service

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

TODO: remove this

func NewService

func NewService(r *Repository, logger *zap.Logger) *Service

func (*Service) GetAllTokens

func (s *Service) GetAllTokens(ctx context.Context) ([]*TokenDoc, error)

func (*Service) TVL

func (s *Service) TVL(ctx context.Context) (*TVL, error)

func (*Service) TotalMessages

func (s *Service) TotalMessages(ctx context.Context) (*TotalMessages, error)

func (*Service) TotalNotionalTransferred

func (s *Service) TotalNotionalTransferred(ctx context.Context) (*TotalNotionalTransferred, error)

func (*Service) TotalNotionalTransferredTo

func (s *Service) TotalNotionalTransferredTo(ctx context.Context) (*TotalNotionalTransferredTo, error)

type StatisticDoc

type StatisticDoc struct {
	ID                  string      `bson:"_id" json:"id"`
	Date                *time.Time  `bson:"date" json:"date"`
	EmitterChain        vaa.ChainID `bson:"emitterChain" json:"emitterChain"`
	EmitterAddr         string      `bson:"emitterAddr" json:"emitterAddr"`
	TokenChain          vaa.ChainID `bson:"tokenChain" json:"tokenChain"`
	TargetChain         vaa.ChainID `bson:"targetChain" json:"targetChain"`
	TokenAddress        string      `bson:"tokenAddress" json:"tokenAddress"`
	TotalVAACount       uint32      `bson:"totalVAACount" json:"totalVAACount"`
	TotalTransferAmount string      `bson:"totalTransferAmount" json:"totalTransferAmount"`
	TotalNotionalUSD    float64     `bson:"totalNotionalUSD" json:"totalNotionalUSD"`
	UpdatedAt           *time.Time  `bson:"updatedAt" json:"updatedAt"`
}

type TVL

type TVL struct {
	TVL map[TVLKey]*big.Int
}

type TVLKey

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

type TokenDoc

type TokenDoc struct {
	ID              string      `bson:"_id" json:"id"`
	TokenAddress    string      `bson:"tokenAddress" json:"tokenAddress"`
	TokenChain      vaa.ChainID `bson:"tokenChain" json:"tokenChain"`
	Decimals        uint8       `bson:"decimals" json:"decimals"`
	Symbol          string      `bson:"symbol" json:"symbol"`
	Name            string      `bson:"name" json:"name"`
	NativeAddress   string      `bson:"nativeAddress" json:"nativeAddress"`
	CoinGeckoCoinId string      `bson:"coinGeckoCoinId" json:"coinGeckoCoinId"`
	UpdatedAt       *time.Time  `bson:"updatedAt" json:"updatedAt"`
}

type TokenTransferKey

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

type TokenTransferToKey

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

type TotalMessages

type TotalMessages struct {
	TotalMessagesPerEmitter map[EmitterKey]uint32
}

type TotalNotionalTransferred

type TotalNotionalTransferred struct {
	TotalTransferred map[TokenTransferKey]float64
}

type TotalNotionalTransferredTo

type TotalNotionalTransferredTo struct {
	TotalTransferred map[TokenTransferToKey]float64
}

Jump to

Keyboard shortcuts

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