_gammadocs
How it works

How it works

How each _gamma vault runs — an autonomous agent that ingests data, ranks strategies, solves for a target portfolio, executes on-chain, and publishes NAV.

Every _gamma vault is operated by an autonomous Gamma Economic Agent (G.E.A.) that runs a continuous loop: ingest market data, analyze it, solve for a target portfolio, execute the moves, and publish NAV. This page gives a high-level overview of each stage.

_gamma architecture pipeline: Data ingestion, then Rate analysis, then ML solver, then Agent execution, feeding back to data ingestion

The agent

The agent loop: Monitor, then Analyze, then Solve, then Execute, repeating every cycle

Each vault has its own agent — gmSTBL, gmSOL, and plRWA each run independently, so a strategy's risk and rebalancing stay contained to its own vault. The agent is a crash-safe, autonomous workflow: work is decomposed into discrete steps whose progress is persisted, so if a process is interrupted mid-cycle it resumes exactly where it left off rather than restarting or double-executing.

An agent holds no user funds beyond a small operational float. Deposits live in on-chain vault programs, and the agent can only construct transactions that move funds within the protocols and instructions its policies permit — it cannot withdraw to an arbitrary destination. Those policies are multisig-gated, and changes require multiple signers. The agent never holds a raw private key in application memory: signing happens inside Google Cloud KMS with hardware-backed keys that never leave the secure boundary. Combined with the multisig-gated policies, this means even a compromise of the application layer cannot move funds outside the approved policy.

Data ingestion

The agent continuously collects market data — rates, liquidity, and prices — across the integrated protocols, cross-checked against on-chain state. On-chain state is authoritative: where a provider-published figure disagrees with the chain, the chain wins, and untrustworthy or stale inputs are dropped rather than acted on. Coverage spans the venues the vaults use, including Kamino, MarginFi, Project Zero, Save, Loopscale, Jupiter Lend, Exponent, and the Nest RWA vaults on Plume.

Rate analysis

From that validated data the agent produces a proprietary, risk-adjusted return estimate for each asset and strategy — a common scale on which a stablecoin lending position, a rate-arbitrage loop, and a fixed-yield position can be compared like-for-like. Actual realized yield remains variable and on-chain verifiable; the risk-adjusted estimate is an internal ranking signal, not a promised return.

The ML solver

An optimization engine continuously computes a target portfolio that balances yield against risk, and rebalances only when the expected improvement clears the real cost of the transition. The result is a diversified target, not an all-in bet on the single highest nominal rate. Configuration expresses business intent by forcing or excluding specific investments through explicit constraints, rather than by distorting the underlying math.

A vault's value and your position both reduce to two numbers: NAV (net asset value — what the vault is worth) and total shares (how many share tokens exist). Share price is simply:

share price = NAV / total shares

Share price equals NAV divided by total shares — NAV is the on-chain value of all positions, total shares is the share-token supply

NAV is the on-chain value of every position the vault holds — lending balances, leverage-loop equity, LST holdings, fixed-yield positions, RWA vault positions, and any liquid asset. Because positions are valued from on-chain reads, NAV reflects the vault's real, verifiable state, and anyone can independently reconstruct it.

The agent publishes NAV on-chain with freshness protection: the vault program blocks deposits and withdrawals when NAV is stale, so you never transact at a mispriced value. Yield accrues to NAV, so as the vault earns, the share price rises and each share is worth more — there is nothing to claim or restake. Deposits mint shares and withdrawals burn them, both at the same fresh, NAV-derived price, so existing depositors are neither diluted by new deposits nor shortchanged by withdrawals.

Next: Deposits & withdrawals