block-quote On this pagechevron-down
copy Copy chevron-down
Guides chevron-right ⚙️ ProtocolMarketETHRouter To be used by Exactly’s web-app, so accounts can operate with ETH on MarketWETH .
Wraps ETH or unwraps WETH before and after interacting with MarketWETH . It saves one step for the user.
Public State Variables
Copy function market () external view returns ( contract Market )
Copy function weth () external view returns ( contract WETH
Copy function borrow ( uint256 assets ) external nonpayable returns ( uint256 borrowShares ) Unwraps WETH from the floating pool and borrows to caller.
Parameters
amount of assets to borrow.
Returns
number of borrowed shares.
borrowAtMaturity
Unwraps WETH from a maturity and borrows to caller.
Parameters
maturity date for repayment.
amount to be sent to caller.
maximum amount of debt that the caller is willing to accept.
Returns
total amount of assets (principal + fee) to be repaid at maturity.
Wraps ETH and deposits WETH into the floating pool's market.
Returns
depositAtMaturity
Wraps ETH and deposits to a maturity.
Parameters
maturity date where the assets will be deposited.
minimum amount of assets required by the caller for the transaction to be accepted.
Returns
total amount of assets (principal + fee) to be withdrawn at maturity.
Unwraps WETH from the floating pool and withdraws to caller.
Parameters
amount of shares to be burned in exchange of assets.
Returns
amount of assets withdrawn.
Wraps ETH and repays to the floating pool.
Parameters
shares to be subtracted from the caller's debt.
Returns
number of borrowed shares subtracted from the debt (can be lower than borrowShares).
Wraps ETH and repays to the floating pool.
Parameters
amount of assets to repay.
Returns
number of repaid assets (can be lower than assets).
number of borrowed shares subtracted from the debt.
repayAtMaturity
Wraps ETH and repays to a maturity.
Parameters
maturity date where the assets will be repaid.
amount to be paid for the caller's debt.
Returns
the actual amount that was transferred into the Market.
Unwraps WETH from the floating pool and withdraws to caller.
Parameters
amount of assets to withdraw.
Returns
withdrawAtMaturity
Unwraps WETH from a maturity and withdraws to caller.
Parameters
maturity date where the assets will be withdrawn.
position size to be reduced.
minimum amount required by the caller (if discount included for early withdrawal).
Returns
amount of assets withdrawn (can include a discount for early withdraw).