Markets Are Social.
Models Should Be Too.

We build AI agent-based simulations to stress-test trading strategies and manage real-world market risk.

The problem: The Single-Path Trap

Walk-Forward and Monte Carlo miss the real dynamics.

Walk-forward tests replay exactly one historical path, so they can only tell you how a strategy would have performed in regimes that already happened. Monte Carlo methods extend this by resampling or perturbing returns, sometimes with regime switching, copulas, or filtered historical simulation. Most approaches treat market participants as a passive source of noise rather than adaptive agents who learn, react, imitate, and adjust leverage endogenously.

When strategies themselves affect prices and counterparties are linked by hidden exposure networks, the true distribution of outcomes is generated by social and market dynamics that resampling alone cannot reproduce.

Traditional single path backtest compared with multiverse simulation
A new wrinkle: AI trading agents

Autonomous agents create new market dynamics.

Autonomous trading agents introduce feedback loops not in historical data. Unlike rule-based algorithms, they learn, coordinate, and react to each other in real time, producing sudden herding, model monoculture, and liquidity shocks that traditional backtests do not capture.

That means the next decade of market structure may be out-of-distribution relative to the past. Instead of backtesting against one realized past, we simulate markets as complex adaptive systems so traders can stress-test strategies against emergent behaviors before they happen.

Most AI finance projects focus on building better trading agents. We started with risk management because we believe the most important question today is not whether your strategy generates alpha, but whether it survives when everyone deploys AI agents.

AI trading agents creating emergent market dynamics
The solution: AI agent-based models

We help with risk management so you can focus on trading strategy.

Recent advances in AI enable new ways to model the true probability distributions behind market moves, including the rare extremes where portfolios actually break. This is why we have created software for stress-testing trading strategies & risk management utilizing intelligent AI agents. Through multiverse simulations based on the sociology of markets, it is possible to better understand the emergent nature of low probability but extreme outcomes, and plan accordingly.

// Traditional backtest
returns.hist().walk_forward() // one path
 
// LeveeBacktest™ multiverse
levee.run(strategy, agents, shock_model="cgmy", universes=100000)
1
Run
100K+
Simulated Universes
4σ+
Tail Event Capture
(fat-tailed CGMY models)
Product

LeveeBacktest™ Engine

A backtester powered by LoRA-fine-tuned LLM agents, built for reflexive, social markets. Run your strategy through thousands of agent-based universes instead of one historical path.

True Contagion Modeling

Standard backtests assume independent actors. LeveeBacktest™ populates each universe with heterogeneous agents connected by embedded networks. When a threshold is crossed, behavior cascades just like in real markets.

import embeddedmarkets as em

// Load heterogeneous agent population with network structure
agents = em.levee.agents.from_config(
  path="configs/agent_archetypes.json",
  interaction_model="belief_similarity", // alternatives: "transaction_network", "herding_correlation"
)

// Run multiverse simulation
sim = em.levee.run(
  strategy=my_strategy,
  agents=agents,
  market_data=price_series, // sim extends it forward
  shock_model="cgmy",
  // Calibrated CGMY parameters for reference universe
  shock_params="configs/cgmy_baseline.toml",
  universes=100000,
  horizon="252D", // one trading year
  random_seed=42
)

// Inspect tail risk: CVaR, max drawdown, crash frequency
summary = sim.tail_risk.summary()
summary.plot_drawdown_distribution()
Product

emPortfolioAnalyzer™

True portfolio risk comes from how assets move together under stress, not historical individual volatilities. emPortfolioAnalyzer™ enables regime-specific correlation analyses and hypothetical position sizing aligned with return targets, drawdown tolerance, and risk budgets.

Correlation & Hypothetical Position Sizing Intelligence

Understand how your holdings move together across regimes and implications for hypothetical position sizing based on your stated objectives.

import embeddedmarkets as em

// Load holdings
portfolio = em.load_portfolio("holdings.csv")

// Portfolio analysis using LeveeBacktest stress output as input
analyzer = em.PortfolioAnalyzer(
  portfolio=portfolio,
  objective="max_sortino_ratio",
  max_drawdown=0.15, // 15% max drawdown over the horizon
  stress_distribution=sim.tail_risk
)

// Output hypothetical position sizes
implied_weights = analyzer.evaluate()
print(implied_weights)
Capability Walk-Forward Monte Carlo LeveeBacktest™
Market pathsOne realized historyRandom draws from historical distributionMultiverse of agent-driven histories
Social structureNot modeledNot modeledNetworks, trust, and threshold cascades
Reflexivity / feedback loopsNot modeledNot modeledAgents react and adjust endogenously
Tail eventsOnly observed crashesDistribution-dependent; no cascade dynamicsLévy-flight shocks + contagion amplification
Foundational Knowledge

The Theory Behind the Code

Traditional quant finance leans into economics, applied math, and physics.

We lean into sociology & complex systems: embeddedness, networks, collective action.

Ideas that have influenced our thinking

01: Granovetter

Network Embeddedness

Map how trust, reputation, and relationships constrain price formation and create feedback loops.

02: Carley, Coleman, Macy, and Willer

Agent-Based Multiverse

Simulate thousands of possible market histories, each shaped by heterogeneous agents with capital constraints, social ties, beliefs (information distributions), and probabilities of interaction.

03: Granovetter and Schelling

Threshold Models

Model collective action tipping points: when enough peers move, cascades trigger regime shifts and liquidity evaporation.

04: Burt

Structural Holes

Markets fragment into clusters separated by gaps in communication and trust. Bridges across structural holes control price discovery.

05: Tuma, Hannan, and Allison

Event History Analysis

Estimate strategy decay curves under different sociological regimes, so you know when to switch strategies before alpha dies.

06: Beck

Manufactured Risk

Modern systems do not just face external shocks — they manufacture low-probability, high-consequence risks. Financial markets amplify these tail events through leverage, correlation, and institutional feedback loops.

Multiverse Scenarios

History shows us one path. We simulate the distribution.

Traditional walk-forward backtests evaluate a strategy along one realized historical path, replaying what happened or close resamplings of it. LeveeBacktest™ propagates that same strategy through ensembles of agent-driven counterfactual histories, so you can evaluate hypothetical position sizing and manage risk across regimes the historical record never contained.

Even historically sound strategies run by intelligent managers fail more often than one might expect, undone by rapid, catastrophic drawdowns when over-concentration or leverage collides with unusual circumstances, changes in market microstructure, or sudden regime shifts. Four sigma events and beyond are therefore core risk scenarios rather than edge cases. This is the classic micro-to-macro aggregation problem from sociology and one reason economic sociology rejects the Walrasian assumption that market outcomes can be derived from closed-form equilibrium equations. System-level behavior emerges from interacting agents. AI agent-based simulation is a methodologically sound way to identify and manage the true underlying risk.

Family Typical z-Score range Realism
Methodology (less than -3.5) Mild stress Very realistic
Operational / Cyber / Pandemic (-3.5 to -4.0) Severe crisis Infrequent but plausible
Market Structure / Derivatives (-4.0 to -4.3) Systemic crash Unprecedented but conceivable
Leverage/Credit / Sovereign / FX / Geopolitical (-4.3 to -4.8) Depression-level or worse Hypothetical
Existential / Natural catastrophe / Military conflict (greater than -4.8) Apocalyptic Model artifact or “market not even open”
Licensing

Public Beta Coming Soon

Our tools are designed for small trading firms, professional traders, and technically oriented individual investors. Pricing tiers will be announced after the beta release. There will be open source and/or freemium tiers.

LeveeBacktest™ is currently in private preview. You can sign up below to be notified when the public beta is released.

Public Beta Notification

Private Preview

Ready to Test Strategies Across Possible Futures?

←Demos are coming soon