parameter: amount, the number underlying tokens to lend in order to receive and hold corresponding asset tokens
returns: the number of asset tokens received
This function is called hold so that it is appropriate both for interest-bearing assets (which are typically acquired by depositing an underlying token such as DAI or USDC in an interest-generating protocol) as well as for non-interest-bearing assets such as WETH or UNI who's value a saver may way to protect with insurance.
getCostOfAsset
Calculates the amount of underlying tokens needed to receive and hold a certain amount of asset tokens
parameter: amount, the number of asset tokens for which the underlying token cost will be calculated
returns: the number of underlying tokens needed to receive and hold a certain amount of asset tokens
This function will typically only apply to interest-bearing assets, where the cost is the amount of underlying token (such as DAI or USDC) needed to deposit into the interest-generating protocol in order to receive the amount of interest-bearing tokens.
withdraw
Withdraws underlying tokens in exchange for the asset tokens.
parameter: amount, the number of asset tokens to redeem in exchange for the underlying tokens
returns: the amount of underlying tokens withdrawn
withdrawReward
Withdraws rewards or governance tokens that have been yielded from the adapter's lending protocol (e.g., COMP tokens yielded from lending to the Compound protocol via the CompoundAdapter).
returns: the number of rewards or governance tokens withdrawn
getRewardsBalance
Returns the balance of rewards or governance tokens that have been yielded from the adapter's lending protocol (e.g., COMP tokens yielded from lending to the Compound protocol via the CompoundAdapter).
returns: the balance of rewards or governance tokens that have accrued
transfer
Handles transferring the asset tokens from a rewards farmer proxy to a recipient's rewards farmer proxy in the event a SaveToken holder wishes to transfer their SaveTokens.
parameter: recipient, The address receiving the asset tokens in their rewards farmer proxy
parameter: amount, The number of asset tokens to transfer
returns: true if executed successfully
transferFrom
Handles transferring the asset tokens from a rewards farmer proxy to a recipient's rewards farmer proxy in the event a SaveToken holder wishes to transferFrom their SaveTokens
parameter: sender, The address sending the asset tokens from their rewards farmer proxy
parameter: recipient, The address receiving the asset tokens in their rewards farmer proxy
parameter: amount, The number of asset tokens to transfer