Skip to main content
The AI agent loop is the part of Perps Agent that picks the grid parameters and gets better at it over time — in a way that is provable, not just claimed.

The loop

1

Observe

Pull recent market state (price, volatility, funding, microstructure) plus the user’s risk caps.
2

Recall

Read past attested runs on similar regimes from Mantle. Only attested runs count — backtests do not.
3

Propose

Generate candidate grid configs (range, step, count, sizing) that maximize a risk-adjusted score under the user’s caps.
4

Commit

Hash the chosen config and write it to the Mantle commit registry. The agent is now locked to that config.
5

Trade

Hand control to the grid engine on Bybit.
6

Attest

At the end of the run, write the verified outcome on-chain, linked to the original commit.
7

Learn

The next iteration’s “recall” step reads this new attestation. The loop closes.

Why this matters

Most “learning” trading bots train on private data the user can’t see. Perps Agent’s training signal is the public on-chain attestation history. The same data anyone else can verify.

What it optimizes

Not raw PnL. The objective is risk-adjusted: returns penalized by realized variance and drawdown, hard-clipped at the user’s risk caps. A run that hits the drawdown cap is treated as a loss for learning purposes, even if it would have recovered.