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

# GEM reserve and reference value

> Accounted GRAPL funding supports benefits without creating a GEM market price.

`GemReserve` holds accounted GRAPL for approved benefits. It is not a GEM/GRAPL AMM, a USD oracle, a peg or a promise of cash redemption.

## Funding becomes active later

An authorized funder deposits GRAPL through `fundFees`. The contract measures received tokens and rejects a mismatch. Unaccounted transfers do not change the quote.

```mermaid theme={null}
flowchart TD
  Funding[Authorized GRAPL funding] --> Pending[Pending funding]
  Pending --> Later[A later block activates the batch]
  Later --> Active[Active reserve]
  Active --> Quote[Quote benefit]
  Quote --> Consent[Check allowance and minimum debit]
  Consent --> Burn[Burn GEM and debit reserve]
  Burn --> Service[Send GRAPL to approved service]
```

Anyone can activate matured funding. A new deposit in a later block activates the previous batch first, so continuous deposits cannot indefinitely delay old funding. This delay is a local manipulation guard, not a production oracle or time-weighted average.

## Reference formula

For GEM amount `g`, using integer atomic units:

```text theme={null}
proportional = floor(activeReserve × g / (outstandingGemSupply + virtualGemSupply))
ceiling = floor(maximumDebitPerGem × g / 10^18)
referenceDebit = min(proportional, ceiling)
```

Both tokens use 18 decimals locally. Zero outstanding supply or a request exceeding supply quotes zero. Virtual supply is an accounting denominator with no holder or redemption claim.

| Input | Effect, holding other inputs constant |
| - | - |
| Active reserve grows | Proportional quote grows until the ceiling binds |
| Outstanding GEM grows | Proportional quote per GEM decreases |
| Virtual supply grows | Proportional quote decreases |
| Benefit consumed | Both reserve and outstanding GEM decrease |
| Unaccounted donation | No change to the quote |

Burning does not guarantee appreciation: it removes GEM and backing. Trading can add fees and issue GEM together, so more trades do not guarantee higher reference value either.

## A bounded local example

The fixture seeds **100,000 GRAPL**, interpreted as 10% of its one-million supply. Virtual supply is one million GEM units and the benefit ceiling is **0.005 GRAPL per GEM**. These are experiments pending economic approval. A supply allocation is not interchangeable with an allocation of market value; that valuation basis remains open.

The 5 GEM earned from the [10-GRAPL swap example](/concepts/gem) can represent at most 0.025 GRAPL of direct benefit. This does not value gacha prizes, whose inventory and promotional budget are separate.

## Consuming a benefit

The service needs a role and explicit holder allowance. Consumption checks minimum debit and deadline, decreases allowance and active reserve, burns GEM, then transfers GRAPL to the service. There is no arbitrary recipient or standalone user cash-out endpoint. Failure rolls back everything.

Gacha inventory is separate and never counted as reserve backing. See [gacha inventory](/concepts/gacha) and [administrator powers](/reference/security).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.