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

Max Collateral Share #1093

Closed
3 of 9 tasks
robert-zaremba opened this issue Jul 4, 2022 · 0 comments · Fixed by #1329
Closed
3 of 9 tasks

Max Collateral Share #1093

robert-zaremba opened this issue Jul 4, 2022 · 0 comments · Fixed by #1329
Assignees
Milestone

Comments

@robert-zaremba
Copy link
Member

robert-zaremba commented Jul 4, 2022

Summary

Limit exposure to a single token collateral.

Problem Definition

Today, we only limit which tokens can be used as a collateral, but we don't protect the system to be exposed too much to any of the allowed tokens. This can lead to a recent Solend problem: https://decrypt.co/103489/solend-whale-108m-loan-nearly-crashed-solana

Proposal

Add MaxCollateralShare parmeter to the token registry. It should be a value in basis point describing the maximum use of a given token as a collateral. In any given moment, for every token t

total_collateral(t) / total_collateral() <= max_collateral_share(t)

Where total_collateral() is a sum of USD value of all tokens collaterized in the system.

NOTE:

There might also be restrictions on MsgRemoveCollateral of token B, if removing token B would cause token A to exceed 20% of system collateral value.

This is a good and valid point. The restriction will only hold when adding a collateral.


For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned
@robert-zaremba robert-zaremba added this to the v3 milestone Jul 4, 2022
@robert-zaremba robert-zaremba self-assigned this Jul 4, 2022
@robert-zaremba robert-zaremba modified the milestones: v3, Calypso Jul 4, 2022
@toteki toteki changed the title Max Collateral Supply Max Collateral Share Jul 5, 2022
@robert-zaremba robert-zaremba removed their assignment Jul 12, 2022
@toteki toteki self-assigned this Aug 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment