> ## Documentation Index
> Fetch the complete documentation index at: https://docs.juiced.fi/llms.txt
> Use this file to discover all available pages before exploring further.

# The Liquidity Engine

> Learn about the liquidity engine of Juiced Protocol.

The **Liquidity Engine** is the core technical infrastructure of Juiced. It manages the transition from passive capital to active, competitive market-making. By leveraging the low-latency environment of **RiseX**, the engine ensures that liquidity is not just present, but "high-quality" -characterized by tight spreads and deep order books.

### Dual-Vault architecture

Juiced utilizes two distinct Vault models to accommodate different asset lifecycles. This ensures that the protocol can support both high-volume "Blue Chips" and "New Market" launches.

**Model A: The Standard Vault (Dual-Asset)**

* **Target Assets:** Deeply liquid assets available via bridges (e.g., $ETH, $SOL, $BTC, $MONAD).
* **Deposit Requirement:** LPs provide a **50/50 value ratio** of the Quote Asset (USDC) and the Base Asset.
* **Execution:** The Vault immediately deploys both Bids and Asks on the orderbook.

**Model B: The Bootstrapping Vault (Inventory Loan)**

* **Target Assets:** New token launches or ecosystem projects with limited circulating supply on RiseX.
* **Asymmetric Injection:**
  1. **Supply Side (The Project):** The issuing team "lends" base asset inventory to the Vault to populate the **Ask Side** (Sells).
  2. **Demand Side (The Retail):** Users deposit **USDC only** to populate the **Bid Side** (Buys).
* **Mechanism:** The Vault manages these as a single strategy. As trading occurs, the inventory naturally rebalances. This allows retail to farm yields with stablecoins while the project ensures their token has an immediate, liquid market.

### Market making logic

Juiced Vaults function as **On-Chain Market Makers**.

Unlike AMMs that rely on a static formula `(x * y = k)`, Juiced Vaults use active logic to manage orders:

1. **Grid Strategy:** The Vault places multiple limit orders at varying price ticks around the mid-price.
2. **Inventory Skew:** If the Vault holds more USDC than Tokens, it automatically adjusts its quoting to be more aggressive on the Buy side to rebalance its holdings.
3. **HFT Precision:** Leveraging RISE’s sub-50ms block times, the Vaults update their quotes frequently, tracking external CEX prices to remain competitive.

### Liquidity scoring algorithm

To ensure emissions are not wasted on "lazy" capital, Juiced implements a proprietary scoring algorithm. Rewards are distributed based on the **Execution Quality** provided.

**The Formula**

Every order is snapshotted and scored based on three variables:

```jsx theme={null}
S = Size x W(d) x U
```

Where:

* **Size (S):** The USD value of the order.
* **Spread Weight (W(d)):** Rewards decrease exponentially as the order’s distance from the mid-price increases.
  * *Tight Spread (e.g., \<0.1%):* **1.0x multiplier**
  * *Medium Spread (e.g., 1.0%):* **0.1x multiplier**
  * *Out of Range (e.g., >2.0%):* **0.0x multiplier**
* **Uptime (U):** A multiplier that increases rewards for LPs who keep their orders active during periods of high volatility.

### Settlement & distribution

Juiced uses a hybrid Off-chain/On-chain settlement system to ensure scalability and cost-efficiency.

1. **Indexing:** The **Scoring Indexer** tracks every order on the RiseX orderbook in real-time.
2. **Calculation:** At the end of each Epoch (1 week), the Indexer calculates the final distribution based on cumulative scores.
3. **Publication:** A **Merkle Root** (a cryptographic proof of the entire payroll) is published on-chain.
4. **Claiming:** Users interact with the **Merkle Distributor** contract to claim their aggregated rewards from multiple Vaults in a single transaction.

### Risk management

The engine includes built-in safeguards to protect Liquidity Providers from "Toxic Flow" and "Loss Versus Rebalancing" (LVR).

* **Volatility Guards:** In times of extreme price action, Vaults automatically widen their spreads or temporarily halt quoting to prevent being "sniped" by arbitrageurs.
* **Asset Isolation:** Every market is a siloed smart contract. A "rug pull" or price collapse in a specific token cannot drain the USDC or assets held in other Vaults.
