Documentation
¶
Overview ¶
Package protocols provides standardized protocol implementations for computing LP data, e.g. LP token prices and TVL values
Index ¶
- Constants
- func ABDKToDecimal(xIn *big.Int) (decimal.Decimal, error)
- func NormalizeAmount(amount *big.Int, decimals uint) decimal.Decimal
- type AquaBeraConfig
- type AquaBeraLPPriceProvider
- func (a *AquaBeraLPPriceProvider) GetConfig(ctx context.Context, address string, client *ethclient.Client) ([]byte, error)
- func (a *AquaBeraLPPriceProvider) Initialize(ctx context.Context, client *ethclient.Client) error
- func (a *AquaBeraLPPriceProvider) LPTokenPrice(ctx context.Context) (string, error)
- func (a *AquaBeraLPPriceProvider) TVL(ctx context.Context) (string, error)
- func (a *AquaBeraLPPriceProvider) UpdateBlock(block *big.Int, prices map[string]Price)
- type Balances
- type BeraBorrowCDPConfig
- type BeraBorrowLPPriceProvider
- func (b *BeraBorrowLPPriceProvider) GetConfig(ctx context.Context, lpAddress string, client *ethclient.Client) ([]byte, error)
- func (b *BeraBorrowLPPriceProvider) Initialize(ctx context.Context, client *ethclient.Client) error
- func (b *BeraBorrowLPPriceProvider) LPTokenPrice(ctx context.Context) (string, error)
- func (b *BeraBorrowLPPriceProvider) TVL(ctx context.Context) (string, error)
- func (b *BeraBorrowLPPriceProvider) UpdateBlock(block *big.Int, prices map[string]Price)
- type BexLPPriceProvider
- func (b *BexLPPriceProvider) GetConfig(ctx context.Context, address string, client *ethclient.Client) ([]byte, error)
- func (b *BexLPPriceProvider) Initialize(ctx context.Context, client *ethclient.Client) error
- func (b *BexLPPriceProvider) LPTokenPrice(ctx context.Context) (string, error)
- func (b *BexLPPriceProvider) TVL(ctx context.Context) (string, error)
- func (b *BexLPPriceProvider) UpdateBlock(block *big.Int, prices map[string]Price)
- type BexPoolConfig
- type BexV2LPPriceProvider
- func (b *BexV2LPPriceProvider) GetConfig(ctx context.Context, poolAddress string, client *ethclient.Client) ([]byte, error)
- func (b *BexV2LPPriceProvider) Initialize(ctx context.Context, client *ethclient.Client) error
- func (b *BexV2LPPriceProvider) LPTokenPrice(ctx context.Context) (string, error)
- func (b *BexV2LPPriceProvider) TVL(ctx context.Context) (string, error)
- func (b *BexV2LPPriceProvider) UpdateBlock(block *big.Int, prices map[string]Price)
- type BexV2PoolConfig
- type BullaConfig
- type BullaLPPriceProvider
- func (b *BullaLPPriceProvider) GetConfig(ctx context.Context, address string, client *ethclient.Client) ([]byte, error)
- func (b *BullaLPPriceProvider) Initialize(ctx context.Context, client *ethclient.Client) error
- func (b *BullaLPPriceProvider) LPTokenPrice(ctx context.Context) (string, error)
- func (b *BullaLPPriceProvider) TVL(ctx context.Context) (string, error)
- func (b *BullaLPPriceProvider) UpdateBlock(block *big.Int, prices map[string]Price)
- type BurrBearLPPriceProvider
- func (bb *BurrBearLPPriceProvider) GetConfig(ctx context.Context, poolAddress string, client *ethclient.Client) ([]byte, error)
- func (bb *BurrBearLPPriceProvider) Initialize(ctx context.Context, client *ethclient.Client) error
- func (bb *BurrBearLPPriceProvider) LPTokenPrice(ctx context.Context) (string, error)
- func (bb *BurrBearLPPriceProvider) TVL(ctx context.Context) (string, error)
- func (bb *BurrBearLPPriceProvider) UpdateBlock(block *big.Int, prices map[string]Price)
- type BurrBearPoolConfig
- type D8xConfig
- type D8xLPPriceProvider
- func (d8x *D8xLPPriceProvider) GetConfig(ctx context.Context, address string, ethClient *ethclient.Client) ([]byte, error)
- func (d8x *D8xLPPriceProvider) Initialize(ctx context.Context, client *ethclient.Client) error
- func (d8x *D8xLPPriceProvider) LPTokenPrice(ctx context.Context) (string, error)
- func (d8x *D8xLPPriceProvider) TVL(ctx context.Context) (string, error)
- func (d8x *D8xLPPriceProvider) UpdateBlock(block *big.Int, prices map[string]Price)
- type DolomiteConfig
- type DolomiteLPPriceProvider
- func (d *DolomiteLPPriceProvider) GetConfig(ctx context.Context, address string, ethClient *ethclient.Client) ([]byte, error)
- func (d *DolomiteLPPriceProvider) Initialize(ctx context.Context, client *ethclient.Client) error
- func (d *DolomiteLPPriceProvider) LPTokenPrice(ctx context.Context) (string, error)
- func (d *DolomiteLPPriceProvider) TVL(ctx context.Context) (string, error)
- func (d *DolomiteLPPriceProvider) UpdateBlock(block *big.Int, prices map[string]Price)
- type KodiakConfig
- type KodiakContract
- type KodiakLPPriceProvider
- func (k *KodiakLPPriceProvider) GetConfig(ctx context.Context, address string, client *ethclient.Client) ([]byte, error)
- func (k *KodiakLPPriceProvider) Initialize(ctx context.Context, client *ethclient.Client) error
- func (k *KodiakLPPriceProvider) LPTokenPrice(ctx context.Context) (string, error)
- func (k *KodiakLPPriceProvider) TVL(ctx context.Context) (string, error)
- func (k *KodiakLPPriceProvider) UpdateBlock(block *big.Int, prices map[string]Price)
- type KodiakV2Pool
- type KodiakV3Island
- type Price
- type Protocol
- type WasabeeConfig
- type WasabeeLPPriceProvider
- func (w *WasabeeLPPriceProvider) GetConfig(ctx context.Context, address string, client *ethclient.Client) ([]byte, error)
- func (w *WasabeeLPPriceProvider) Initialize(ctx context.Context, client *ethclient.Client) error
- func (w *WasabeeLPPriceProvider) LPTokenPrice(ctx context.Context) (string, error)
- func (w *WasabeeLPPriceProvider) TVL(ctx context.Context) (string, error)
- func (w *WasabeeLPPriceProvider) UpdateBlock(block *big.Int, prices map[string]Price)
- type WasabiConfig
- type WasabiLPPriceProvider
- func (w *WasabiLPPriceProvider) GetConfig(ctx context.Context, address string, ethClient *ethclient.Client) ([]byte, error)
- func (w *WasabiLPPriceProvider) Initialize(ctx context.Context, client *ethclient.Client) error
- func (w *WasabiLPPriceProvider) LPTokenPrice(ctx context.Context) (string, error)
- func (w *WasabiLPPriceProvider) TVL(ctx context.Context) (string, error)
- func (w *WasabiLPPriceProvider) UpdateBlock(block *big.Int, prices map[string]Price)
- type WeberaConfig
- type WeberaLPPriceProvider
- func (w *WeberaLPPriceProvider) GetConfig(ctx context.Context, address string, ethClient *ethclient.Client) ([]byte, error)
- func (w *WeberaLPPriceProvider) Initialize(ctx context.Context, client *ethclient.Client) error
- func (w *WeberaLPPriceProvider) LPTokenPrice(ctx context.Context) (string, error)
- func (w *WeberaLPPriceProvider) TVL(ctx context.Context) (string, error)
- func (w *WeberaLPPriceProvider) UpdateBlock(block *big.Int, prices map[string]Price)
Constants ¶
const ( One64x64 = "18446744073709551616" // 1 << 64 Decimals18 = 1e18 )
const ( V2PoolByteCodeSHA256 = "bffda5c9e111fa411890cc93d58cb5c58a14f97bcbfa642efe300c766c4397f6" V3IslandByteCodeSHA256 = "f1b68b8044f372c1831075be05a63c1757ef9c64cabd5dfbf9a749a93f25b1da" )
const USDPriceDecimals uint = 18
The fetchPrice() onchain call always returns a USD price with 18 decimals
const Version = "0.4.0"
Version information
Variables ¶
This section is empty.
Functions ¶
func ABDKToDecimal ¶ added in v0.1.14
ABDKToDecimal converts an ABDK fixed point 64.64 number to deicmal.Decimal
Types ¶
type AquaBeraConfig ¶ added in v0.1.12
type AquaBeraLPPriceProvider ¶ added in v0.1.12
type AquaBeraLPPriceProvider struct {
// contains filtered or unexported fields
}
AquaBeraLPPriceProvider defines the provider for AquaBera LP price and TVL.
func NewAquaBeraLPPriceProvider ¶ added in v0.1.12
func NewAquaBeraLPPriceProvider( address common.Address, block *big.Int, prices map[string]Price, logger zerolog.Logger, config []byte, ) *AquaBeraLPPriceProvider
NewAquaBeraLPPriceProvider creates a new instance of the AquaBeraLPPriceProvider.
func (*AquaBeraLPPriceProvider) GetConfig ¶ added in v0.1.12
func (a *AquaBeraLPPriceProvider) GetConfig(ctx context.Context, address string, client *ethclient.Client) ([]byte, error)
GetConfig fetches and returns the configuration for the AquaBera protocol.
func (*AquaBeraLPPriceProvider) Initialize ¶ added in v0.1.12
Initialize checks the configuration/data provided and instantiates the AquaBera smart contract.
func (*AquaBeraLPPriceProvider) LPTokenPrice ¶ added in v0.1.12
func (a *AquaBeraLPPriceProvider) LPTokenPrice(ctx context.Context) (string, error)
LPTokenPrice returns the current price of the protocol's LP token in USD.
func (*AquaBeraLPPriceProvider) TVL ¶ added in v0.1.12
func (a *AquaBeraLPPriceProvider) TVL(ctx context.Context) (string, error)
TVL returns the Total Value Locked in the protocol in USD.
func (*AquaBeraLPPriceProvider) UpdateBlock ¶ added in v0.1.18
func (a *AquaBeraLPPriceProvider) UpdateBlock(block *big.Int, prices map[string]Price)
type BeraBorrowCDPConfig ¶ added in v0.1.9
type BeraBorrowCDPConfig struct {
ColVaultAddress string `json:"col_vault_address"`
LPTDecimals uint `json:"lpt_decimals"`
CDPDecimals uint `json:"cdp_decimals"`
}
LPTDecimals are the decimals of the InfraredWrapper token CDPDecimals are the decimals of the CompoundingInfraredCollateralVault token
type BeraBorrowLPPriceProvider ¶ added in v0.1.9
type BeraBorrowLPPriceProvider struct {
LPTAddress common.Address
// contains filtered or unexported fields
}
BeraBorrowLPPriceProvider defines the provider for BeraBorrow CDP price and CDP TVL.
func NewBeraBorrowLPPriceProvider ¶ added in v0.1.9
func NewBeraBorrowLPPriceProvider( LPTAddress common.Address, block *big.Int, logger zerolog.Logger, config []byte, ) *BeraBorrowLPPriceProvider
NewBeraBorrowLPPriceProvider creates a new instance of the BeraBorrowLPPriceProvider.
func (*BeraBorrowLPPriceProvider) Initialize ¶ added in v0.1.9
Initialize checks the configuration/data and instantiates the CDP contract.
func (*BeraBorrowLPPriceProvider) LPTokenPrice ¶ added in v0.1.9
func (b *BeraBorrowLPPriceProvider) LPTokenPrice(ctx context.Context) (string, error)
LPTokenPrice returns the current price of the protocol's LP token in USD
func (*BeraBorrowLPPriceProvider) TVL ¶ added in v0.1.9
func (b *BeraBorrowLPPriceProvider) TVL(ctx context.Context) (string, error)
TVL returns the Total Value Locked in the CDP in USD Actually gets the TVL of the CICV which is 1-1 with the TVL of the IW which is the LP token
func (*BeraBorrowLPPriceProvider) UpdateBlock ¶ added in v0.1.18
func (b *BeraBorrowLPPriceProvider) UpdateBlock(block *big.Int, prices map[string]Price)
type BexLPPriceProvider ¶ added in v0.1.6
type BexLPPriceProvider struct {
// contains filtered or unexported fields
}
BexLPPriceProvider defines the provider for BEX LP price and Pool TVL.
func NewBexLPPriceProvider ¶ added in v0.1.6
func NewBexLPPriceProvider( crocqueryAddress common.Address, lpTokenAddress common.Address, block *big.Int, prices map[string]Price, logger zerolog.Logger, config []byte, ) *BexLPPriceProvider
NewBexLPPriceProvider creates a new instance of the BexLPPriceProvider.
func (*BexLPPriceProvider) Initialize ¶ added in v0.1.6
Initialize checks the configuration/data and instantiates the CrocQuery and LP Token ERC20, CrocLPERC20 smart contracts.
func (*BexLPPriceProvider) LPTokenPrice ¶ added in v0.1.6
func (b *BexLPPriceProvider) LPTokenPrice(ctx context.Context) (string, error)
LPTokenPrice returns the current price of the protocol's LP token in USD cents (1 USD = 100 cents).
func (*BexLPPriceProvider) TVL ¶ added in v0.1.6
func (b *BexLPPriceProvider) TVL(ctx context.Context) (string, error)
TVL returns the Total Value Locked in the pool in USD cents (1 USD = 100 cents).
func (*BexLPPriceProvider) UpdateBlock ¶ added in v0.1.18
func (b *BexLPPriceProvider) UpdateBlock(block *big.Int, prices map[string]Price)
type BexPoolConfig ¶ added in v0.1.6
type BexV2LPPriceProvider ¶ added in v0.1.7
type BexV2LPPriceProvider struct {
// contains filtered or unexported fields
}
BexLPPriceProvider defines the provider for BEX LP price and Pool TVL.
func NewBexV2LPPriceProvider ¶ added in v0.1.7
func NewBexV2LPPriceProvider( vaultAddress common.Address, poolAddress common.Address, block *big.Int, prices map[string]Price, logger zerolog.Logger, config []byte, ) *BexV2LPPriceProvider
NewBexLPPriceProvider creates a new instance of the BexLPPriceProvider.
func (*BexV2LPPriceProvider) Initialize ¶ added in v0.1.7
Initialize checks the configuration/data and instantiates the Vault and Base Pool contracts.
func (*BexV2LPPriceProvider) LPTokenPrice ¶ added in v0.1.7
func (b *BexV2LPPriceProvider) LPTokenPrice(ctx context.Context) (string, error)
LPTokenPrice returns the current price of the protocol's LP token in USD
func (*BexV2LPPriceProvider) TVL ¶ added in v0.1.7
func (b *BexV2LPPriceProvider) TVL(ctx context.Context) (string, error)
TVL returns the Total Value Locked in the pool in USD cents (1 USD = 100 cents).
func (*BexV2LPPriceProvider) UpdateBlock ¶ added in v0.1.18
func (b *BexV2LPPriceProvider) UpdateBlock(block *big.Int, prices map[string]Price)
type BexV2PoolConfig ¶ added in v0.1.7
type BullaConfig ¶ added in v0.1.10
type BullaConfig struct {
Token0 string `json:"token0"`
Token1 string `json:"token1"`
LPTDecimals uint `json:"lpt_decimals"`
}
BullaConfig defines the configuration for Bulla Exchange adapter
type BullaLPPriceProvider ¶ added in v0.1.10
type BullaLPPriceProvider struct {
// contains filtered or unexported fields
}
BullaLPPriceProvider defines the provider for Bulla Exchange LP price and TVL.
func NewBullaLPPriceProvider ¶ added in v0.1.10
func NewBullaLPPriceProvider( address common.Address, block *big.Int, prices map[string]Price, logger zerolog.Logger, config []byte, ) *BullaLPPriceProvider
NewBullaLPPriceProvider creates a new instance of the BullaLPPriceProvider.
func (*BullaLPPriceProvider) GetConfig ¶ added in v0.1.10
func (b *BullaLPPriceProvider) GetConfig(ctx context.Context, address string, client *ethclient.Client) ([]byte, error)
GetConfig returns the configuration for the Bulla Exchange adapter.
func (*BullaLPPriceProvider) Initialize ¶ added in v0.1.10
Initialize checks the configuration/data provided and instantiates the Bulla smart contract.
func (*BullaLPPriceProvider) LPTokenPrice ¶ added in v0.1.10
func (b *BullaLPPriceProvider) LPTokenPrice(ctx context.Context) (string, error)
LPTokenPrice returns the current price of the protocol's LP token in USD.
func (*BullaLPPriceProvider) TVL ¶ added in v0.1.10
func (b *BullaLPPriceProvider) TVL(ctx context.Context) (string, error)
TVL returns the Total Value Locked in the protocol in USD.
func (*BullaLPPriceProvider) UpdateBlock ¶ added in v0.1.18
func (b *BullaLPPriceProvider) UpdateBlock(block *big.Int, prices map[string]Price)
type BurrBearLPPriceProvider ¶ added in v0.1.11
type BurrBearLPPriceProvider struct {
// contains filtered or unexported fields
}
BurrBearLPPriceProvider defines the provider for BEX LP price and Pool TVL.
func NewBurrBearLPPriceProvider ¶ added in v0.1.11
func NewBurrBearLPPriceProvider( poolAddress common.Address, block *big.Int, prices map[string]Price, logger zerolog.Logger, config []byte, ) *BurrBearLPPriceProvider
NewBurrBearLPPriceProvider creates a new instance of the BurrBearLPPriceProvider.
func (*BurrBearLPPriceProvider) Initialize ¶ added in v0.1.11
Initialize checks the configuration/data and instantiates the Vault and Base Pool contracts.
func (*BurrBearLPPriceProvider) LPTokenPrice ¶ added in v0.1.11
func (bb *BurrBearLPPriceProvider) LPTokenPrice(ctx context.Context) (string, error)
LPTokenPrice returns the current price of the protocol's LP token in USD
func (*BurrBearLPPriceProvider) TVL ¶ added in v0.1.11
func (bb *BurrBearLPPriceProvider) TVL(ctx context.Context) (string, error)
TVL returns the Total Value Locked in the pool in USD cents (1 USD = 100 cents).
func (*BurrBearLPPriceProvider) UpdateBlock ¶ added in v0.1.18
func (bb *BurrBearLPPriceProvider) UpdateBlock(block *big.Int, prices map[string]Price)
type BurrBearPoolConfig ¶ added in v0.1.11
type D8xLPPriceProvider ¶ added in v0.1.14
type D8xLPPriceProvider struct {
// contains filtered or unexported fields
}
func NewD8xLPPriceProvider ¶ added in v0.1.14
func NewD8xLPPriceProvider( address common.Address, block *big.Int, logger zerolog.Logger, config []byte, ) *D8xLPPriceProvider
NewD8xLPPriceProvider returns a new instance of D8XLPPriceProvider with the assigned config and the D8X contract address
func (*D8xLPPriceProvider) Initialize ¶ added in v0.1.14
func (*D8xLPPriceProvider) LPTokenPrice ¶ added in v0.1.14
func (d8x *D8xLPPriceProvider) LPTokenPrice(ctx context.Context) (string, error)
LPTokenPrice returns the current price of the protocol's LP token in USD
func (*D8xLPPriceProvider) TVL ¶ added in v0.1.14
func (d8x *D8xLPPriceProvider) TVL(ctx context.Context) (string, error)
TVL returns the Total Value Locked in the pool in USD.
func (*D8xLPPriceProvider) UpdateBlock ¶ added in v0.1.18
func (d8x *D8xLPPriceProvider) UpdateBlock(block *big.Int, prices map[string]Price)
type DolomiteConfig ¶ added in v0.1.8
type DolomiteLPPriceProvider ¶ added in v0.1.8
type DolomiteLPPriceProvider struct {
// contains filtered or unexported fields
}
DolomiteLPPriceProvider defines the provider for Dolomite dToken price and TVL.
func NewDolomiteLPPriceProvider ¶ added in v0.1.8
func NewDolomiteLPPriceProvider( address common.Address, block *big.Int, prices map[string]Price, logger zerolog.Logger, config []byte, ) *DolomiteLPPriceProvider
NewDolomiteLPPriceProvider creates a new instance of the DolomiteLPPriceProvider.
func (*DolomiteLPPriceProvider) Initialize ¶ added in v0.1.8
Initialize checks the configuration/data provided and instantiates the Dolomite smart contract.
func (*DolomiteLPPriceProvider) LPTokenPrice ¶ added in v0.1.8
func (d *DolomiteLPPriceProvider) LPTokenPrice(ctx context.Context) (string, error)
func (*DolomiteLPPriceProvider) TVL ¶ added in v0.1.8
func (d *DolomiteLPPriceProvider) TVL(ctx context.Context) (string, error)
func (*DolomiteLPPriceProvider) UpdateBlock ¶ added in v0.1.18
func (d *DolomiteLPPriceProvider) UpdateBlock(block *big.Int, prices map[string]Price)
type KodiakConfig ¶ added in v0.1.4
type KodiakContract ¶ added in v0.1.18
type KodiakLPPriceProvider ¶
type KodiakLPPriceProvider struct {
// contains filtered or unexported fields
}
KodiakLPPriceProvider defines the provider for Kodiak LP price and TVL.
func NewKodiakLPPriceProvider ¶
func NewKodiakLPPriceProvider( address common.Address, block *big.Int, prices map[string]Price, logger zerolog.Logger, config []byte, ) *KodiakLPPriceProvider
NewKodiakLPPriceProvider creates a new instance of the KodiakLPPriceProvider.
func (*KodiakLPPriceProvider) Initialize ¶
Initialize checks the configuration/data provided and instantiates the KodiakV1 smart contract.
func (*KodiakLPPriceProvider) LPTokenPrice ¶
func (k *KodiakLPPriceProvider) LPTokenPrice(ctx context.Context) (string, error)
LPTokenPrice returns the current price of LP token in USD
func (*KodiakLPPriceProvider) TVL ¶
func (k *KodiakLPPriceProvider) TVL(ctx context.Context) (string, error)
TVL returns the Total Value Locked in the pool/island as USD
func (*KodiakLPPriceProvider) UpdateBlock ¶ added in v0.1.18
func (k *KodiakLPPriceProvider) UpdateBlock(block *big.Int, prices map[string]Price)
type KodiakV2Pool ¶ added in v0.1.18
func (*KodiakV2Pool) GetBalances ¶ added in v0.1.18
func (v2 *KodiakV2Pool) GetBalances(opts *bind.CallOpts) (Balances, error)
type KodiakV3Island ¶ added in v0.1.18
type KodiakV3Island struct {
*sc.KodiakIsland
}
Wrapper types which implement a common KodiakContract interface
func (*KodiakV3Island) GetBalances ¶ added in v0.1.18
func (v3 *KodiakV3Island) GetBalances(opts *bind.CallOpts) (Balances, error)
type Price ¶ added in v0.1.5
Type to track a token Price along with the number of decimals used representing token amounts
type Protocol ¶
type Protocol interface {
// GetConfig returns static configuration data needed for LP token price/TVL calculation.
// Returns an error if the configuration cannot be prepared.
GetConfig(ctx context.Context, address string, ethClient *ethclient.Client) ([]byte, error)
// Initialize performs any needed setup for the data structures to call other functions
// Returns any error which occurs in setup
Initialize(ctx context.Context, client *ethclient.Client) error
// LPTokenPrice returns the current price of the protocol's LP token
// in USD.
// Returns an error if the price cannot be determined.
LPTokenPrice(ctx context.Context) (string, error)
// TVL returns the Total Value Locked in the protocol in USD.
// Returns an error if the TVL cannot be determined.
TVL(ctx context.Context) (string, error)
// UpdateBlock sets the internal block and priceMap state to different time
// If the protocol doesn't need a price map the second param can be nil
UpdateBlock(block *big.Int, prices map[string]Price)
}
Protocol defines methods for querying DeFi protocol metrics. Implementations must be safe for concurrent use.
type WasabeeConfig ¶ added in v0.1.17
type WasabeeConfig struct {
Token0 string `json:"token0"`
Token1 string `json:"token1"`
LPTDecimals uint `json:"lpt_decimals"`
}
WasabeeConfig defines the configuration for Wasabee adapter
type WasabeeLPPriceProvider ¶ added in v0.1.17
type WasabeeLPPriceProvider struct {
// contains filtered or unexported fields
}
WasabeeLPPriceProvider defines the provider for Wasabee LP price and TVL.
func NewWasabeeLPPriceProvider ¶ added in v0.1.17
func NewWasabeeLPPriceProvider( address common.Address, block *big.Int, prices map[string]Price, logger zerolog.Logger, config []byte, ) *WasabeeLPPriceProvider
NewWasabeeLPPriceProvider creates a new instance of the WasabeeLPPriceProvider.
func (*WasabeeLPPriceProvider) GetConfig ¶ added in v0.1.17
func (w *WasabeeLPPriceProvider) GetConfig(ctx context.Context, address string, client *ethclient.Client) ([]byte, error)
GetConfig returns the configuration for the Wasabee adapter.
func (*WasabeeLPPriceProvider) Initialize ¶ added in v0.1.17
Initialize checks the configuration/data provided and instantiates the Wasabee smart contract.
func (*WasabeeLPPriceProvider) LPTokenPrice ¶ added in v0.1.17
func (w *WasabeeLPPriceProvider) LPTokenPrice(ctx context.Context) (string, error)
LPTokenPrice returns the current price of the protocol's LP token in USD.
func (*WasabeeLPPriceProvider) TVL ¶ added in v0.1.17
func (w *WasabeeLPPriceProvider) TVL(ctx context.Context) (string, error)
TVL returns the Total Value Locked in the protocol in USD.
func (*WasabeeLPPriceProvider) UpdateBlock ¶ added in v0.1.18
func (w *WasabeeLPPriceProvider) UpdateBlock(block *big.Int, prices map[string]Price)
type WasabiConfig ¶ added in v0.1.14
type WasabiLPPriceProvider ¶ added in v0.1.14
type WasabiLPPriceProvider struct {
// contains filtered or unexported fields
}
WasabiLPPriceProvider defines the provider for Wasabi Token price and TVL.
func NewWasabiLPPriceProvider ¶ added in v0.1.14
func NewWasabiLPPriceProvider( address common.Address, block *big.Int, prices map[string]Price, logger zerolog.Logger, config []byte, ) *WasabiLPPriceProvider
NewWasabiLPPriceProvider creates a new instance of the WasabiLPPriceProvider.
func (*WasabiLPPriceProvider) Initialize ¶ added in v0.1.14
Initialize checks the configuration/data provided and instantiates the Wasabi smart contract.
func (*WasabiLPPriceProvider) LPTokenPrice ¶ added in v0.1.14
func (w *WasabiLPPriceProvider) LPTokenPrice(ctx context.Context) (string, error)
func (*WasabiLPPriceProvider) TVL ¶ added in v0.1.14
func (w *WasabiLPPriceProvider) TVL(ctx context.Context) (string, error)
func (*WasabiLPPriceProvider) UpdateBlock ¶ added in v0.1.18
func (w *WasabiLPPriceProvider) UpdateBlock(block *big.Int, prices map[string]Price)
type WeberaConfig ¶ added in v0.1.19
type WeberaLPPriceProvider ¶ added in v0.1.19
type WeberaLPPriceProvider struct {
// contains filtered or unexported fields
}
WeberaLPPriceProvider defines the provider for Webera Token price and TVL.
func NewWeberaLPPriceProvider ¶ added in v0.1.19
func NewWeberaLPPriceProvider( address common.Address, block *big.Int, prices map[string]Price, logger zerolog.Logger, config []byte, ) *WeberaLPPriceProvider
NewWeberaLPPriceProvider creates a new instance of the WeberaLPPriceProvider.
func (*WeberaLPPriceProvider) Initialize ¶ added in v0.1.19
Initialize checks the configuration/data provided and instantiates the WeBera smart contract.
func (*WeberaLPPriceProvider) LPTokenPrice ¶ added in v0.1.19
func (w *WeberaLPPriceProvider) LPTokenPrice(ctx context.Context) (string, error)
func (*WeberaLPPriceProvider) TVL ¶ added in v0.1.19
func (w *WeberaLPPriceProvider) TVL(ctx context.Context) (string, error)
func (*WeberaLPPriceProvider) UpdateBlock ¶ added in v0.1.19
func (w *WeberaLPPriceProvider) UpdateBlock(block *big.Int, prices map[string]Price)
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
test/aquabera
command
|
|
|
test/beraborrow
command
|
|
|
test/bex
command
|
|
|
test/bexv2
command
|
|
|
test/bulla
command
|
|
|
test/burrbear
command
|
|
|
test/d8x
command
|
|
|
test/dolomite
command
|
|
|
test/kodiak
command
|
|
|
test/wasabee
command
|
|
|
test/wasabi
command
|
|
|
test/webera
command
|
|
|
internal
|
|