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

[Credix] Minting/Redeeming/CollectProfit IXs #213

Merged
merged 57 commits into from
Jan 3, 2023

Conversation

crypto-vincent
Copy link
Contributor

@crypto-vincent crypto-vincent commented Nov 28, 2022

Abstract

This PR adds integration with the onchain credix smart contract by minting UXD when depositing collateral in credix and burning UXD when withdrawing collateral from credix

New instructions set:

  • register_credix_lp_depository

    • init all necessary accounts
    • store important accounts address
    • init accounting storage
  • mint_with_credix_lp_depository

    • take user's USDC and put it in the credix LP
    • mint UXD and give it to user in exchange
  • redeem_from_credix_lp_depository

    • take user's UXD and burn it
    • withdraw USDC from credix LP and give it to user in exchange
  • collect_profit_of_credix_lp_depository

    • see if the credix LP owned assets surpass outstanding UXD liabilities
    • if yes, withdraw profits into UXD's authority collateral account
  • edit_credix_lp_depository

    • set and change configuration flags and accounting caps

PR Combo:

@crypto-vincent crypto-vincent self-assigned this Nov 28, 2022
programs/uxd/src/error.rs Outdated Show resolved Hide resolved
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.

Looks nice! Only few opinionated comments!

@crypto-vincent
Copy link
Contributor Author

Audit saved for context on latest changes:
2022_12_17_uxd_incremental_review.pdf

acamill
acamill previously approved these changes Jan 2, 2023
Copy link
Member

@acamill acamill left a comment

Choose a reason for hiding this comment

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

Good to merge after release 👍

Copy link
Member

@acamill acamill left a comment

Choose a reason for hiding this comment

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

LGTM

@crypto-vincent crypto-vincent merged commit ebf8d88 into main Jan 3, 2023
@acamill acamill deleted the vbrunet/2022_11_28-integration-credix branch April 21, 2023 00:49
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.

4 participants