YearnGaugeStrategy

Git Source

Inherits: BaseStrategy, CurveRouterSwapper, YearnGaugeStrategyBase

Strategy for interacting with Yearn Gauge

State Variables

_harvestSwapParams

Parameters for Curve swap used during harvest

CurveSwapParams internal _harvestSwapParams;

_dYfiRedeemer

Address of the contract that will be redeeming dYFI for YFI for this strategy

address private _dYfiRedeemer;

Functions

constructor

Initializes the YearnGaugeStrategy

constructor(
    address asset_,
    address yearnStakingDelegate_,
    address curveRouter_
)
    payable
    BaseStrategy(asset_, "Wrapped YearnV3 Strategy")
    CurveRouterSwapper(curveRouter_)
    YearnGaugeStrategyBase(asset_, yearnStakingDelegate_);

Parameters

NameTypeDescription
asset_addressThe address of the asset (gauge token)
yearnStakingDelegate_addressThe address of the YearnStakingDelegate
curveRouter_addressThe address of the Curve router

setHarvestSwapParams

Sets the parameters for the Curve swap used in the harvest function

function setHarvestSwapParams(CurveSwapParams calldata curveSwapParams) external onlyManagement;

Parameters

NameTypeDescription
curveSwapParamsCurveSwapParamsThe parameters for the Curve swap

setDYfiRedeemer

Sets the address of the contract that will be redeeming dYFI

function setDYfiRedeemer(address newDYfiRedeemer) external onlyManagement;

Parameters

NameTypeDescription
newDYfiRedeemeraddressThe address of the new dYFI redeemer contract

dYfiRedeemer

Get the address of the contract that will be redeeming dYFI from this strategy

function dYfiRedeemer() external view returns (address);

Returns

NameTypeDescription
<none>addressThe address of the dYFI redeemer contract

availableDepositLimit

Calculates the available deposit limit for the strategy

function availableDepositLimit(address) public view override returns (uint256);

Returns

NameTypeDescription
<none>uint256The strategy's available deposit limit

_deployFunds

Deploys funds into the YearnStakingDelegate by depositing the asset.

function _deployFunds(uint256 _amount) internal override;

Parameters

NameTypeDescription
_amountuint256The amount of the asset to deposit.

_freeFunds

Withdraws funds from the YearnStakingDelegate by withdrawing the asset.

function _freeFunds(uint256 _amount) internal override;

Parameters

NameTypeDescription
_amountuint256The amount of the asset to withdraw.

_emergencyWithdraw

Performs an emergency withdrawal from the YearnStakingDelegate, withdrawing the asset to the strategy.

function _emergencyWithdraw(uint256 amount) internal override;

Parameters

NameTypeDescription
amountuint256The amount to withdraw in case of an emergency.

_harvestAndReport

Harvests dYfi rewards, swaps YFI for the vault asset, and re-deposits or adds to idle balance

function _harvestAndReport() internal override returns (uint256 _totalAssets);

Returns

NameTypeDescription
_totalAssetsuint256The total assets after harvest and redeposit/idle balance update

Events

DYfiRedeemerSet

event DYfiRedeemerSet(address oldDYfiRedeemer, address newDYfiRedeemer);