# Overview

Shell Accumulator is an on-chain exchange system on the GOSH network that lets users trade **ECC SHELL** for **ECC USDC** at a fixed rate of **100 SHELL = 1 USDC**.

## What it does

Sellers deposit SHELL into fixed-size lots (denominated in 1, 10, 100, or 1000 USDC). Buyers deposit USDC and receive SHELL — first matched against existing seller lots in FIFO order, then minted if no sellers are available. When a buyer's USDC matches a seller's lot, the seller can claim their USDC payout.

A separate token, **NACKL**, can be redeemed (burned) against the "free reserve" — the USDC balance not owed to any seller.

## Tokens (ECC IDs)

| Token | ECC ID | Decimals  | Role                            |
| ----- | ------ | --------- | ------------------------------- |
| NACKL | 1      | 9 (nano)  | Value storage and staking       |
| SHELL | 2      | 9 (nano)  | Utility token, sold by sellers  |
| USDC  | 3      | 6 (micro) | Stablecoin, deposited by buyers |

All token amounts in the contracts use their smallest unit: nanoSHELL, nanoNACKL, microUSDC.

## Contracts

| Contract                   | Source                                               | Role                                                                                                                                                                   |
| -------------------------- | ---------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `ShellAccumulatorRootUSDC` | `contracts/accumulator/ShellAccumulatorRootUSDC.sol` | The central Accumulator contract: accepts ECC USDC, SHELL, and NACKL, manages FIFO seller queues, sells SHELL instantly, and handles USDC payouts for claims and burn. |
| `ShellSellOrderLot`        | `contracts/accumulator/ShellSellOrderLot.sol`        | One per seller position; carries claim metadata                                                                                                                        |
| `AccumulatorLib`           | `contracts/accumulator/libraries/AccumulatorLib.sol` | Deterministic address derivation for lots                                                                                                                              |
| `Exchange`                 | `contracts/exchange/Exchange.sol`                    | TIP-3 USDC bridge and admin mint entry point                                                                                                                           |

## Key design decisions

**Fixed denominations.**

Lots come in exactly 4 sizes: 1, 10, 100, 1000 USDC. There are no partial lots. A 154 USDC buy matches 1×100 + 5×10 + 4×1 lots.

**FIFO guarantee.**

Each denomination has its own queue. Lots are matched strictly in order of creation — earlier sellers get paid first.

**Deterministic lot addresses.**

Lot contract addresses are derived from `(code, root, denom, orderId)` using `AccumulatorLib`. This means the Root can verify any caller claiming to be a lot by recomputing the expected address, without storing a mapping.

**Directed events.**

Events are emitted to hardcoded external addresses (610–617) so that off-chain backends can subscribe to specific event streams without parsing all contract messages. See [Events ](/accumulator-contract-system/api-reference.md#events)for the full list.


---

# 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://dev.ackinacki.com/accumulator-contract-system/overview.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.
