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

Better Vault Value checker interface #1201

Closed
DanielVF opened this issue Dec 9, 2022 · 2 comments
Closed

Better Vault Value checker interface #1201

DanielVF opened this issue Dec 9, 2022 · 2 comments
Assignees
Labels
contracts Works related to contracts enhancement New feature or request good first issue Good for newcomers P2 Small number of users are affected, major cosmetic issue planned In-scope at the beginning of the sprint

Comments

@DanielVF
Copy link
Collaborator

DanielVF commented Dec 9, 2022

Right now the vault vault checker, used to verify that no MEV has happened strategist allocations, the checks the upper and lower bound of allowed totalSupply and vaultValue. This is safe, and safer that what we had before, but has two disadvantages.

The metastrategy creates or removes large amounts of OUSD during moves in and out. The amount of these changes can be affected by other users in the curve pools, and can dwarf the actual profit and loss. Because of this, an unrelated trade in the OUSD/3pool can drastically change the amounts, and cause a previously valid strategist allocation transaction to fail the checks.

Secondly, the parameters are a little bit of a pain to check. For example, the last allocation looked like this:

(
-1378302004686863985848902,  // Low value change
-1376802004686863985848902,  // High value change
-1378399395878459980498569,  // Low supply change
-1376899395878459980498569,  // High supply change
)

This does show that we are thinking about roughly a 1.3 million reduction in supply from moving funds out of the metastrategy, but makes it extremely difficult to see the far more important expected profit/loss of the move, and is very sensitive to metastrategy changes.

An alternate API for the vault value checker might be:

(
-200, // Expect to lose 200 dollars on these allocations
100, // We are okay with a +- 100 dollar difference between expected and actual PL. 
-1,378,000, // Vault value is expected to go down by 1.3 million
100,000 // We are okay with a +- 100,000  on the expected combined vault value / total supply change.
)
@joshfraser
Copy link
Contributor

This is much more readable. 👍

@micahalcorn micahalcorn added the P2 Small number of users are affected, major cosmetic issue label Dec 9, 2022
@micahalcorn micahalcorn moved this from Backlog to To-do in Origin DeFi (OUSD + OETH) Dec 9, 2022
@micahalcorn micahalcorn added enhancement New feature or request good first issue Good for newcomers labels Dec 9, 2022
@micahalcorn micahalcorn added this to the Sprint 42 milestone Dec 26, 2022
@micahalcorn micahalcorn added the planned In-scope at the beginning of the sprint label Jan 17, 2023
@micahalcorn micahalcorn moved this from To-do to In progress in Origin DeFi (OUSD + OETH) Jan 17, 2023
@micahalcorn micahalcorn modified the milestones: Sprint 42, Sprint 43 Jan 19, 2023
@franckc franckc modified the milestones: Sprint 43, Sprint 44 Feb 1, 2023
@franckc franckc modified the milestones: Sprint 44, Sprint 45 Feb 16, 2023
@franckc franckc removed this from the Sprint 45 milestone Mar 3, 2023
@DanielVF
Copy link
Collaborator Author

This is live for OETH. Be good to go live with an OUSD version and switch to it.

@DanielVF DanielVF added the contracts Works related to contracts label May 23, 2023
@github-project-automation github-project-automation bot moved this from In progress to Done in Origin DeFi (OUSD + OETH) Jun 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contracts Works related to contracts enhancement New feature or request good first issue Good for newcomers P2 Small number of users are affected, major cosmetic issue planned In-scope at the beginning of the sprint
Projects
Status: Done
Development

No branches or pull requests

4 participants