> For the complete documentation index, see [llms.txt](https://limitless.gitbook.io/ramm/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://limitless.gitbook.io/ramm/instrument-examples-and-usage/conditional-lending-pool-clp/managers-as-oracles.md).

# Managers as Oracles

No Third Party Oracles are needed in RAMM's CLP

### Why Managers As Oracles?

There are no reliable oracles for long-tail assets. For ones that do exist, they are easily manipulated. Instead, using RAMM's managers as oracles is a straightforward incentive-compatible mechanism for pricing collaterals in the context of lending. Alignment stems from the fact that the system necessitates managers' 'skin-in-the-game' when they price the risk of collaterals.&#x20;

{% hint style="info" %}
The mechanism outlined below simply adjusts the `maxBorrowableAmount` per unit  collateral based on simple supply-demand dynamics.&#x20;

If more capital is supplied compared to the amount borrowed, supply>demand which  lowers the price(`maxBorrowableAmount`) of the collateral.&#x20;

If more capital is withdrawn compared to the amount borrowed, supply\<demand which increases the price(`maxBorrowableAmount)` of the collateral.&#x20;
{% endhint %}

### Dynamic Max Borrowable Amount

The `maxBorrowableAmount` is a dynamically adjusted parameter and determines how much unit vault's underlying can the borrower borrow per unit collateral collateralized. For example, if `maxBorrowableAmount` is 500 for a USDC vault and with ETH as collateral, a borrower can borrow 500 USDC per ETH deposited. &#x20;

> The `maxBorrowableAmount` parameter represents a collateral's borrowing power 'agreed' by the managers. It replaces a third party price feed. `maxBorrowableAmount` is akin to an implied  'price' of the collateral as determined by the managers' collective **`longZCB`** demand.&#x20;

During the lifetime of a lending pool instrument, `maxBorrowableAmount` will adjust to account for the collateral's value as perceived by the managers. [Recall](/ramm/protocol-flow/post-approval.md) that whenever a manager issues **`longZCB`** the protocol supplies capital to the instrument, and whenever a manager redeems **`longZCB`** the protocol withdraws capital from the instrument. As a result, all else being equal,  there is a bijective relationship between **`longZCB`** issuance and the utilization rate.&#x20;

We can then create a relationship between `maxBorrowableAmount` and the utilization rate(or equivalently, how much **`longZCB`** at time t u\_t, based on the central principle that a low utilization rate means both the managers(supplier) and borrowers(demander) deem `maxBorrowableAmount` low, and vice versa.&#x20;

{% hint style="info" %}

1. Manager is bullish(bearish) with the given collaterals and `maxBorrowableAmount`
2. Manager issue(redeems) **`longZCB`**, thereby supplying(withdrawing) to(from) the lending pool.&#x20;
3. Utilization rate goes down(up).
   {% endhint %}

For the following parameters, we can determine B\_T, or the `maxBorrowableAmount` for a lending pool at time T, as a function of all recorded utilization rate(urate) until time T.&#x20;

$$
\hat{B} := \text{initial} \ \texttt{maxBorrowableAmount} \ I\_t = \texttt{maxBorrowableAmount} \ \text{percentage increment at time T}\ u\_u:=upper threshold \ urate \u\_l:=lower threshold \ urate
$$

$$
I\_t = \begin{cases}
x& \text{if } urate \geq u\_u\\
-x & \text{if } urate\leq u\_l
\ 0& \text{otherwise}    \end{cases}
$$

$$
0\leq x \leq 1
$$

$$
B\_T = \hat{B}\prod\_{i=1}^T(1- I\_i)
$$

In words, `maxBorrowableAmount` will decrement by x if the urate is above a threshold(when managers redeem and thus withdraw from the pool), and increment by x if the urate is below a threshold(when managers issue and thus supply to the pool).&#x20;

This relationship gives rise to some desirable properties

> 1. Attack reslient, as borrowable amount increases in increments per unit time. &#x20;
> 2. When the pool is overdrawn, if the managers *don't* issue **`longZCB`** given the higher APR from a higher urate, `maxBorrowableAmount` will decrease.&#x20;
> 3. When the pool is underdrawn, if the managers *don't* redeem **`longZCB`** given the lower APR from a lower urate, `maxBorrowableAmount` will increase.&#x20;
> 4. When the managers' perceived value of collateral decreases, they redeem **`longZCB`**, which will increase `maxBorrowableAmount` over time.&#x20;
> 5. When the managers' perceived value of collateral increases, they issue **`longZCB`**, which will decrease `maxBorrowableAmount` over time.&#x20;
> 6. Overall, the process does not increase the action space for managers. They simply issue/redeem **`longZCB`** when they are bullish or bearish.&#x20;

<figure><img src="https://3340105099-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FFXDxq10tgILHm4JAzNTN%2Fuploads%2FJt3ImfO22BsawCRPHZGC%2FScreen%20Shot%202023-02-15%20at%2010.46.00%20PM.png?alt=media&amp;token=c22a1ce3-e13a-4189-85a3-269592f0680f" alt=""><figcaption></figcaption></figure>

The dynamic is shown in the graph above. When managers *redeem* **`longZCB`** and utilization rate exceeds the upper threshold U\_u, `maxBorrowableAmount` will decrease. When managers issue **`longZCB`** and utilization rate exceeds the lower threshold U\_u, `maxBorrowableAmount` will increase. The more time spent under(over) the threshold, the more `maxBorrowableAmount` will change.&#x20;

### Liquidations

Based on B\_T, an auction will be triggered to liquidate the collateral of the borrower if&#x20;

$$
B\_T \* Collateral \ posted \leq BorrowAmount - liquidationBuffer
$$
