Skip to main content
Agentic Wallet provides backtesting and paper trading capabilities to validate agent strategies before committing real funds. This enables safe strategy development and confidence in autonomous agent behavior.

Overview

Strategy testing provides:
  • Backtesting: Simulate historical strategy performance
  • Paper Trading: Execute intents without on-chain submission
  • Pass/Fail Metrics: Automated strategy validation
  • PnL Tracking: Profit and loss calculation per step
  • Autonomous Decision Validation: Test rule-based agent logic
Backtesting is required for agents when AGENT_REQUIRE_BACKTEST_PASS=true is set in production.

Backtesting Workflow

Backtests evaluate a sequence of strategy steps and calculate success rates.

Define Strategy Steps

1

Create step sequence

Each step represents an intent with a timestamp and optional PnL:
2

Run backtest

3

Evaluate results

Response:
This strategy has passRate: 0.5 but minimumPassRate: 0.7, so passed: false.

Using the CLI

Using the SDK

PnL Calculation

Steps with simulatedPnlLamports >= 0 are counted as passed:
Scenario 1: All Profitable
Scenario 2: Mixed Results
Scenario 3: Below Threshold

Paper Trading Mode

Paper trading executes real intent logic without on-chain submission.

Execute Paper Trade

List Paper Trades

Response:
Paper trades are stored in-memory with a 500-record cap per agent.

Autonomous Decision Engine

Agents can use backtesting to validate autonomous strategies before enabling them.

Strategy Steps

Define repeatable actions with cooldowns and caps:

Strategy Conditions

Use rules to trigger actions based on metrics:
  • tick: Autonomous loop iteration count
  • balance_lamports: Current wallet SOL balance
  • known_wallets_count: Number of registered wallets
  • gt: Greater than
  • gte: Greater than or equal
  • lt: Less than
  • lte: Less than or equal
  • eq: Equal

Template Variables

Use dynamic values in intents:
Supported variables:
  • {{tick}}
  • {{walletId}}
  • {{balanceLamports}}
  • {{knownWallet0}}, {{knownWallet1}}

Enforcing Backtest Requirements

Production Governance

Require passing backtests before agent activation:
When enabled:
  1. Agents must have a passing backtest in their wallet history
  2. Autonomous agents cannot start without a passing backtest
  3. Failed backtests block agent execution

Checking Latest Backtest

Paper Trading for Agents

Set autonomous agents to paper trading mode:
In paper mode, all autonomous actions are logged but not executed on-chain.

Per-Step Paper Mode

CLI Strategy Wizard

Interactive strategy builder:
Select Strategy Wizard and follow prompts:
  1. Choose wallet
  2. Define strategy name
  3. Add steps (type, protocol, intent, PnL)
  4. Set minimum pass rate
  5. Run backtest
  6. Review results

Advanced Patterns

Monte Carlo Backtesting

Run multiple backtest iterations with randomized PnL:

Walk-Forward Analysis

Backtest on rolling time windows:

Next Steps

Multi-Agent Orchestration

Apply validated strategies to agent fleets

Escrow Program

Backtest escrow-based payment strategies