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

[Alloyx] Phase 2 - Rebalancing IX #310

Merged
merged 45 commits into from
Nov 16, 2023

Conversation

crypto-vincent
Copy link
Contributor

@crypto-vincent crypto-vincent commented Oct 13, 2023

This PR introduces has a few goals:

  • adds support for "non-directly-mintable" depositories during minting (re-work the compute amount method for mint)
  • adds a new IX: rebalance_alloyx_vault_depository (deposit to alloyx when underweight, withdraw when overweight)
  • clarify/simplify the rebalancing IXs (those needs all router depositories as account parameters) by simplifing anchor accounts and clarifying names

Note that a large portion of the diff from this PR comes from the effort to improve/expand the integration tests for rebalancing+mint+redeem.

@crypto-vincent crypto-vincent self-assigned this Oct 13, 2023
@crypto-vincent crypto-vincent changed the base branch from main to develop October 13, 2023 09:03
@crypto-vincent crypto-vincent requested a review from cnek October 28, 2023 09:04
+ u128::from(profits_beneficiary_collateral_after.amount);
assert!(
protocol_total_value_before <= protocol_total_value_after,
"protocol value loss!"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this test is quite powerful, ensuring we have zero loss in ALL cases

@crypto-vincent crypto-vincent changed the title [WIP] [Alloyx] Phase 2 - Rebalancing IX [Alloyx] Phase 2 - Rebalancing IX Nov 1, 2023
acamill
acamill previously approved these changes Nov 8, 2023
Copy link
Contributor

@Orelsanpls Orelsanpls left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking great sir !

@acamill acamill self-requested a review November 14, 2023 08:22
@crypto-vincent crypto-vincent merged commit bcb6b76 into develop Nov 16, 2023
9 of 11 checks passed
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.

3 participants