Skip to content
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

Implement lLTV tiers #42

Closed
MerlinEgalite opened this issue Jul 5, 2023 · 4 comments · Fixed by #73
Closed

Implement lLTV tiers #42

MerlinEgalite opened this issue Jul 5, 2023 · 4 comments · Fixed by #73
Assignees
Labels

Comments

@MerlinEgalite
Copy link
Contributor

MerlinEgalite commented Jul 5, 2023

Not all LLTVs can be opened. Similarly to UniV3's fee tiers, the governance lists a set of LLTVs (that can be expended but not reduced).

@MathisGD MathisGD changed the title Constrain lLTV Implement lLTV tiers Jul 5, 2023
@Rubilmax
Copy link
Collaborator

Rubilmax commented Jul 5, 2023

@MathisGD
Copy link
Contributor

MathisGD commented Jul 5, 2023

https://github.com/morpho-labs/blue/blob/63e8da9592869a8935a4dadba3b73063db19302f/src/MarketBase.sol#L20-L21

I had something like that in mind.

https://github.com/morpho-labs/blue/blob/63e8da9592869a8935a4dadba3b73063db19302f/src/MarketBase.sol#L47

So you check it for each interaction ? Isn't it more efficient to list markets, and then to check a slot that you would need to read in any case for each interaction.

As noted in the comment, it could be inlined with a bunch of if/else if the tranche spacing is immutable.

It will very probably not be, but good point yes.

@Rubilmax
Copy link
Collaborator

Rubilmax commented Jul 5, 2023

So you check it for each interaction ? Isn't it more efficient to list markets, and then to check a slot that you would need to read in any case for each interaction.

Indeed, adding a boolean flag to the storage to specific liquidationLtvs upon market creation would be cleaner and probably cheaper

@MathisGD MathisGD mentioned this issue Jul 5, 2023
Closed
@MerlinEgalite
Copy link
Contributor Author

Related to this discussion, and I'm for adding this into the createMarket function to remove gas overhead for users

@MerlinEgalite MerlinEgalite self-assigned this Jul 6, 2023
This was referenced Jul 6, 2023
@MerlinEgalite MerlinEgalite linked a pull request Jul 10, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants