asset

package
v0.0.0-...-8f22770 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 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 Config

type Config struct {
	Oracle                   *big.Int
	Decimals                 *big.Int
	CollateralFactor         *big.Int
	LiquidationThreshold     *big.Int
	LiquidationBonus         *big.Int
	BaseBorrowRate           *big.Int
	BorrowRateSlopeLow       *big.Int
	BorrowRateSlopeHigh      *big.Int
	SupplyRateSlopeLow       *big.Int
	SupplyRateSlopeHigh      *big.Int
	TargetUtilization        *big.Int
	OriginationFee           *big.Int
	Dust                     *big.Int
	MaxTotalSupply           *big.Int
	ReserveFactor            *big.Int
	LiquidationReserveFactor *big.Int
	MinPrincipalForRewards   *big.Int
	BaseTrackingSupplySpeed  *big.Int
	BaseTrackingBorrowSpeed  *big.Int
}

Config represents the configuration for an asset

func (*Config) Scale

func (c *Config) Scale() *big.Int

type Data

type Data struct {
	SRate               *big.Int
	BRate               *big.Int
	TotalSupply         *big.Int
	TotalBorrow         *big.Int
	LastAccrual         *big.Int
	Balance             *big.Int
	TrackingSupplyIndex *big.Int
	TrackingBorrowIndex *big.Int
	AwaitedSupply       *big.Int
}

Data represents the structure of asset data

type Parser

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

func NewParser

func NewParser(config *config.Config) *Parser

func (*Parser) Assets

func (p *Parser) Assets() map[string]*big.Int

func (*Parser) CalculateCurrentRates

func (p *Parser) CalculateCurrentRates(asset string) (*Data, *big.Int, *big.Int)

func (*Parser) Config

func (p *Parser) Config(asset string) *Config

func (*Parser) Data

func (p *Parser) Data(asset string) *Data

func (*Parser) SetInfo

func (p *Parser) SetInfo(data *cell.Dictionary, config *cell.Dictionary) error

func (*Parser) UpdateCurrentRates

func (p *Parser) UpdateCurrentRates(forward int64) *Parser

Jump to

Keyboard shortcuts

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