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

Further fixes #316

Merged
merged 4 commits into from
Nov 8, 2023
Merged

Further fixes #316

merged 4 commits into from
Nov 8, 2023

Conversation

0xdomrom
Copy link
Contributor

@0xdomrom 0xdomrom commented Nov 8, 2023

Summary

  • guardrail added for spot diff feeds, constant cap of +/-10% of spot at the time of result being returned.

Will limit any sort of unexpected results in the perp marking.

  • guardrail for maxExpiry added to forward feed only (more relevant to interest rate but the SM doesn't query that feed).

There can be potential exploit if you have some very long dated options (i.e. 2 year+) and interest rates are high, so adding a cap to ensure that cannot happen

  • changing auction bidding to be on % of current portfolio, instead on % of original.

You run into issues around cash (i.e. funding) changing the account making it hard to actually compute the max_f properly. Means we can remove tracking "percentLiquidated" and everything is just done based on the current portfolio (no reliance on previous steps). Simplifies the logic a bit which is nice.

  • related to auctions; removing allowing ANY transfers (besides getting liquidated and funding/interest being applied) when undergoing an auction.

Reasoning is: we were already blocking anything but cash. As the user getting liquidated you can liquidate your portfolio yourself -> merge to get the same effect as adding cash up to BM. You would also lose more money by donating to your portfolio and not ending auction rather than bidding on the portfolio

@0xdomrom 0xdomrom changed the title Feat/further fixes Further fixes Nov 8, 2023
@0xdomrom 0xdomrom merged commit f21f3e1 into master Nov 8, 2023
@0xdomrom 0xdomrom deleted the feat/further-fixes branch November 8, 2023 04:17
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 this pull request may close these issues.

1 participant