# jpmorganchase/abides-jpmc-public architecture

> Architecture diagram of the GitHub repository jpmorganchase/abides-jpmc-public, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/jpmorganchase/abides-jpmc-public
- Repository: https://github.com/jpmorganchase/abides-jpmc-public

## Overview

ABIDES combines a latency-aware discrete-event simulator, a financial-market simulation, and Gym wrappers for agent interaction and reinforcement learning. A regular run builds a market configuration, initializes its agents and oracle, then the kernel schedules messages and wakeups until the simulation ends; trading agents exchange orders and market queries with the exchange. Gym environments wrap that simulation as reset/step episodes, translating actions and observations for daily-investor or execution tasks. The tree and README establish these capabilities; sampled excerpts support core scheduling, order handling, and execution-state flow, but not every message dispatch.

Main entry points: [`abides-markets/abides_markets/agents/exchange_agent.py`](https://github.com/jpmorganchase/abides-jpmc-public/blob/main/abides-markets/abides_markets/agents/exchange_agent.py) (Exchange agent), [`abides-core/abides_core/kernel.py`](https://github.com/jpmorganchase/abides-jpmc-public/blob/main/abides-core/abides_core/kernel.py) (Event kernel), [`abides-markets/abides_markets/agents/trading_agent.py`](https://github.com/jpmorganchase/abides-jpmc-public/blob/main/abides-markets/abides_markets/agents/trading_agent.py) (Trading agents), [`abides-markets/abides_markets/configs/rmsc04.py`](https://github.com/jpmorganchase/abides-jpmc-public/blob/main/abides-markets/abides_markets/configs/rmsc04.py) (RMSC configs)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_core["Simulation Core"]
  node_kernel["Event kernel<br/>[kernel.py]"]
  node_agent["Agent runtime<br/>[agent.py]"]
  node_latency["Latency model<br/>[latency_model.py]"]
  node_messages["Message types<br/>[message.py]"]
end

subgraph group_market["Market Simulation"]
  node_config["RMSC configs<br/>[rmsc04.py]"]
  node_generator["Agent generators<br/>[generators.py]"]
  node_trading["Trading agents<br/>[trading_agent.py]"]
  node_exchange["Exchange agent<br/>[exchange_agent.py]"]
  node_book[("Order book<br/>[order_book.py]")]
  node_orders["Order models<br/>[orders.py]"]
  node_marketmessages["Market messages"]
  node_background["Background agents"]
  node_marketmaker["Adaptive market maker"]
  node_oracle["Fundamental oracle"]
  node_noise["Noise agents<br/>[noise_agent.py]"]
  node_value["Value agents<br/>[value_agent.py]"]
end

subgraph group_gym["Gym Environments"]
  node_gymapi["Gym API"]
  node_execution["Execution environment"]
  node_investor["Daily investor environment"]
  node_gymagent["Gym simulation agent<br/>[core_gym_agent.py]"]
  node_financialgym["Financial Gym agent"]
end

node_researcher(("Simulation user"))
node_rl(("RL learner"))

node_researcher -->|"selects configuration"| node_config
node_config -->|"configures agents"| node_generator
node_researcher -->|"starts simulation"| node_kernel
node_config -->|"provides agents"| node_kernel
node_kernel -->|"dispatches events"| node_agent
node_kernel -->|"calculates delivery delay"| node_latency
node_agent -->|"sends messages"| node_kernel
node_trading -->|"submits orders"| node_exchange
node_trading -->|"uses message types"| node_marketmessages
node_exchange -->|"updates book"| node_book
node_exchange -->|"dispatches messages"| node_marketmessages
node_book -->|"stores orders"| node_orders
node_exchange -->|"returns market data"| node_trading
node_marketmaker -->|"extends trading behavior"| node_trading
node_background -->|"extends trading behavior"| node_trading
node_marketmaker -->|"requests quotes"| node_exchange
node_background -->|"submits orders"| node_exchange
node_noise -->|"submits orders"| node_exchange
node_value -->|"submits orders"| node_exchange
node_config -->|"creates oracle"| node_oracle
node_gymapi -->|"runs episodes"| node_kernel
node_execution -->|"configures task"| node_gymapi
node_investor -->|"configures task"| node_gymapi
node_gymapi -->|"steps agent"| node_gymagent
node_gymagent -->|"acts in simulation"| node_kernel
node_gymagent -->|"uses trading behavior"| node_trading
node_execution -->|"uses task agent"| node_financialgym
node_execution -->|"exposes observations and rewards"| node_rl
node_rl -->|"provides actions"| node_execution
node_investor -->|"exposes observations and rewards"| node_rl
node_rl -->|"provides actions"| node_investor

click node_config "https://github.com/jpmorganchase/abides-jpmc-public/blob/main/abides-markets/abides_markets/configs/rmsc04.py"
click node_generator "https://github.com/jpmorganchase/abides-jpmc-public/blob/main/abides-markets/abides_markets/generators.py"
click node_kernel "https://github.com/jpmorganchase/abides-jpmc-public/blob/main/abides-core/abides_core/kernel.py"
click node_agent "https://github.com/jpmorganchase/abides-jpmc-public/blob/main/abides-core/abides_core/agent.py"
click node_latency "https://github.com/jpmorganchase/abides-jpmc-public/blob/main/abides-core/abides_core/latency_model.py"
click node_messages "https://github.com/jpmorganchase/abides-jpmc-public/blob/main/abides-core/abides_core/message.py"
click node_trading "https://github.com/jpmorganchase/abides-jpmc-public/blob/main/abides-markets/abides_markets/agents/trading_agent.py"
click node_exchange "https://github.com/jpmorganchase/abides-jpmc-public/blob/main/abides-markets/abides_markets/agents/exchange_agent.py"
click node_book "https://github.com/jpmorganchase/abides-jpmc-public/blob/main/abides-markets/abides_markets/order_book.py"
click node_orders "https://github.com/jpmorganchase/abides-jpmc-public/blob/main/abides-markets/abides_markets/orders.py"
click node_marketmessages "https://github.com/jpmorganchase/abides-jpmc-public/tree/main/abides-markets/abides_markets/messages"
click node_background "https://github.com/jpmorganchase/abides-jpmc-public/blob/main/abides-markets/abides_markets/agents/background_v2/core_background_agent.py"
click node_marketmaker "https://github.com/jpmorganchase/abides-jpmc-public/blob/main/abides-markets/abides_markets/agents/market_makers/adaptive_market_maker_agent.py"
click node_oracle "https://github.com/jpmorganchase/abides-jpmc-public/blob/main/abides-markets/abides_markets/oracles/sparse_mean_reverting_oracle.py"
click node_noise "https://github.com/jpmorganchase/abides-jpmc-public/blob/main/abides-markets/abides_markets/agents/noise_agent.py"
click node_value "https://github.com/jpmorganchase/abides-jpmc-public/blob/main/abides-markets/abides_markets/agents/value_agent.py"
click node_gymapi "https://github.com/jpmorganchase/abides-jpmc-public/blob/main/abides-gym/abides_gym/envs/core_environment.py"
click node_execution "https://github.com/jpmorganchase/abides-jpmc-public/blob/main/abides-gym/abides_gym/envs/markets_execution_environment_v0.py"
click node_investor "https://github.com/jpmorganchase/abides-jpmc-public/blob/main/abides-gym/abides_gym/envs/markets_daily_investor_environment_v0.py"
click node_gymagent "https://github.com/jpmorganchase/abides-jpmc-public/blob/main/abides-gym/abides_gym/experimental_agents/core_gym_agent.py"
click node_financialgym "https://github.com/jpmorganchase/abides-jpmc-public/blob/main/abides-gym/abides_gym/experimental_agents/financial_gym_agent.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_kernel,node_agent,node_latency,node_messages,node_researcher toneBlue
class node_config,node_generator,node_trading,node_exchange,node_book,node_orders,node_marketmessages,node_background,node_marketmaker,node_oracle,node_noise,node_value toneAmber
class node_gymapi,node_execution,node_investor,node_gymagent,node_financialgym toneMint
class node_rl toneIndigo
```

## Components

### Simulation Core

- [Event kernel](https://github.com/jpmorganchase/abides-jpmc-public/blob/main/abides-core/abides_core/kernel.py): `abides-core/abides_core/kernel.py`
- [Agent runtime](https://github.com/jpmorganchase/abides-jpmc-public/blob/main/abides-core/abides_core/agent.py): `abides-core/abides_core/agent.py`
- [Latency model](https://github.com/jpmorganchase/abides-jpmc-public/blob/main/abides-core/abides_core/latency_model.py): `abides-core/abides_core/latency_model.py`
- [Message types](https://github.com/jpmorganchase/abides-jpmc-public/blob/main/abides-core/abides_core/message.py): `abides-core/abides_core/message.py`

### Market Simulation

- [RMSC configs](https://github.com/jpmorganchase/abides-jpmc-public/blob/main/abides-markets/abides_markets/configs/rmsc04.py): `abides-markets/abides_markets/configs/rmsc04.py`
- [Agent generators](https://github.com/jpmorganchase/abides-jpmc-public/blob/main/abides-markets/abides_markets/generators.py): `abides-markets/abides_markets/generators.py`
- [Trading agents](https://github.com/jpmorganchase/abides-jpmc-public/blob/main/abides-markets/abides_markets/agents/trading_agent.py): `abides-markets/abides_markets/agents/trading_agent.py`
- [Exchange agent](https://github.com/jpmorganchase/abides-jpmc-public/blob/main/abides-markets/abides_markets/agents/exchange_agent.py): `abides-markets/abides_markets/agents/exchange_agent.py`
- [Order book](https://github.com/jpmorganchase/abides-jpmc-public/blob/main/abides-markets/abides_markets/order_book.py): `abides-markets/abides_markets/order_book.py`
- [Order models](https://github.com/jpmorganchase/abides-jpmc-public/blob/main/abides-markets/abides_markets/orders.py): `abides-markets/abides_markets/orders.py`
- [Market messages](https://github.com/jpmorganchase/abides-jpmc-public/tree/main/abides-markets/abides_markets/messages): `abides-markets/abides_markets/messages`
- [Background agents](https://github.com/jpmorganchase/abides-jpmc-public/blob/main/abides-markets/abides_markets/agents/background_v2/core_background_agent.py): `abides-markets/abides_markets/agents/background_v2/core_background_agent.py`
- [Adaptive market maker](https://github.com/jpmorganchase/abides-jpmc-public/blob/main/abides-markets/abides_markets/agents/market_makers/adaptive_market_maker_agent.py): `abides-markets/abides_markets/agents/market_makers/adaptive_market_maker_agent.py`
- [Fundamental oracle](https://github.com/jpmorganchase/abides-jpmc-public/blob/main/abides-markets/abides_markets/oracles/sparse_mean_reverting_oracle.py): `abides-markets/abides_markets/oracles/sparse_mean_reverting_oracle.py`
- [Noise agents](https://github.com/jpmorganchase/abides-jpmc-public/blob/main/abides-markets/abides_markets/agents/noise_agent.py): `abides-markets/abides_markets/agents/noise_agent.py`
- [Value agents](https://github.com/jpmorganchase/abides-jpmc-public/blob/main/abides-markets/abides_markets/agents/value_agent.py): `abides-markets/abides_markets/agents/value_agent.py`

### Gym Environments

- [Gym API](https://github.com/jpmorganchase/abides-jpmc-public/blob/main/abides-gym/abides_gym/envs/core_environment.py): `abides-gym/abides_gym/envs/core_environment.py`
- [Execution environment](https://github.com/jpmorganchase/abides-jpmc-public/blob/main/abides-gym/abides_gym/envs/markets_execution_environment_v0.py): `abides-gym/abides_gym/envs/markets_execution_environment_v0.py`
- [Daily investor environment](https://github.com/jpmorganchase/abides-jpmc-public/blob/main/abides-gym/abides_gym/envs/markets_daily_investor_environment_v0.py): `abides-gym/abides_gym/envs/markets_daily_investor_environment_v0.py`
- [Gym simulation agent](https://github.com/jpmorganchase/abides-jpmc-public/blob/main/abides-gym/abides_gym/experimental_agents/core_gym_agent.py): `abides-gym/abides_gym/experimental_agents/core_gym_agent.py`
- [Financial Gym agent](https://github.com/jpmorganchase/abides-jpmc-public/blob/main/abides-gym/abides_gym/experimental_agents/financial_gym_agent.py): `abides-gym/abides_gym/experimental_agents/financial_gym_agent.py`

### Other components

- **Simulation user**
- **RL learner**

## Connections

- Simulation user → RMSC configs: selects configuration
- RMSC configs → Agent generators: configures agents
- Simulation user → Event kernel: starts simulation
- RMSC configs → Event kernel: provides agents
- Event kernel → Agent runtime: dispatches events
- Event kernel → Latency model: calculates delivery delay
- Agent runtime → Event kernel: sends messages
- Trading agents → Exchange agent: submits orders
- Trading agents → Market messages: uses message types
- Exchange agent → Order book: updates book
- Exchange agent → Market messages: dispatches messages
- Order book → Order models: stores orders
- Exchange agent → Trading agents: returns market data
- Adaptive market maker → Trading agents: extends trading behavior
- Background agents → Trading agents: extends trading behavior
- Adaptive market maker → Exchange agent: requests quotes
- Background agents → Exchange agent: submits orders
- Noise agents → Exchange agent: submits orders
- Value agents → Exchange agent: submits orders
- RMSC configs → Fundamental oracle: creates oracle
- Gym API → Event kernel: runs episodes
- Execution environment → Gym API: configures task
- Daily investor environment → Gym API: configures task
- Gym API → Gym simulation agent: steps agent
- Gym simulation agent → Event kernel: acts in simulation
- Gym simulation agent → Trading agents: uses trading behavior
- Execution environment → Financial Gym agent: uses task agent
- Execution environment → RL learner: exposes observations and rewards
- RL learner → Execution environment: provides actions
- Daily investor environment → RL learner: exposes observations and rewards
- RL learner → Daily investor environment: provides actions
