# #002

<figure><img src="https://3881291275-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FCaql6uzRSSdezScAKgMU%2Fuploads%2F4bWd6VV8pXwJwMlvWNXS%2FProtocol002.png?alt=media&#x26;token=5ea904b9-92fd-4b45-a096-8e9f1810f802" alt=""><figcaption></figcaption></figure>

### Mutuum Protocol Update #002 — Initial Codebase Finalized, Fee Collector Complete, Liquidation Indexer Live

#### ✅ Completed&#x20;

**Initial codebase finalized**\
Initial commit of the core workspace and contract set. Includes baseline interfaces, events, libraries, and a clean project structure for contracts, tests, and deployment artifacts. Scaffolding is aligned with the architecture from #001 so future modules slot in without refactors.

**Fee Collector contract (implementation pass)**\
Spec-complete V1 with:

* Role-gated configuration and pausability
* Deterministic accounting, `FeeAccrued` / `FeeRouted` events
* Hooks for the buy-and-distribute path (treasury → market purchase → staker distribution)
* Unit tests around accrual, routing, and failure modes (reverts on invalid params, paused state)

**Liquidation Bot Indexer (service layer)**\
Off-chain indexer that:

* Subscribes to pool/oracle events and normalizes them into the schema from #001
* Maintains exactly-once processing via block/tx cursors and reorg-safe checkpoints
* Derives per-position health metadata for the client bot (LTV/threshold deltas)
* Exposes a job queue for actionable liquidations and alert hooks for edge cases

***

#### ⌛ In Progress

**Oracle integration**\
Chainlink as primary feed with Pyth fallback. Implementing max-age guards, stale-price reverts, and a registry so feeds can be added/removed per market without redeploys. Simulation tests cover primary/fallback switches and boundary conditions.

**Safety Module**\
Secure multisig for privileged actions, mtToken staking flows, proportional rewards via the distribution manager, and the slashing path for covering shortfalls. Current work is on staking/unstaking state transitions and emission math.

**Liquidation Bot (client)**\
Position-health evaluator, execution routing, and flash-loan path (Morpho-inspired) to close under-collateralized debt promptly. Adding notification webhooks and guardrails for race conditions and stale quotes.

***

Released: **03 Oct 2025** (UTC) · Update **#002**
