# Liquidity Pool Risk

One core component related to Market Risk is the potential of a pool experiencing high utilisation. High utilisation refers to majority of liquidity being used up to facilitate Murabaha. In such a scenario; as discussed previously; LP's wishing to withdraw may experience a situation where there isn't enough idle funds to facilitate their withdrawal. Albeit, all  Murabaha's have a expiry, are backstopped by collateral and will eventually be repaid.&#x20;

## WAMD & Maximum Debt Duration

\
The 'Weighted Average Murabaha Duration' is a metric that helps LPs (Liquidity Providers) gauge the time it would take for a pool to reach 0% utilization without any new liquidity deposits. It's calculated by taking a weighted average of Murabaha debt multiplied by the duration for each Murabaha transaction facilitated within a specific currency pool.

AZKA calculates the maximum duration for a requested amount using a Gaussian bell curve approach. This approach not only considers the pool's utilization but also takes into account the maturity landscape of the pool's debt. This means that it considers both how much of the pool's capacity is being used and the varying maturity dates of the debts within the pool to provide a comprehensive approach to managing the risk of liquidity shortages. &#x20;

The deposit fee may also be activated if the WAMB is within the upper bound of accepted durations. &#x20;

## Calibrating the Murabaha Fee Rate&#x20;

Essential to mitigating liquidity pool risk is the **calibration of the 'Murabaha Fee Rate' curve** in line with market dynamics and agent behaviour. Over time AZKA will be able to collect data on deposits, withdrawals, Murbaha's, repayments and liquidations. This data will give insights into the behaviour of agents with regards to parameters such as vROI, Murabaha Fee and more specifically how well the parameters in the Murabaha Fee rate (Target Utilisation, upper/lower fee bounds, etc) are managing liquidity risk. **AZKA's back end algorithms** will consume these events and use **statistical inference methods and machine learning** to asses the need to re-calibrate such parameters in order to manage liquidity risk and achieve demand/supply equilibrium. &#x20;

## Treasury Redistribution &#x20;

Another way to manage Liquidity Risk is to ensure that any and all fees earned can be deposited into Murabaha pools such that the AZKA treasury is able to provide liquidity to pools in times of high utilisation. Essentially making the AZKA protocol the LP of last resort. Which pool receives what is dependant on the utilisation requirements of the different pools. For example, if the USDC pool is over utilised it may be such that a larger portion of the fees/treasury are deposited into the USDC pool. Fees generated will also be used to conduct periodic token buy backs as well as to pay service providers. AZKA will try to pay for all services in azTokens when possible.   &#x20;

## azToken's as Collateral&#x20;

In most comparable DeFi protocols, collateral is actively deposited into pools that support debt activities, ensuring that the collateral is not idle. This enhances the protocol's capital efficiency by making all deposited collateral accessible for users seeking financing. It also enables the Murabaha taker to earn a yield on their deposited collateral, effectively reducing the net cost of their debts. However, this strategy also increases the protocol's susceptibility to liquidity risks and the potential for system manipulation, particularly given its design as a fixed-rate system.&#x20;

<details>

<summary>Examples of undesirable scenarios when using azTokens as collateral</summary>

i) In the event that the collateral needs to be liquidated and the pool (where the collateral has been deposited) is experiencing a high utilisation scenario, there may not be enough idle funds to facilitate the liquidation leading to bad debt.&#x20;

ii) A user seeking to incur debt could deposit a substantial amount of collateral for a relatively small debt amount. This action would lower the utilization rate and, consequently, reduce the Murabaha Fee rate. The user could then execute the debt at this lower rate and subsequently withdraw a portion of the collateral to maintain a reasonable Debt-to-Collateral (DTC) ratio.&#x20;

</details>

Once the protocol has enhanced the risk framework and necessary contingencies, additional mechanisms will be considered in line with the launch of V2. **In the immediate short term collateral will sit idle in AZKA smart contracts**.&#x20;

##

##
