## Quantitative measures

### Total liquidity protected:

- D_i = deposit at block i
- W_i = withdrawal at block i
- T_i = threshold at block i
- F_i = Firewall triggered at block i (1 if the Firewall is triggered at block i, 0 if the Firewall is not triggered)
- n = Time windows for the Firewall as a number of blocks (block interval over which the threshold is computed)
- m = number of blocks for the cooldown period

### **Cooldown function at block j**

This function checks whether a block j is within the cooldown period after the Firewall has been triggered. It returns 1 if the Firewall is triggered, 0 otherwise.

- CD(j) = max_{k=1}^{j-1} (F_k * I(j - k <= m))

where I(condition) is the indicator function, returning 1 if the condition is true and 0 otherwise.

![CDj.png](https://file.notion.so/f/s/40fb19fb-ceb7-4898-a8d0-406398c06e8a/866a717f98720e6c0ff180fa059989b4.png?id=56d653e9-2c3c-40ba-90b1-b6f2a059187d&table=block&spaceId=549a06fc-7073-4a4a-a8f1-3206b15135b8&expirationTimestamp=1691683200000&signature=kvX5G5IwCVXX1pqqrae1j6Iit465DRdSyrlWxP0H9Co&downloadName=866a717f98720e6c0ff180fa059989b4.png)

### **Liquidity function at block i:**

If the block i is within the cooldown period (CD(i) = 1), the withdrawal term W_i * (1 - CD(i)) will be zero.

- L_i = (D_i - W_i * (1 - CD(i))) * T_i

![Li.png](https://file.notion.so/f/s/7ad9f96a-1a83-4401-8672-31011b553134/c7d95bf6668540ac5b3e7b0074593b3a.png?id=108eafed-2d68-455b-99c7-03716fece795&table=block&spaceId=549a06fc-7073-4a4a-a8f1-3206b15135b8&expirationTimestamp=1691683200000&signature=mWRpIVBE06FdT-fneRs5PR_HiWe_5lQbutMMcNREBc8&downloadName=c7d95bf6668540ac5b3e7b0074593b3a.png)

### **Total Liquidity protected by the Firewall at block i:**

The total liquidity protected over the n blocks is the sum of the liquidity protected at each block:

- TotalLiquidityProtected = sum_{i=1}^n L_i

![TLP.png](https://file.notion.so/f/s/3926f4a2-6e51-4666-a6f2-ea247403cd00/3279e3c1a82f7c9d55fff9953388733a.png?id=07b697ff-b71a-4321-84f4-0cb5a4b30d88&table=block&spaceId=549a06fc-7073-4a4a-a8f1-3206b15135b8&expirationTimestamp=1691683200000&signature=xWvZWWLP9yR7hiQKnHmHYPVIMAK116YQ4IG3hgY8Jig&downloadName=3279e3c1a82f7c9d55fff9953388733a.png)