Skip to content

Commit

Permalink
Update sip-390.md
Browse files Browse the repository at this point in the history
  • Loading branch information
kaleb-keny committed Jun 5, 2024
1 parent f2218af commit ba47df9
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions content/sips/sip-390.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,17 @@ created: 2024-06-05

<!--"If you can't explain it simply, you don't understand it well enough." Simply describe the outcome the proposed changes intends to achieve. This should be non-technical and accessible to a casual community member.-->

This sip proposes to incorporate into the minimum credit calculation the amount of `snxUSD` margin deposited into a given market by traders.
This sip proposes to incorporate into the minimum credit calculation the amount of snxUSD margin deposited into a given market by traders.

## Abstract

<!--A short (~200 word) description of the proposed change, the abstract should clearly describe the proposed change. This is what *will* be done if the SIP is implemented, not *why* it should be done or *how* it will be done. If the SIP proposes deploying a new contract, write, "we propose to deploy a new contract that will do x".-->

Some concepts covering this SIP:
- Credit capacity represents the total amount of USD that the market could withdraw if it were to immediately unwrap all its positions.
- Locked credit represents the minimum amount of delegated collateral that needs to be available to allows traders to withdraw their deposited margin and profits.
- Credit capacity represents the total amount of snxUSD that the market could withdraw if it were to immediately unwrap all its positions.
- Locked credit represents the minimum amount of delegated collateral that needs to be credited to a given market, in order to allows traders to withdraw from a given market.

The validation done in the [core of the system](https://github.com/Synthetixio/synthetix-v3/blob/cace699d1fb070042ca09a390c95548c31a5d025/protocol/synthetix/contracts/storage/Market.sol#L277) uses these concepts whereby `creditCapacityD18` is calculated by summing up the value of the delegated collateral of LP's **but also includes traders margin**. However, `lockedCredit` does not include the latter margin, resulting in the validation not covering the edge case where markets are not covered by enough collateral to cover traders' margin.
The validation done in the [core of the system](https://github.com/Synthetixio/synthetix-v3/blob/cace699d1fb070042ca09a390c95548c31a5d025/protocol/synthetix/contracts/storage/Market.sol#L277) uses these concepts whereby `creditCapacityD18` is calculated by summing up the value of the delegated collateral of LP's **but also includes traders margin**. However, `lockedCredit` does not include the latter margin amount, hence this sip.
Currently, minimum credit is calculated by iterating on over active markets, getting the active open interest and multiplying that by a `lockedOiRatio`, this gives insight information on the expected credit that needs to be catered for by LP's.

## Motivation
Expand All @@ -37,7 +37,7 @@ The minimum credit calculation update ensures that markets are sufficiently cove

<!--This is where you explain the reasoning behind how you propose to solve the problem. Why did you propose to implement the change in this way, what were the considerations and trade-offs. The rationale fleshes out what motivated the design and why particular design decisions were made. It should describe alternate designs that were considered and related work. The rationale may also provide evidence of consensus within the community, and should discuss important objections or concerns raised during discussion.-->

The original [validation](https://github.com/Synthetixio/synthetix-v3/blob/cace699d1fb070042ca09a390c95548c31a5d025/protocol/synthetix/contracts/storage/Market.sol#L278) did not take into account that traders' margin are included credit capacity. This patch only needs to be applied to, `snxUSD`, while other spot synths, deposited by traders are **not** included into `creditCapacity` calculation by the core system.
The original [validation](https://github.com/Synthetixio/synthetix-v3/blob/cace699d1fb070042ca09a390c95548c31a5d025/protocol/synthetix/contracts/storage/Market.sol#L278) did not take into account that traders' margin are included credit capacity. This patch only needs to be applied to, snxUSD, while other spot synths, deposited by traders are **not** included into `creditCapacity` calculation by the core system by default.


## Technical Specification
Expand Down

0 comments on commit ba47df9

Please sign in to comment.