# 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)
$$

***


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.electra.exchange/electra-liquidity-provider-pool/withdrawal-system/timelock-calculation.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
