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

Price monitoring to use new mark price methodologies #2116

Closed
davidsiska-vega opened this issue Jan 11, 2024 · 11 comments · Fixed by #2121
Closed

Price monitoring to use new mark price methodologies #2116

davidsiska-vega opened this issue Jan 11, 2024 · 11 comments · Fixed by #2121
Assignees

Comments

@davidsiska-vega
Copy link
Contributor

We need to update price monitoring to respect the new mark price methodologies and use that instead of its of trade price vwap.

Do we want to allow “mark price out of bounds” to trigger an auction too (at the moment it’s trade out of bounds that will)?

@witgaw
Copy link
Contributor

witgaw commented Jan 11, 2024

I'd stick with just trades, so that it keeps monitoring only market participants reactions to the outside world, not components of the outside world themselves.

@davidsiska-vega
Copy link
Contributor Author

davidsiska-vega commented Jan 11, 2024

I'd stick with just trades, so that it keeps monitoring only market participants reactions to the outside world, not components of the outside world themselves.

So if the mark price is from

  • an oracle which gets manipulated: you will get closed out. A monitoring auction won't save you because there won't be one. That's acceptable to me - but it would be worth carrying as a known risk.
  • order book which gets manipulated without trades - think one LP - you can get closed out and no monitoring auction will be triggered. Is that still an acceptable risk?

@barnabee
Copy link
Member

barnabee commented Jan 11, 2024

I'm concerned that this neutralises the "circuit breaker" element of price monitoring. Do we have any idea what others (if any relevant others have circuit breakers) might do?

Also seems like you could configure mark price in such as way as to get a closeout at a price that, as mark price, would not have triggered the closeout which feels… wrong?

It seems like maybe mark price ought to maybe be allowed to trigger a PM auction at least if it would otherwise cause a liquidation?

edit: only triggering PM if there would be a closeout if 100% a bad plan

@davidsiska-vega
Copy link
Contributor Author

It seems like maybe mark price ought to maybe be allowed to trigger a PM auction at least if it would otherwise cause a liquidation?

I don't feel this is sufficient. Imagine you shift the order book (or manipulate the oracle), get a big MTM cashflow, move the settlement asset wins from general to a different key and then let the manipulated oracle swing back?

Or maybe we're overthinking this and we should do what @witgaw says. And you should not rely on a oracle for mark price unless you trust it and you should not use the order book for mark price on its own (you can still e.g. median oracle, order book, last trade) BUT the price monitoring protections only apply if the mark price comes from trades. If you configured the market some other way, that's on you.

@barnabee
Copy link
Member

barnabee commented Jan 11, 2024

I am leaning towards mark price can always trigger a price monitoring auction if it's out of bounds.

Given that a bad price swing + MTM that doesn't close you out can cause a closeout in another market under cross margining.

@davidsiska-vega
Copy link
Contributor Author

I am leaning towards mark price can always trigger a price monitoring auction if it's out of bounds.

How are the bounds defined? Is the reference older mark price values or vwap of trade prices like now.

@barnabee
Copy link
Member

barnabee commented Jan 11, 2024

Possibly has to incorporate mark price too. I think the PM system likely has to be aligned to whatever is being used to calculate MTM cash flows or it may not really work.

IDK what to do with the volume weighted bit. Maybe have to fall back to TWAP?

@davidsiska-vega
Copy link
Contributor Author

davidsiska-vega commented Jan 11, 2024

IDK what to do with the volume weighted bit. Maybe have to fall back to TWAP?

I think we should leave the current PM setup in place when the current mark price methodology is used (as we're keeping it).

When someone selects the new methodology then:

  1. bounds are derived from mark price
  2. a PM auction is triggered if a trade would be out of bounds
  3. a PM auction is are triggered if mark price would be out of bounds (in that case don't update mark price, let auction run and finish and then update mark price).

@barnabee
Copy link
Member

Agree with that.

@witgaw
Copy link
Contributor

witgaw commented Jan 11, 2024

Sounds sensible to me. So I guess we no longer need a condition for there to be a trade in the opening auction (though maybe it's a useful indication of there being any sensible level of interest in the market anyway).

@davidsiska-vega
Copy link
Contributor Author

So I guess we no longer need a condition for there to be a trade in the opening auction (though maybe it's a useful indication of there being any sensible level of interest in the market anyway).

I'd keep that as it's a bit of a running assumption all over the place - like now on some stop orders.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants