ConvexAIEth
calc_wrapped_from_want
calc_wrapped_from_want
Calculates amount of want tokens after wrapping.
Parameters:
want_amount
uint256
Amount of want tokens
Return value:
uint256
Amount of wrapped tokens after calculation
unwrap
unwrap
If wrapped amount is greater than 0, remove wrapped amount from curve's liquidity and deposit balance of the contract to the wrapped ethereum.
Parameters:
wrapped_amount
uint256
Amount of wrapped tokens to unwrap
Return value:
result_val
uint256
Amount of tokens after unwrapping
wrap
wrap
Calculates wrapped amount from want amount, removes wrapped tokens from wrapped ethereum and after converting them, deposits them to the curve's pool.
Parameters:
want_amount
uint256
Amount of want tokens to wrap
Return value:
expected_return
uint256
Amount of tokens after wrapping
prepareReturn
prepareReturn
Calculates curve and convex tokens and swaps them to ETH, sells extra rewards, after that is done, calculates and returns value of profit, loss and dept payment.
Parameters:
_debtOutstanding
uint256
Debt value
Return value:
_profit
uint256
Amount of profit made
_loss
uint256
Amount of loss
_debtPayment
uint256
Amount of debt to be payed
Last updated