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

# Smart contract architecture

> Contract layout: StrategyLedger, StrategyMemory, Vault.

The Perps Agent proof layer on Mantle Sepolia is **three** minimal contracts. Each has one job.

## Contracts

### `StrategyLedger`

Commits the config hash **before** trading and attests the verified outcome **after**.

* Append-only.
* A `runId` can only be committed once and attested once.
* The attestation references the original commit by `runId`.

### `StrategyMemory`

Append-only log of `regime → params → outcome` records, read back by the AI loop's recall step.

* Public, tamper-proof training signal.
* Indexed by market and regime for fast recall.

### `Vault`

Performance bond and on-chain fee settlement (native **MNT**).

* Holds the agent's performance bond.
* Settles fees on-chain rather than off-chain invoicing.

## Properties

* **Append-only.** Nothing is ever deleted or rewritten.
* **Minimal.** No upgrades that could rewrite history; any change ships as a new deployment.
* **Non-custodial for traders.** The Vault holds the agent's bond, not user trading capital. User funds stay on Bybit.

<Note>
  Live addresses: see [Deployed addresses](/mantle/deployed-addresses).
</Note>
