# Exponent Batched Withdrawal ## Purpose - Withdrawal is expensive gas-wise due to how multi-assets withdrawal from Enzyme to Exponent currently work (1 transfer from Enzyme to Exponent, 1 transfer from Exponent to withdrawer). The cost can grow unbounded linearly (*O(n)*) as number of assets increase within the fund. - User should be discouraged to making large adhoc withdrawals due to its impact on the fund performance and ability for the Strategist to effectively manage the pooled assets. - Users would like to have a single asset at withdrawal (the asset they used to deposit into the fund). - Given that we operate a trustless smart contract, user should still be *allowed* to withdraw funds at any time they would like. - *limit the gas spent on withdrawal to not more than a regular swap on DEX* (sub 120k gas). ## Description *Batch Withdrawal* massively reduce the overhead of smart contract withdrawal interaction on a per user basis by aggregating all intended withdrawals to be executed in a single epoch. 1. the user simply pays to `lockup()` the LP token and receive a unique slot in the contract, they can revoke this any time via `revoke()` 2. After all the users have deposited *and* the epoch is closing in, the strategist should rebalance to the denominated asset ie. turn the portfolio into 100% USDC. 3. After the portfolio is in a single asset and the epoch has passed, strategist or Exponent team can call withdrawal from the Batch Withdrawal contract to redeem LP tokens for the underlying assets. This will occur within 4 different ERC20 transfers 1. Batch Contract XPN LP redemption, Exponent Enzyme shares redemption, denominated asset transfer to Exponent, denominated asset transfer to Batch contract) 4. the user call `withdraw()` on batch withdraw contract to retrieve denominated asset via an ERC20 transfer. ### Benefits: - Given that this is another smart contract, a user is not locked into this method and can revoke the LP tokens anytime. user retains the right to `revoke()` and perform direct withdrawals with Exponent Vault at any time - user bear the costs of only 2 ERC20 transfers over the entire epoch. That's around 90k-120k gas, in contrast to Rhino funds for example: https://etherscan.io/tx/0x970773d938542c1a3bbdd9b8f70dfda95bb8b529fea5013feb1f0d5739f0e677 that does 15 withdrawals @ 1.5M Gas. If this was done via this method, we could reduce this by an order of magnitude. - not blocking the development process or the API on either Exponent or Enzyme - benefit of acting as a gate, incentivize people to hold longer to pay less fees— closer to traditional hedge funds redemptions where withdrawals happen after a lockup period. ### Other considerations - This design hinges on the strategist to rebalance the entire portfolio to a denominated asset every single interval. This is purely to benefit the investors- the strategist could however **decide not to do it.** We can think about a way to incentivize this activity later on- in the case where strategists are not sufficiently incentivized, ie. introduce incentive to rebalance. - an EOA need to call the withdrawal from Batch withdrawer to XPN contract. This can be Exponent itself, but we could introduce a small fee for user to pay so that the wallet that absorbs the rebalance && large withdraw can break-even. - We can introduce new functionalities over time- including the ability to lock LPtoken for longer periods of time ie. a `timeLock()` that can only be revoke or withdraw after a certain number of epochs and be eligible for lock-drops of XPN tokens to incentivize longer term hodler > Example of the withdrawal flow from an end-user perspective. ![](https://i.imgur.com/U6vewqG.png)