Implementation of a program that manages on chain accounts to mint and redeem Redeemables tokens (UXD), hedged by a delta neutral position on underlying DEXes.
A) We update the usage of credix_treasury -> credix_treasury_pool
B) We update the usage of credix_multisig -> credix_treasury
C) We make sure to not mistake treasury_pool with credix_treasury which are now 2 completely different things
D) We remove the usage of withdraw_request
E) We use the new calculation function to compute the withdrawable amount during credix redeem
F) We update the tests to work with latest version
[CREDIX] Change Log:
Breaking:
feat: credix pass now has flags instead of boolean fields in the struct. All the fields are exposed by functions.
feat: withdraw epochs now do the rebalancing, the redeem base locked for investor calculation now take request amount and lp owned both into account. (withdraw request account was removed from contexts)
feat: Repayment schedule's periods now have calculation date. Describing on what date the accrual will be calculated from.
feat: Membership fee calculations are not based on the yearly outstanding principal
feat: Program State now has credix treasury. Credix treasury is where the credix fees will be collected from now on.
For Integrators:
Required changes for integrators in there smart contract:
If any field example(is_active, is_investor) from the credix pass is used. Replace it with (is_active(), is_investor()...)
Remove withdraw Request accounts from the cpi calls.
Mark withdraw epoch mutable if it is already not when creating withdraw request or redeeming withdraw requests.
For Redeem withdraw request and withdraw funds. Change the credix_muiltisig -> credix_treasury. And Credix_muiltisig_token_account-> credix_treasury_token_account. The correct credix_treasury address is in program_state account of credix program.
To get the max amounts that can be withdrawn in the withdraw Epoch. We have provided a function in the rust client.
Changes required for there local setup:
When sending the repayment schedule with set_repayment_schedule we can directly send the RepaymentPeriod instead of RepaymentPeriodsInput struct which previously existed. The calculation_date in the periods can be set equal to the period's time_frame.start.
TLDR Summary:
PR Combo:
[UXD] Changes updates recap:
credix_treasury
->credix_treasury_pool
credix_multisig
->credix_treasury
treasury_pool
withcredix_treasury
which are now 2 completely different thingswithdraw_request
[CREDIX] Change Log:
Breaking:
For Integrators:
Required changes for integrators in there smart contract:
If any field example(is_active, is_investor) from the credix pass is used. Replace it with (is_active(), is_investor()...)
Remove withdraw Request accounts from the cpi calls.
Mark withdraw epoch mutable if it is already not when creating withdraw request or redeeming withdraw requests.
For Redeem withdraw request and withdraw funds. Change the credix_muiltisig -> credix_treasury. And Credix_muiltisig_token_account-> credix_treasury_token_account. The correct credix_treasury address is in program_state account of credix program.
To get the max amounts that can be withdrawn in the withdraw Epoch. We have provided a function in the rust client.
Changes required for there local setup: