-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Contango integration feedback #571
Comments
Thanks for the suggestions ! Here are some thoughts about them :
|
The problem on 3 is that we need to swap first to find out exactly how much collateral we have. This is due to externalising the swap calculation so that we can benefit from swap aggregator (we just receive the swapBytes to execte on the smart contract size) and very few aggregators supporting you to specify how much you want as the output of the swap |
Ok very clear, I understand how that would make it easier. In the end you still need to check for slippage though, so I assume that you at least have a ballpark of the collateral that you are getting. Additionally, adding a callback to |
Agree with @QGarchery's POV on 1. and 3. Closing this one and we let's discuss 2. directly in #570 |
Based on our efforts to integrate morpho blue, there are a few improvement points that were detected that would benefit us and other protocols integrating with you:
1. Expose a way to convert from shares to assets and vice versa when repaying debt
Even though we can go look at what you do in the code, import your lib and call the same functions, it feels very leaky having to dive this deep and import internal calculation libs when it could be a couple view endpoints.
e.g.
previewRepayWithAssets(assets) => shares
andpreviewRepayWithShares(shares) => assets
2. Allow flash loan to return data
Allow
flashLoan()
to return data so data can be passed back without using storagePR #570
3. Ability to to do a "flash borrow"
Introduce a callback on
borrow()
before checking for collateralisation ratio, therefore allowing for a transaction to borrow in advance, come up with collateral and then deposit.In our particular case, we'd save a flash loan operation and its involved gas costs.
e.g. Going long 1 ETHUSDC using 500 USDC as collateral when 1 ETH = 1000 USDC
Without flash borrow
With flash borrow
The text was updated successfully, but these errors were encountered: