yield-sync / v1-emp

0 stars 0 forks source link

Integrate Fully Automated Withdrawal Functionality #30

Closed aleem-ahmed closed 1 month ago

aleem-ahmed commented 1 month ago

Currently, the only way to withdraw the tokens from the EMP is to have the manager manually burn the strategy tokens to increase the balance of the EMPs. This is done so EMP token holders can burn the token and cash out of the positions. This should not be required to occur when removing liquidity from the strategies.

Changes to the EMP protocol should be made to allow EMPs to be fully autonomous if strategists want them to be. This will require some auto-burn mechanism to work.

Proposed Solution

If the required tokens are not available for an EMP withdrawal, burn the correct amount of strategy tokens so that there is enough tokens to fulfill the withdrawal.

aleem-ahmed commented 1 month ago

Proposed Logic

Calculate the amount needed for withdrawal

Check if the amount needed is available

If not available and full withdrawal is enabled Burn the percent of strategy tokens equal to the EMP tokens to be burned to total supply of EMP tokens

Withdraw the tokens