BeefyVeloVaultRelayer

Git Source

Inherits: IBaseOracle, IBeefyVeloVaultRelayer

Deconstructs a Beefy Vault to it's Velodrome liquidity pool and that pool's constituent tokens to return a price feed

Requires an underlying Velodrome pool and price feeds for the pool's tokens

State Variables

token0priceSource

Address of the token0 price source that is used to calculate the price

Assumes that the price source is a valid IBaseOracle

IBaseOracle public token0priceSource;

token1priceSource

Address of the token1 price source that is used to calculate the price

Assumes that the price source is a valid IBaseOracle

IBaseOracle public token1priceSource;

beefyVault

Address of the beefy vault

Assumes that the beefy vault is a valid IBeefyVaultV7

IBeefyVaultV7 public beefyVault;

veloPool

Address of the velo pool underlying the beefy vault

Assumes that the price source is a valid IVeloPool

IVeloPool public veloPool;

symbol

Symbol of the quote: token / baseToken (e.g. 'ETH / USD')

string public symbol;

Functions

constructor

constructor(
  IBaseOracle _token0priceSource,
  IBaseOracle _token1priceSource,
  IBeefyVaultV7 _beefyVault,
  IVeloPool _veloPool
);

Parameters

NameTypeDescription
_token0priceSourceIBaseOracleAddress of the price source for the first token in the velo pool
_token1priceSourceIBaseOracleAddress of the price source for the second token in the velo pool
_beefyVaultIBeefyVaultV7The address of the beefy vault contract
_veloPoolIVeloPoolThe address of the velo pool underlying the beefy vault

getResultWithValidity

Fetch the latest oracle result and whether it is valid or not

This method should never revert

function getResultWithValidity() external view returns (uint256 _result, bool _validity);

read

Fetch the latest oracle result

Will revert if is the price feed is invalid

function read() external view returns (uint256 _result);

_getCombinedPriceValue

Returns the combined price of the two tokens in the velo pool

function _getCombinedPriceValue(
  uint256 _token0priceSourceValue,
  uint256 _token1priceSourceValue
) internal view returns (uint256 _combinedPriceValue);