Convex3crv
Last updated
Last updated
_approveBasic
Sets unlimited access for curve and booster to the wrapped token and IERC20 tokens.
_approveDex
Sets unlimited access for dex to curve and convex tokens.
calc_wrapped_from_want
Calculates amount of want tokens after wrapping.
Parameters:
Name | Type | Description |
---|---|---|
Return value:
Type | Description |
---|---|
wrap
Wraps tokens and adds them to Curve.
Parameters:
Return value:
prepareReturn
Checks whether convex and curve token amount is greater than 0, if so in dex swaps exact tokens of crv and cvx to tokens, checks whether dai, usdt and usdc amount is greater than 0, if yes, adds liquidity to curve's pool. Calculates profit, loss and debtPayment amount and returns them.
Parameters:
Return value:
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
want_amount
uint256
Amount of want tokens
uint256
Amount of wrapped tokens after calculation
want_amount
uint256
Amount of want tokens
expected_return
uint256
Amount of tokens after wrapping
_debtOutstanding
uint256
Debt value
_profit
uint256
Amount of profit made
_loss
uint256
Amount of loss
_debtPayment
uint256
Amount of debt to be payed