> 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/perpetual-susde-pt-plasma/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 across adapters proportionally.
{% endstep %}

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

{% step %}
The vault mints opal-PT-sUSDe-PLASMA-a 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-PT-sUSDe shares and USDT0 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 PT-sUSDe back to USDT0).
{% endstep %}

{% step %}
The vault burns the user's opal-PT-sUSDe-PLASMA-a shares.
{% endstep %}

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

#### Managed Rebalance Flow (Leverage Adjustment)

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

{% step %}
Swap USDT0 to PT-sUSDe.
{% endstep %}

{% step %}
Supply PT-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 USDT, 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 %}
