# CACAO Pool

## Overview

CACAO Pool is a liquidity provision mechanism that pools CACAO across multiple Protocol-Owned Liquidity (PoL) enabled pools. Rather than requiring users to manage individual liquidity positions, participants deposit CACAO and gain exposure to an aggregate index of CACAO across all PoL-enabled pools within the network.

This is Maya's equivalent of THORChain's RUNEPool feature.

## Key Benefits

### Simplified Exposure

Instead of selecting individual pools and managing multiple positions, users can deposit CACAO once and gain exposure to the combined performance of all PoL-enabled pools.

### Reduced Impermanent Loss Risk

Aggregate impermanent loss across multiple pools tends to be lower than IL from any single pool. Different assets often move in opposite directions, providing natural hedging.

### Lower Cognitive Burden

No need to research, select, and monitor individual pools. The protocol handles the distribution across PoL-enabled assets.

## How It Works

### Depositing

To deposit CACAO into the CACAO Pool, send a transaction with the memo:

```
pool+
```

The deposited CACAO is held in the `cacao_pool` module account. You receive pool units representing your proportional ownership of the CACAO Pool.

### Withdrawing

To withdraw from the CACAO Pool, send a transaction with the memo:

```
pool-:<basis_points>:<affiliate>:<affiliate_fee>
```

| Parameter       | Description                                               | Required |
| --------------- | --------------------------------------------------------- | -------- |
| `basis_points`  | Percentage to withdraw (0-10000, where 10000 = 100%)      | Yes      |
| `affiliate`     | Affiliate address or MAYAName to receive fee              | No       |
| `affiliate_fee` | Basis points of **profit** to send to affiliate (0-10000) | No       |

**Examples:**

* `pool-:5000` - Withdraw 50% of your position
* `pool-:10000` - Withdraw 100% of your position
* `pool-:10000:maya1abc...:5000` - Withdraw 100%, send 50% of profit to affiliate

{% hint style="info" %}
Affiliate fees are only charged on **profit**, not on the total withdrawal amount. If your position has no profit (or is at a loss), the affiliate receives nothing.
{% endhint %}

### Maturity Period

After depositing, you must wait for the maturity period before withdrawing. This is controlled by the `CACAOPoolDepositMaturityBlocks` constant, which defaults to **14400 blocks** (approximately 1 day).

Attempting to withdraw before maturity will result in a rejected transaction.

## Tracking Your Position

### Individual Provider Info

Query your position at:

```
GET /mayachain/cacao_provider/{address}
```

Response includes:

* `cacao_address` - Your MAYA address
* `units` - Your pool units (ownership share)
* `value` - Current CACAO value of your position
* `pnl` - Profit and loss
* `deposit_amount` - Total CACAO deposited
* `withdraw_amount` - Total CACAO withdrawn
* `last_deposit_height` - Block height of last deposit
* `last_withdraw_height` - Block height of last withdrawal

### Pool Overview

Query the overall CACAO Pool status at:

```
GET /mayachain/cacaopool
```

Response includes:

* `pol` - Protocol-Owned Liquidity stats (deposits, withdrawals, value, PnL)
* `providers` - Aggregate provider stats (units, pending units, value, PnL)
* `reserve` - Reserve participation stats

### All Providers

List all CACAO Pool providers:

```
GET /mayachain/cacao_providers
```

## Configuration

CACAO Pool behavior is controlled by these Mimir values:

| Mimir Key                        | Default | Description                                      |
| -------------------------------- | ------- | ------------------------------------------------ |
| `CACAOPoolEnabled`               | 0       | Enable (1) or disable (0) the CACAO Pool feature |
| `CACAOPoolDepositMaturityBlocks` | 14400   | Blocks to wait before withdrawal is allowed      |

{% hint style="warning" %}
The CACAO Pool feature must be enabled via Mimir (`CACAOPoolEnabled = 1`) for deposits and withdrawals to be processed. When disabled, transactions will be refunded.
{% endhint %}

## Profit & Loss

Your PnL in CACAO Pool is calculated based on the performance of the underlying PoL positions. Factors affecting your returns:

1. **Swap fees** - PoL positions earn a share of swap fees from their pools
2. **Impermanent loss** - Price movements in underlying assets can cause IL
3. **Pool rewards** - System rewards distributed to pools

Since your exposure is aggregated across multiple pools, your returns represent the net performance of all PoL-enabled assets.

## Comparison with Direct LP

| Aspect             | CACAO Pool                | Direct LP                |
| ------------------ | ------------------------- | ------------------------ |
| Asset selection    | Automatic (all PoL pools) | Manual choice            |
| IL exposure        | Diversified across pools  | Single pool              |
| Management         | Passive                   | Active monitoring needed |
| Granular control   | No                        | Yes                      |
| Minimum commitment | Maturity period           | None                     |


---

# 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.mayaprotocol.com/deep-dive/mayachain-finance/cacao-pool.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.
