ConvexCrvLp
Last updated
Last updated
withdrawToConvexDepositTokens
Withdraws all tokens from reward contract.
withdrawToWrappedTokens
Withdraws all tokens from reward contract and unwraps them.
claimWantTokens
Transfers unwrapped want tokens to governance. Can be only called by governance.
claimWrappedWantTokens
Transfers wrapped want tokens to governance. Can be called only by governance.
claimRewardTokens
Transfers reward tokens (crv and cvx) to governance. Can be called only by governance.
name
Returns string representation of abi file of the wanted wrapped token symbol.
Return value:
calc_want_from_wrapped
If amount of want tokens is greater than 0 returns calculated amount of wrapped tokens.
Parameters:
Return value:
unwrap
Returns amount of wanted tokens after unwrapping and removes wrapped amount from curve's pool.
Parameters:
Return value:
balanceOfWant
Returns balance of want tokens from the caller of the contract.
Return value:
estimatedTotalAssets
Returns amount of total wrapped and want tokens.
Parameters:
adjustPosition
Calculates total available tokens and if it's greater than the minimum debt it wraps the want tokens and deposits them to booster.
Parameters:
_withdrawSome
Withdraws and unwraps reward amount and returns new balance of wrapped tokens after withdraw.
Parameters:
Return value:
liquidatePosition
Returns liquidated amount and loss, if balance is less than amount needed to withdraw, loss is calculated for further actions (throwing an error for example).
Parameters:
Return value:
prepareMigration
Withdraws and unwraps all the reward tokens, migrates rewards based on new strategy and transfers balance of wrapped tokens to the want wrapped token pool.
Parameters:
_migrateRewards
Transfers all the curve and convex tokens from this contract's pool to their pool's address.
Parameters:
_claimableBasicInETH
Takes curve amount from this pool, calculates convex amount based on it, afterwards calculates convex and curve's value and returns their sum when swapped to ETH.
Return value:
claimableInETH
Returns claimable value.
Return value:
harvestTrigger
Decides whether harvest should be triggered based on numerous factors (minReportDelay, maxReportDelay, totalDebt...), returns true if yes, false if not.
Parameters:
Return value:
harvest
Harvests the Strategy, recognizing any profits or losses and adjusting the Strategy's position. In rare cases the Strategy is in emergency shutdown, this will exit the Strategy's position. This may only be called by governance, the strategist, or the keeper.
Events emitted:
Harvested(want_profit, want_loss, want_debtPayment, debtOutstanding)
withdraw
Withdraws _amountNeeded (represented in wrapped tokens) to specific vault. This may only be called by the Vault.
Parameters:
Return value:
sweep
Removes tokens from this Strategy that are not the type of tokens managed by this Strategy. This may be used in case of accidentally sending the wrong kind of token to this Strategy. Tokens will be sent to governance. This will fail if an attempt is made to sweep want
, or any tokens that are protected by this Strategy. This may only be called by governance.
Parameters:
string memory
Symbol of wanted wrapped token
wrapped_amount
uint256
Amount of wrapped tokens to be calculated
expected_return
uint256
Amount of want tokens calculated from wrapped
wrapped_amount
uint256
Amount of wrapped tokens to be unwrapped
expected_return
uint256
Amount of tokens after unwrapping
uint256
Amount of want tokens
uint256
Amount of total wrapped and want tokens
uint256
Value of the unwrapped token
_amount
uint256
Amount of tokens to withdraw
uint256
Balance of wrapped tokens after withdraw
_amountNeeded
uint256
Amount of wrapped tokens to be liquidated
_liquidatedAmount
uint256
Amount of liquidated tokens
_loss
uint256
Loss after liquidating (should be 0, o/w error)
_newStrategy
address
New strategyโs vault address
_newStrategy
address
Strategyโs vault address
uint256
Sum of convex and curve tokens swapped to eth
_claimable
uint256
Amount of claimable ETH tokens
callCost
uint256
Fee for triggering harvest
bool
True if harvest should be done, false if not
_amountNeeded
uint256
Amount to withdraw of wrapped tokens
_loss
uint256
Any losses produced by withdrawing
_token
address
Address of token that should be removed from strategy