MarketETHRouter
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
market
weth
Write Methods
borrow
Unwraps WETH from the floating pool and borrows to caller.
Parameters
Name | Type | Description |
---|---|---|
assets | uint256 | amount of assets to borrow. |
Returns
Name | Type | Description |
---|---|---|
borrowShares | uint256 | number of borrowed shares. |
borrowAtMaturity
Unwraps WETH from a maturity and borrows to caller.
Parameters
Name | Type | Description |
---|---|---|
maturity | uint256 | maturity date for repayment. |
assets | uint256 | amount to be sent to caller. |
maxAssetsAllowed | uint256 | maximum amount of debt that the caller is willing to accept. |
Returns
Name | Type | Description |
---|---|---|
assetsOwed | uint256 | total amount of assets (principal + fee) to be repaid at maturity. |
deposit
Wraps ETH and deposits WETH into the floating pool's market.
Returns
Name | Type | Description |
---|---|---|
shares | uint256 | number of minted shares. |
depositAtMaturity
Wraps ETH and deposits to a maturity.
Parameters
Name | Type | Description |
---|---|---|
maturity | uint256 | maturity date where the assets will be deposited. |
minAssetsRequired | uint256 | minimum amount of assets required by the caller for the transaction to be accepted. |
Returns
Name | Type | Description |
---|---|---|
maturityAssets | uint256 | total amount of assets (principal + fee) to be withdrawn at maturity. |
redeem
Unwraps WETH from the floating pool and withdraws to caller.
Parameters
Name | Type | Description |
---|---|---|
shares | uint256 | amount of shares to be burned in exchange of assets. |
Returns
Name | Type | Description |
---|---|---|
assets | uint256 | amount of assets withdrawn. |
refund
Wraps ETH and repays to the floating pool.
Parameters
Name | Type | Description |
---|---|---|
borrowShares | uint256 | shares to be subtracted from the caller's debt. |
Returns
Name | Type | Description |
---|---|---|
repaidAssets | uint256 | number of repaid assets. |
actualShares | uint256 | number of borrowed shares subtracted from the debt (can be lower than |
repay
Wraps ETH and repays to the floating pool.
Parameters
Name | Type | Description |
---|---|---|
assets | uint256 | amount of assets to repay. |
Returns
Name | Type | Description |
---|---|---|
repaidAssets | uint256 | number of repaid assets (can be lower than |
borrowShares | uint256 | number of borrowed shares subtracted from the debt. |
repayAtMaturity
Wraps ETH and repays to a maturity.
Parameters
Name | Type | Description |
---|---|---|
maturity | uint256 | maturity date where the assets will be repaid. |
assets | uint256 | amount to be paid for the caller's debt. |
Returns
Name | Type | Description |
---|---|---|
repaidAssets | uint256 | the actual amount that was transferred into the Market. |
withdraw
Unwraps WETH from the floating pool and withdraws to caller.
Parameters
Name | Type | Description |
---|---|---|
assets | uint256 | amount of assets to withdraw. |
Returns
Name | Type | Description |
---|---|---|
shares | uint256 | number of burned shares. |
withdrawAtMaturity
Unwraps WETH from a maturity and withdraws to caller.
Parameters
Name | Type | Description |
---|---|---|
maturity | uint256 | maturity date where the assets will be withdrawn. |
assets | uint256 | position size to be reduced. |
minAssetsRequired | uint256 | minimum amount required by the caller (if discount included for early withdrawal). |
Returns
Name | Type | Description |
---|---|---|
actualAssets | uint256 | amount of assets withdrawn (can include a discount for early withdraw). |
Last updated