> For the complete documentation index, see [llms.txt](https://docs.gage.cash/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.gage.cash/protocol/architecture.md).

# Architecture

The vault layer, the token layer beside it, and the services that read their events: what talks to what, and who owns which contract.

gage is two contract layers on Robinhood Chain (chain id 4663), a handful of services that read their events, and one app. Every loan settles on chain by the clock; nothing a service holds is needed to settle one.

```
APP         Next.js · wagmi · gage.cash
            Earn · Borrow · Portfolio · Protocol (bought back, the market, this week, the pool, agents) · Agents · Builders · Questions? (Ask AI, Support)
     │ reads the indexer and valuation APIs · the wallet signs every transaction
SERVICES    Indexer · Valuation (with the rates model) · Keeper · Notifier · Support · Agent API and MCP · Screener
     │ events up · transactions down: public methods, and the fills and rates only gage's keys may send
CONTRACTS
  Vault layer (the vault contracts have no owner and no upgrade path)
    Partner lending (Intent V1, since 15 October 2026)                       ← new loans
      IntentFactory 0xb086…   creates partner vaults from one fixed creation code · open to any address · owner: the Safe
      IntentVault             one per partner vault: shares, its mandate, its loans · run by its manager · no owner
      Intent core 0x0086…     a GageV2Vault: grace 0 · funded only by the factory's vaults · adapter 0x6c96…
      IntentFillRouter        funds a listing whole from one or more vaults, on a plan the rate service signs
      LoopRouter 0xa46b…      leverage: buys more of the pledged token, lists and funds one loan · owner: the Safe
      RolloverRouter 0x3bee…  repays a running loan and funds the next on the same pledge · owner: the Safe
      PrivateBorrowRouter     borrows against a screened deposit in a Privacy Pool · owner: the Safe
      GLD, NVDA, HIMS, frxUSD one generation per lend asset: its own factory, core, fill router and rollover router
    Native engines            three earlier GageV2Vault deployments; existing loans only
      0xfee7… "V3"            grace 0 · lender sales · adapter 0x2166…
      0x0856… "V2"            grace 48 h · lender sales · adapter 0x647d…
      0x2265… "V2"            grace 48 h · adapter 0x647d…
      per engine              GageV2Registry (owner: the Safe) · GageV2CollateralValidator · GageV2BridgeRewards
                              GageV2EntryRouter · GageV2CashoutRouter (owner: the Safe) · GageV2ZapRouter
                              one collateral account per loan
      GageLegacyAdapter       one per engine generation: the engine's loans earn sGAGE through the legacy vault
    DealVault 0x3D97… (V1)    the original vault, exits only · CollateralRegistry (owner: the Safe) · FeeSink · EntryRouter
    LP extension vaults       DealVaultV2 (Meme / USDG LP), DealVaultV3 (PONS / WETH LP), the Borrow LP Zap vault and the
                              CASHCAT / USDG zap vault, each with a registry (owner: the Safe), fee sink and routers
    GageZapRouter             stateless: GAGE or sGAGE → a GAGE/sGAGE position
    Earn, third design
      EarnFactory 0x124d…     creates a strategy from a mandate · owner: the Safe
      GradeRegistry 0x0250…   grades published by the keeper · owner: the Safe
      EarnVault ×2            Gage USDG Stocks 0x36b4… · Gage USDG Memes 0xc04a… · no owner · closed to deposits
                              lent through 0xfee7… · idle USDG in the Steakhouse USDG reserve 0xbeef…
  Token layer
    sGAGE                     ERC-20, 5,000,000,000 minted once
    Drip                      balances still unlocking on the quadratic curve
    Emissions                 52-week schedule, weekly budgets, rollover, burn at week 52 · owner: the Safe
    DealRewards               registration of funded deals, reservation from the week's budget, drip grants · owner: gage's keeper
    LPHook                    v4 hook on GAGE/sGAGE: records adds and removes, never reverts
    LPRewards                 LP score, emissions stream, collect by position owner · no owner
    FeeFloor 0x042f…          the Pons creator wallet: half to operations, half bought into GAGE floor bands · owner: the Safe
    DealFeeRouter             deal fees → ETH → GAGE → FeeFloor bands · owner: the Safe
    ReinvestRouter            stateless: unlocked sGAGE → a GAGE/sGAGE position, match or zap
    CompoundingSeedBootstrap · CompoundingSeedTimelock   the seed position, NFT 2126377, held for 365 days, fees uncollected since October 2026
EXTERNAL
    Stock Tokens · USDG · WETH · Uniswap v4 and v3 · the Pons GAGE/ETH launch pool · the Steakhouse USDG reserve
    KyberSwap's routers · 0xbow's Privacy Pools v1.3.0, deployed unchanged by gage
```

## The vault layer

**Partner lending.** Since 15 October 2026 every new loan goes to an Intent core, a `GageV2Vault` whose funder gate is bound once to its `IntentFactory`, so only that factory's partner vaults can fund it. A partner vault (`IntentVault`) holds its depositors' asset under a mandate its manager wrote; the fill router funds a listing whole, in one transaction, from one or more vaults, on a plan the rate service signs, and each fill pays an execution fee to the protocol. The USDG core is `0x0086ec1540719d4199432797e2b6068e6ae5a0e5` since 4 November 2026; each lend asset (GLD, NVDA, HIMS, and frxUSD since 5 November) has its own factory, core, fill router and rollover router. A generation a newer one replaces is withdraw-only, as set today: its factory funds no new loans and its core takes no new listings, settings the Safe could change back, while its loans run to their end. Routers act for the borrower: `LoopRouter` (leverage) and `PrivateBorrowRouter` (the private lane) on the USDG core, and a `RolloverRouter` (rollover) on each generation's core. See [Partner vaults](https://docs.gage.cash/earn/partner-vaults.md), [Leverage](https://docs.gage.cash/borrow/leverage.md) and [Pools and screening](https://docs.gage.cash/protocol/private-lane.md).

**The native engines.** Each engine is one immutable `GageV2Vault`. It holds every loan's collateral in a collateral account of its own, holds the lenders' USDG, and keeps every internal balance. It has no owner. A listing funds in four quarters; the loan runs for its term; repayment closes and default finalization opens at the same second. The three earlier engines differ only in what they were deployed with: V3 `0xfee799ade96229c2c128bc5ed9e55f8d9d01a7e9` has no grace and lender sales; `0x0856…` has a 48-hour grace and lender sales; `0x2265…` has a 48-hour grace. They take no new listings and settle the loans they hold. See [Deal lifecycle](https://docs.gage.cash/protocol/deal-lifecycle.md).

Around each engine: its **registry** admits collateral (exact markets, limits), sets the terms, the fee, the sale fee and the pause of new listings; a registry change gates new listings and funding only, never repayment or recovery. The **validator** checks a listing against the exact admitted market. The **entry router** swaps ETH and funds quarters in one transaction; the **zap router** builds an allowed LP position from USDG or WETH and lists it; the **cash-out router** exercises a reclaim right, sells the collateral through admitted routes and repays the cap in one transaction. The **adapter** lets the engine's loans earn sGAGE through the legacy vault's reward contracts; it is a receipt token whose admin, the deployer, selects which engine it serves.

**V1.** `DealVault 0x3D97…` is the original vault: deals, escrow, the state machine, internal balances and fee accounting. It has no owner or upgrade function and takes no new listings; existing balances and deals settle under its own rules. Its registry decides allowlists per lane, minimums, caps, terms, fee and the pause of new deals; the fee and the terms have compile-time bounds. Its fee sink pulls fees and routes them to DealFeeRouter. Its entry router holds nothing between transactions.

**The LP extension vaults.** Four V1-family vaults, one per LP market: `DealVaultV2` for the Meme / USDG LP market, `DealVaultV3` for the PONS / WETH v3 market, and the two zap vaults (Borrow LP Zap, CASHCAT / USDG zap) whose router builds the position and lists it. Each has its own registry and fee sink; their fee forwarders deliver deal fees to DealFeeRouter.

**Earn.** `EarnFactory` creates a strategy from a six-field mandate; public creation is closed, so only its owner creates. A strategy is an `EarnVault` with no owner: one share price over cash, the Steakhouse USDG reserve and loans on V3; both stopped taking deposits on 15 October 2026; a permissionless `settle` books every outcome; the curator (the deployer) sets the fee on loans funded afterwards, up to half of a loan's return, and the deposit cap, and pauses deposits, and never withdraws depositor balances. `GradeRegistry` holds grades the keeper publishes; since D132 every admitted token is published at the top rank, so no strategy's collateral floor binds and the Loan grade in the keeper's policy is the only floor. See [How Earn works](https://docs.gage.cash/earn/how-it-works.md).

**The fee route.** Every deal fee is credited to an internal balance and pulled, never pushed. The 1% origination fee on each loan reaches DealFeeRouter, which buys GAGE in bounded clips (at most 1% price impact per hop, in batches once its threshold is reached) and deposits it into FeeFloor's GAGE-only bands under the market. Nothing is sold back. There is no Buyback contract on mainnet. See [Deal fees and floor liquidity](https://docs.gage.cash/pool/buyback.md).

## The token layer

Nothing in the token layer touches a vault contract. No vault contract reads a token price or holds GAGE or sGAGE. Deal rewards are registered permissionlessly by reading a funded deal from the vault; the app registers right after funding and the keeper backstops within the hour. Rewards leave Emissions only for the reward contracts, unlock on the drip, and are pulled by their owner from Portfolio.

## The services

* **Indexer** consumes vault and token-layer events into loans, balances, drips, epochs, positions, Earn strategies and stats, and serves the read API the app uses.
* **Valuation** values any admitted collateral from the chain's pools, quotes zaps and entries, screens memes, and runs the rates model that suggests a fixed cost for an exact collateral, amount and term.
* **Keeper** registers deal rewards, checkpoints pool positions, releases epochs, processes fee batches, posts the epoch reward rates, publishes grades, settles the Earn strategies' loans, and sends fills and standing rolls. Registrations, checkpoints, releases, fee batches and settlements are public methods; the rest take a role a contract names. A keeper outage delays maintenance and new funding; it never blocks a repayment, a default or a withdrawal.
* **Notifier** posts new loans on X and keeps partner vaults' profiles. It sends no reminders: a borrower's deadline goes in their own calendar.
* **Support** bridges the Contact form to a private Discord channel and answers back to the website; it also takes bug bounty reports behind the 15 USDC deposit, see [Bug bounty](https://docs.gage.cash/protocol/bug-bounty.md).
* **Agent service** at `https://mcp.gage.cash` serves the hosted MCP server and HTTP API: reads, and unsigned transactions for your own agent on the current core and the partner vaults, each with a review link on gage.cash. It holds no key and never signs. See [AI Agents](https://docs.gage.cash/ai-agents/overview.md).

State is fully derivable from events. Nothing the services hold is needed to settle a loan.

## Ownership

The Safe `0x30e8E13E62DFcd063AF763aB29501FeE74C4918e` owns the legacy CollateralRegistry, FeeSink, Emissions, FeeFloor, DealFeeRouter, the two extension registries, the registries and cash-out routers of the native engines, the Intent factories, the loop, rollover and private borrow routers, the second-design HybridFactory, the EarnFactory and the GradeRegistry, since block 62,622,930 (14 September 2026) for the transfers and from their first block for the Earn contracts. gage's keeper `0xf373e8c4C0842CE2A9F675f206BF326A99fa809E` owns DealRewards and posts the epoch rates. The deployer `0x86514e45293fcf111ED8A6bDA7c8bca4A64Dd9E5` remains the two earlier adapters' admin, the Earn curator and fee recipient, and the seed recipient. The vault contracts (DealVault, the extension vaults, the native engines and the Intent cores), LPRewards, the Earn strategies and the partner vaults have no owner and no upgrade path. See [Audits and status](https://docs.gage.cash/protocol/status.md).

## Chain

Robinhood Chain is an Arbitrum Orbit L2 with a single sequencer operated by Robinhood. On the current engine a loan's deadline is one moment, so a sequencer outage in the last hours before the term ends can block a repayment; the mitigation is to repay early. All timing is by block timestamp.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.gage.cash/protocol/architecture.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
