> For the complete documentation index, see [llms.txt](https://docs.origami.finance/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.origami.finance/the-third-fold-opal/opal-perpetual-pt-collection/liquid-leverage-susde-usde-ethereum/token-flow.md).

# Token Flow

#### Deposit Flow

{% stepper %}
{% step %}
User approves sUSDe (or any whitelisted asset via zap) spend for the vault contract.
{% endstep %}

{% step %}
User calls `join()` with the desired sUSDe amount.
{% endstep %}

{% step %}
`OpalManager` distributes sUSDe and USDe evenly as collateral in the adapter.
{% endstep %}

{% step %}
The Aave V3 adapter uses the sUSDe to acquire USDe (via swap), supplies sUSDe as collateral, and borrows additional USDT to acquire more sUSDe (via swap) to achieve the target leverage.
{% endstep %}

{% step %}
The vault mints opal-sUSDe-merkl-b shares to the user proportional to the vault's current holdings.
{% endstep %}
{% endstepper %}

#### Withdrawal Flow

{% stepper %}
{% step %}
User calls `exit()` with the number of opal-sUSDe-merkl-b shares and USDT to redeem.
{% endstep %}

{% step %}
`OpalManager` reclaims from each adapter proportionally.
{% endstep %}

{% step %}
The Aave V3 adapter unwinds a proportional share of the leveraged position (repay debt, withdraw collateral, swap sUSDe back to USDT).
{% endstep %}

{% step %}
The vault burns the user's opal-sUSDe-merkl-b shares.
{% endstep %}

{% step %}
sUSDe and USDe is transferred to the user.
{% endstep %}
{% endstepper %}

#### Managed Rebalance Flow (Leverage Adjustment)

{% stepper %}
{% step %}
Flash loan USDT from Aave V3.
{% endstep %}

{% step %}
Swap USDT to sUSDe.
{% endstep %}

{% step %}
Supply sUSDe as additional collateral.
{% endstep %}

{% step %}
Borrow USDT against the new collateral.
{% endstep %}

{% step %}
Repay the flash loan.
{% endstep %}

{% step %}
Assert the post-rebalance balance sheet.
{% endstep %}
{% endstepper %}

For a leverage decrease, the steps are reversed: flash loan, repay debt, withdraw collateral, swap to USDT0, repay flash loan, assert balance sheet.

{% hint style="info" %}
Users do not need to take any action during a managed rebalance. Share balances and redemption rights are unaffected.
{% endhint %}
