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

YIP-0006-margin-zones #124

Open
pkucherenk0 opened this issue Nov 20, 2023 · 3 comments
Open

YIP-0006-margin-zones #124

pkucherenk0 opened this issue Nov 20, 2023 · 3 comments
Assignees
Labels
enhancement New feature or request question Further information is requested

Comments

@pkucherenk0
Copy link
Contributor

  1. I assume that only NeoDAX is allowed to configure zone, that will work with Terminal. What about zones from NeoDAX to NeoDAX, who's zone will be selected?
  2. I do not think that we should allow to configure the margin zone, at least at the start. it's a config we want to avoid. So we can define it now to keep us safe and update later on.
  3. If configuring is accepted, then it has to be one of the connections to the peer parameter, with an issue in point 1 of this list.
  4. The zone should not be possible to change during the active trade period as it is abusive behavior, so notification about the change of the zone is not essential.
  5. Both Yellow and Red zones mentioned that trades are not allowed, but I think it is about orders. How we will decline order matching into a trade if there are open orders already? I suggest that the yellow zone does not allow to creation of new orders and the red zone cancels all before settlement, but we need to give it more thought for sure.
  6. The yellow zone allows the user to select what to settle, but the settle outcome should result in a green zone.
@pkucherenk0 pkucherenk0 added the question Further information is requested label Nov 20, 2023
@nksazonov nksazonov added the enhancement New feature or request label Nov 21, 2023
@nksazonov
Copy link
Contributor

nksazonov commented Nov 21, 2023

Thank you for the questions!

  1. I assume that only NeoDAX is allowed to configure zone, that will work with Terminal. What about zones from NeoDAX to NeoDAX, who's zone will be selected?

Margin zones limits are configurable on both ends. This is alike other parameters as a challenge duration or margin limits.

Margin distribution consists of 2 parts: your margin and the counterparty's one. The margin distribution channel is opened with is called deposited margin distrubition and the corresponding margin parts are called your deposited margin the counterparty's deposited margin. Your margin zones limits apply to your deposited margin and margin zones thresholds are calculated. E.g. if your margin zones limits are yellow: 25%, red: 10% and your deposited margin is $10 000, then your margin zones thresholds are the following: green: (∞, 2 500], yellow: (2 500, 1 000], red: (1 000, 0]. When your part of margin distribution is in the yellow or red zone, then the whole margin distribution is in the corresponding zone. However, if your margin is in the green zone, this does not guarantee that the margin distribution is in green zone, as the counterparty's margin may be in the yellow or red zone, in which case the margin distribution will be in the yellow or red zone.

Thus, the rule of thumb is: if your margin is not in a green zone, then the whole margin distribution is in the same zone as your margin. Otherwise (your margin is in green zone), the margin distribution zone equals to your counterparty's one.


  1. I do not think that we should allow to configure the margin zone, at least at the start. it's a config we want to avoid. So we can define it now to keep us safe and update later on.

I agree. The YIP 0006 does not state that we should give the participants an ability to configure their own margin zones limits at the start.


  1. If configuring is accepted, then it has to be one of the connections to the peer parameter, with an issue in point 1 of this list.

See Answer 1.


  1. The zone should not be possible to change during the active trade period as it is abusive behavior, so notification about the change of the zone is not essential.

The active trading indeed could not change the margin zone, however, as time passes, the price of assets in our portfolio may change significantly, which may cause a margin zone change. If the price continues to move not in your favour, your trades may become undercollateralized, which is critical and our protocol should not allow it. Therefore, users should be notified when the margin is in the yellow zone for them to prepare for the settlement, and that the margin is in the red zone and the Forced settlement has already started to change margin distribution zone to the green one, so they are able to continue trading.


  1. Both Yellow and Red zones mentioned that trades are not allowed, but I think it is about orders. How we will decline order matching into a trade if there are open orders already? I suggest that the yellow zone does not allow to creation of new orders and the red zone cancels all before settlement, but we need to give it more thought for sure.

You are correct, what is meant in the YIP 0006 is that in the yellow and red zones order creation is not allowed. I don't think it is neccessary for the red zone to cancel orders, as the Clearport will start Forced settlement in an instant. Nevertheless, @dpatsora mentioned, that a participant may not have assets on hand to settle a trade, therefore a more elaborate red zone reaction should be thought of.


  1. The yellow zone allows the user to select what to settle, but the settle outcome should result in a green zone.

That is correct and is specified in YIP 0008 - Settlement.

@pkucherenk0
Copy link
Contributor Author

pkucherenk0 commented Nov 22, 2023

1.1 So what you are saying is that the margin zone indicator is like a pressure meter that is mirroring the counterparty. If one is in Yellow, another one is in yellow too.
4.4 I understood the confusion about changing margin zones. I thought about changing margin zones meant to change the % where green goes to yellow and red.
5.5 I assume the logical way would be to settle in collateral if the prior notification about red yellow- red zone is ignored

@mod
Copy link
Contributor

mod commented Nov 22, 2023

In the correct non-custodial case, end-user can't auto-settle, a warning should be displayed to notify user he must settle.

Also the YIP should cover the liquidation points in the wining side.

Since both side apply haircut the middle is not the liquidation point.

Rather there is a small overlap

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants