Blur Integration - #371
Conversation
| } | ||
|
|
||
| /// @inheritdoc IPoolParameters | ||
| function enableBlurExchange() external onlyPoolAdmin { |
There was a problem hiding this comment.
I suggest using different names for these. as we are not really enabling the actual exchange
| request.borrowAmount, | ||
| timeLockParams | ||
| ); | ||
| IWETH(weth).withdraw(request.borrowAmount); |
There was a problem hiding this comment.
can't we transfer weth directly? might save us one transfer
| // currency token. address(0) means ETH | ||
| address paymentToken; | ||
| // cash amount from user wallet | ||
| uint256 listingPrice; |
| Errors.INVALID_REQUEST_STATUS | ||
| ); | ||
|
|
||
| address keeper = ps._blurExchangeKeeper; |
There was a problem hiding this comment.
could we not to check “msg.sender == keeper” to save some gas.
| address nTokenAddress = nftReserve.xTokenAddress; | ||
| // no time lock needed here | ||
| DataTypes.TimeLockParams memory timeLockParams; | ||
| (, uint64 collateralizedBalance) = INToken(nTokenAddress).burn( |
There was a problem hiding this comment.
if the nToken is in auction , will revert.
| .getParams(); | ||
| // ensure user can't borrow/withdraw with the new mint nToken | ||
| require( | ||
| request.listingPrice >= floorPrice.percentMul(liquidationThreshold), |
There was a problem hiding this comment.
- user init buy from blur which have high boost token id (set require.listingprice = nToken floor price * LS)
- user get more borrow limit : nToken floor price * boost *LTV - nToken floor price * LS
- user can borrow more money.
|
|
||
| //mint debt token | ||
| if (totalBorrow > 0) { | ||
| BorrowLogic.executeBorrow( |
There was a problem hiding this comment.
should we do transferUnderlyingTo before executeBorrow ? since the borrow use rate is not correct in updateInterestRates now.
borrow use rate = total debt / (balance (pToken contract) + total debt)
balance (pToken contract) should subtract the totalBorrow
| request.tokenId | ||
| ); | ||
|
|
||
| return request.listingPrice + requestFee - request.borrowAmount; |
There was a problem hiding this comment.
Can we save some gas if calculate needCashETH first and sent into validateInitiateBlurExchangeRequest ?
* chore: basic implementation for BLUR sell * chore: fix typo * chore: check ape pair staking and gas optimization * chore: check owner and fix interest rate issue * chore: keeper fulfill request with ETH * chore: fix updating wrong status * chore: forbid initiate request for uniswapV3 and stakeFish
Security Checklist
Make sure to think about each of these exploits in this PR.