ConvexPi Arena — discrete-time limit-order-book exchange simulator
Project description
convexpi-arena
Discrete-time limit-order-book exchange simulator for quantitative finance education and research.
pip install convexpi-arena
Part of the ConvexPi platform. See also convexpi-lab for the daily-data research harness.
Quick start
from convexpi.arena import Market, Agent, MarketState
import random
class MyAgent(Agent):
def on_tick(self, state: MarketState):
if state.mid and random.random() < 0.1:
return [self.limit('buy', round(state.mid) - 5, 10)]
return []
market = Market(n_background_agents=20)
market.run(ticks=1000, agents=[MyAgent(cash=10_000)])
Run the Arena server
convexpi-server # WebSocket on :8765
convexpi-server --tick-interval 0.2 # faster
convexpi-server --admin-token secret # instructor console
Connect a remote agent:
from convexpi.arena import RemoteAgent
class MyAgent(RemoteAgent):
def on_tick(self, state):
if state.mid and state.position < 50:
return [self.limit('buy', round(state.mid) - 5, 5)]
return []
MyAgent().run('ws://localhost:8765', name='my-agent')
Features
- Price-time priority matching engine
- Background agent population: noise traders, market makers, momentum, informed trader
- Avellaneda-Stoikov optimal market making
- TWAP execution agent
- Risk engine: drawdown limits, position limits, force liquidation
- Crypto L2 replay (Binance / Coinbase candle data)
- WebSocket server with admin-triggered volatility shocks
- Rich terminal visualizer
License
MIT © Shane Conway
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file convexpi_arena-0.1.0.tar.gz.
File metadata
- Download URL: convexpi_arena-0.1.0.tar.gz
- Upload date:
- Size: 40.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
06d525fea96fb0457863d36ca063957aa7ad55f0e9bb23933ee3178b7b8b4e46
|
|
| MD5 |
8835f7827beebedfda2fc9b7dd612c3b
|
|
| BLAKE2b-256 |
66f12e463164ef3ee83dd11f88c542dc95cebe0f52665bc5e94bfd624549d0f6
|
Provenance
The following attestation bundles were made for convexpi_arena-0.1.0.tar.gz:
Publisher:
publish.yml on convexpi/arena
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
convexpi_arena-0.1.0.tar.gz -
Subject digest:
06d525fea96fb0457863d36ca063957aa7ad55f0e9bb23933ee3178b7b8b4e46 - Sigstore transparency entry: 1820355956
- Sigstore integration time:
-
Permalink:
convexpi/arena@51a8af7377af32f75dfa958271a48c0302a48799 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/convexpi
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@51a8af7377af32f75dfa958271a48c0302a48799 -
Trigger Event:
push
-
Statement type:
File details
Details for the file convexpi_arena-0.1.0-py3-none-any.whl.
File metadata
- Download URL: convexpi_arena-0.1.0-py3-none-any.whl
- Upload date:
- Size: 33.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c162df8d63294956a7cad2005294a4a55f8691a74432cef093dab3b97ddddcee
|
|
| MD5 |
e21eae85843ba78b5a5b09886b31dddc
|
|
| BLAKE2b-256 |
8b33c68e9e7ea1442a9afeb792ccc6045f14679b52cd53ed53b1d6a628cec94d
|
Provenance
The following attestation bundles were made for convexpi_arena-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on convexpi/arena
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
convexpi_arena-0.1.0-py3-none-any.whl -
Subject digest:
c162df8d63294956a7cad2005294a4a55f8691a74432cef093dab3b97ddddcee - Sigstore transparency entry: 1820356047
- Sigstore integration time:
-
Permalink:
convexpi/arena@51a8af7377af32f75dfa958271a48c0302a48799 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/convexpi
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@51a8af7377af32f75dfa958271a48c0302a48799 -
Trigger Event:
push
-
Statement type: