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 #34

Merged
merged 43 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:

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.

Hello, have few comments, hope it helps! :)

src/utils.ts Outdated Show resolved Hide resolved
src/client.ts Outdated Show resolved Hide resolved
src/client.ts Outdated Show resolved Hide resolved
src/client.ts Outdated Show resolved Hide resolved
src/client.ts Outdated Show resolved Hide resolved
src/credix_lp/depository.ts Outdated Show resolved Hide resolved
src/credix_lp/depository.ts Outdated Show resolved Hide resolved
src/credix_lp/depository.ts Show resolved Hide resolved
src/credix_lp/depository.ts Show resolved Hide resolved
src/credix_lp/depository.ts Show resolved Hide resolved
src/utils.ts Outdated Show resolved Hide resolved
src/utils.ts Outdated Show resolved Hide resolved
src/utils.ts Outdated Show resolved Hide resolved
src/utils.ts Outdated Show resolved Hide resolved
src/utils.spec.ts Outdated Show resolved Hide resolved
@Orelsanpls Orelsanpls self-requested a review January 3, 2023 01:27
@crypto-vincent crypto-vincent merged commit 6263e7a into main Jan 3, 2023
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.

2 participants