Skip to main content

FastMM

CI Docs PyPI License

FastMM is a low-latency market-making engine. Read the documentation.

If you are running FastMM on Binance, try bndesk, a real-time dashboard for your accounts.

Features

  • Strategies in C++ or Python. Python hooks marked @fastmm.hot compile to machine code with Numba.
  • One strategy file for backtest and live. Replays are deterministic, and the simulated exchange models queue position.
  • Account pools. Several sub-accounts trade behind one venue, and orders spread across them.
  • Gateway. One fastmm-gateway holds the exchange connections; several strategy processes attach to it and can stop or restart without dropping them.
  • Live control. fastmm-ctl changes a running session's parameters without a restart.
  • Low-latency tuning. Host and network tuning built in, such as core pinning and kernel bypass.

Quickstart

python3 -m venv .venv && . .venv/bin/activate
pip install "fastmm-engine[hot]"
fastmm init my-mm && cd my-mm
python backtest.py

This runs a strategy on a simulated market, with no account and no API keys (Linux x86-64, Python 3.10+). On Debian and Ubuntu, sudo apt install python3-venv first.

A strategy

import fastmm
from fastmm import Param


class TouchMM(fastmm.Strategy):
    half_spread_bps = Param(0.01, min=0.0, doc="half spread, bps")
    quote_qty = Param(0.002, min=0.0, doc="size per side")

    @fastmm.hot  # compiled to machine code with Numba
    def on_book(self, ctx, book):
        if not book.valid:
            ctx.pull()
            return
        half = book.mid * self.half_spread_bps * 1e-4
        ctx.clear()
        ctx.bid(book.mid - half, self.quote_qty)
        ctx.ask(book.mid + half, self.quote_qty)
        ctx.keep_passive()

Exchanges

Binance, OKX, Bybit, Gate, Deribit, Gemini and Coinbase. Nasdaq over TotalView-ITCH and OUCH 5.0.

License

MIT

Metadata

Release files for fastmm-engine 0.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fastmm-engine 0.5.0
File Size Uploaded
fastmm_engine-0.5.0.tar.gz 4.0 MB Details

Built distributions (wheels)

Table of built distributions (wheels) for fastmm-engine 0.5.0
File
fastmm_engine-0.5.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.14 CPython 3.14 Linux glibc 2.28+ x86-64, Linux glibc 2.27+ x86-64 Details
fastmm_engine-0.5.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.28+ x86-64, Linux glibc 2.27+ x86-64 Details
fastmm_engine-0.5.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.27+ x86-64, Linux glibc 2.28+ x86-64 Details
fastmm_engine-0.5.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.28+ x86-64, Linux glibc 2.27+ x86-64 Details
fastmm_engine-0.5.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.27+ x86-64, Linux glibc 2.28+ x86-64 Details

Total release size: 17.8 MB

Release files / fastmm_engine-0.5.0.tar.gz

Download URL fastmm_engine-0.5.0.tar.gz
Size 4.0 MB
Tags Source
SHA-256 checksum
How to use checksums
22746eacd5224cdd9904964642f9ab050711afbcf1b9ca515f01f00dc64d4e92
BLAKE2b-256 checksum
How to use checksums
1089bae8e6a96591e1fbbbdff30c238f2121b2786552092c1c9dc77909cd5c19
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / fastmm_engine-0.5.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL fastmm_engine-0.5.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 2.8 MB
Tags CPython 3.14 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
d1af58b937aa70e261c62acc98acb5e7c7c2e6956fbfa20f69202552fc5a841e
BLAKE2b-256 checksum
How to use checksums
ccd9b660df63793356f7a71a5e9103a0797fa21515378f0576863d149a870709
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / fastmm_engine-0.5.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL fastmm_engine-0.5.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 2.8 MB
Tags CPython 3.13 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
2b6c1dda3d2e801d0285251117b01448781733a3682613e0963b60a8a44b61be
BLAKE2b-256 checksum
How to use checksums
65909d76b0fcb7f9fa065f55426a329ee2bf332cbad92a95f128f541079845dc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / fastmm_engine-0.5.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL fastmm_engine-0.5.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 2.8 MB
Tags CPython 3.12 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
85d634f8ae4d4904cf34d20a9a75777dac1608ef67878504b1faf0d299912194
BLAKE2b-256 checksum
How to use checksums
5a285af568834d819663935b8f74eaf0b4822c6a18f20da0679587017f427a47
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / fastmm_engine-0.5.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL fastmm_engine-0.5.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 2.7 MB
Tags CPython 3.11 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
7d13fb0ca6a9f66fcd8f3a02c0746b2fb43ed1d01dda03ecae193262448c061b
BLAKE2b-256 checksum
How to use checksums
d74147a71e93f93dec2d957015314ccc3ed62d8d4daa84e86f9bd57fbbe07ae8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / fastmm_engine-0.5.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL fastmm_engine-0.5.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 2.7 MB
Tags CPython 3.10 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
1502cc3f50b4e0e30d16c401e8a162322a0fe187b040d172d5d38fb2e63ace1d
BLAKE2b-256 checksum
How to use checksums
25b223ad5d7aaa4c127a56277ba30cac9513615beea5917ed0a7db5022472d12
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release history Release notifications | RSS feed

0.6.0

6 release files

0.5.1

6 release files

This release

0.5.0 This release

6 release files

0.4.0

7 release files

0.3.0

7 release files

0.2.0

7 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page