> 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/opal-leveraged-weeth-ethereum/token-flow.md).

# Token Flow

#### Deposit Flow

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

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

{% step %}
`OpalManager` distributes weETH evenly as collateral in the adapter.
{% endstep %}

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

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

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

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

#### Managed Rebalance Flow (Leverage Adjustment)

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

{% step %}
Swap wETH to weETH.
{% endstep %}

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

{% step %}
Borrow wETH 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 wETH, 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 %}
