> For the complete documentation index, see [llms.txt](https://docs.electra.exchange/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.electra.exchange/electra-liquidity-provider-pool/withdrawal-system/timelock-calculation.md).

# Timelock Calculation

### Timelock Calculations

The dynamic timelock mechanism adjusts the waiting period based on the pool’s financial health.

#### PNL Ratio Calculation

The system determines a ratio ( k ), representing the current profit and loss situation:

$$
k = \left( \frac{\text{totalPNL}}{\text{totalPoolAsset}} \right) \times 100%
$$

***

#### Timelock Assignment

The timelock duration depends on ( k ):

| **Condition**    | **Timelock (epochs)** | **Approximate Wait Time** |
| ---------------- | --------------------- | ------------------------- |
| ( k > 10% )      | 1                     | \~3 days                  |
| ( 0% ≤ k < 10% ) | 2                     | \~6 days                  |
| ( k < 0% )       | 3                     | \~9 days                  |

***

#### Unlock Epoch Calculation

Once the timelock is determined:

$$
\text{Unlock Epoch} = \text{Current Epoch} + \text{Timelock}
$$

**Example**:\
If the current epoch is 10 and the calculated timelock is 2 epochs, your withdrawal request unlocks in epoch 12

***

#### Unlock Date Calculation

The exact unlock date is derived from:

$$
\text{Unlock Date} = \text{Start Time} + \left( \text{Unlock Epoch} \times \text{Epoch Duration} \right)
$$

***
