Skip to main content

mathema-mcp

Python pricing library for Mathema MCP. Build market objects and trades from dicts, then compute prices and Greeks. pip installs one wheel for your OS and Python version. Excel is not included.

Docs: https://help.mathema.com.cn/

Features

  • Build calendars, rates/credit/FX curves, and volatility surfaces, then attach them to options, swaps, and bonds
  • Load the same objects from a standard market-data snapshot (JSON): mcp_marketdata
  • Vanilla closed-form, barrier/digital, American, and path-dependent structures (Monte Carlo)
  • Volatility: implied surfaces, historical vol, LocalVol, Heston
  • Greeks and related risk measures

User API: mcp.tools / mcp.tool.tools_main. Underlying classes: mcp.wrapper.

Market-data objects

Layer Objects Role
Conventions McpCalendar, McpSchedule, McpRateConvention Holidays, payment schedules, rate conventions
Rates curves McpYieldCurve / McpYieldCurve2, McpSwapCurve, McpForwardCurve, McpParametricCurve Discount, zero, swap, forward
Bond curves McpBondCurve, McpBondSpreadCurve Bond discount and spread
FX curves McpFXForwardPointsCurve / 2, McpXccyBasisCurve Forward points, cross-currency basis
Credit curves McpCreditCurve Hazard rates, default probabilities
Curve building blocks Overnight / Bill / FRA / Swap / Bond *CurveData Instruments used to bootstrap a curve
Volatility McpVolSurface, McpFXVolSurface, McpMktVolSurface (and *2) Equity/commodity, FX, and quoted market surfaces
Rates volatility McpSwaptionCube, McpCapVolStripping Swaption cube, cap stripping
Vol models McpHistVols, McpLocalVol, McpHestonModel Historical, Dupire, stochastic vol
Snapshots McpRawMarketManager, McpMarketDataJsonReader, McpLiveMarketDataStore Standard JSON → the objects above

Asset coverage

The same option shapes (vanilla / barrier / digital / double-digital / Asian) attach to FX, equity, and commodity.

Asset Coverage
FX Spot, forward, NDF, swap; vanilla/barrier/digital/Asian; strategies; structured forwards
Rates IRS, basis swap, cross-currency swap; deposits/loans, FRA; cap/floor, swaption
Credit CDS, CLN; discounting on a credit curve
Bonds Fixed, amortizing, callable; repo, securities lending, bill discount; bond forward/future; ABS tranches
Equity Spot, future, fund; vanilla/barrier/digital; snowball, phoenix, autocall, range accrual
Commodity Futures, options; commodity lending
TRS Equity TRS, bond TRS

Convertible bonds are priced on the structured-product path.

Install

pip install mathema-mcp

For table-style APIs (FixedLegs / McpPayoff and similar):

pip install "mathema-mcp[data]"

Or install a downloaded wheel:

pip install path/to/mathema_mcp-1.6.0-cp39-cp39-win_amd64.whl

Usage

The main entry is dict arguments, not SWIG positional args:

from mcp.tools import McpCalendar, McpVersion
from mcp.tool.tools_main import McpYieldCurve
from mcp.utils.enums import DayCounter, Frequency, InterpolatedVariable, InterpolationMethod

print(McpVersion())
cal = McpCalendar()
yc = McpYieldCurve({
    "ReferenceDate": "2024-12-13",
    "Tenors": ["1M", "1Y"],
    "ZeroRates": [0.03, 0.035],
    "Calendar": cal,
    "DayCounter": DayCounter.Act365Fixed,
    "Frequency": Frequency.Continuous,
    "Variable": InterpolatedVariable.SIMPLERATES,
    "InterpolationMethod": InterpolationMethod.LINEARINTERPOLATION,
})

Dict construction does not require numpy or pandas. Those are only needed for the table APIs ([data]).

Supported wheels

Platform Python Tag
Windows x64 3.9–3.13 win_amd64
Linux x64 (glibc ≥ 2.28) 3.9–3.13 manylinux_2_28_x86_64

Runtime

Public wheels are built without CUDA. A local CUDA toolkit or runtime is not required. Structured products use CPU multithreading. GPU Monte Carlo is not included.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

mathema_mcp-1.6.0-cp313-cp313-win_amd64.whl (10.5 MB view details)

Uploaded CPython 3.13Windows x86-64

mathema_mcp-1.6.0-cp313-cp313-manylinux_2_28_x86_64.whl (17.1 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ x86-64

mathema_mcp-1.6.0-cp312-cp312-win_amd64.whl (10.5 MB view details)

Uploaded CPython 3.12Windows x86-64

mathema_mcp-1.6.0-cp312-cp312-manylinux_2_28_x86_64.whl (17.1 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64

mathema_mcp-1.6.0-cp311-cp311-win_amd64.whl (10.5 MB view details)

Uploaded CPython 3.11Windows x86-64

mathema_mcp-1.6.0-cp311-cp311-manylinux_2_28_x86_64.whl (17.1 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64

mathema_mcp-1.6.0-cp310-cp310-win_amd64.whl (10.5 MB view details)

Uploaded CPython 3.10Windows x86-64

mathema_mcp-1.6.0-cp310-cp310-manylinux_2_28_x86_64.whl (17.1 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.28+ x86-64

mathema_mcp-1.6.0-cp39-cp39-win_amd64.whl (10.5 MB view details)

Uploaded CPython 3.9Windows x86-64

mathema_mcp-1.6.0-cp39-cp39-manylinux_2_28_x86_64.whl (17.1 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.28+ x86-64

File details

Details for the file mathema_mcp-1.6.0-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for mathema_mcp-1.6.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 9088b874fad32f7524b3bcf8b98e4392b00fc7a83a8b437291554e7631e528c3
MD5 0b603515cd0bae1dad050ad5ae954a67
BLAKE2b-256 ed72a5c3e99e9987c15dc570271e60429c556b2d19172338f86954b9d9b09fa9

See more details on using hashes here.

File details

Details for the file mathema_mcp-1.6.0-cp313-cp313-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for mathema_mcp-1.6.0-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 149910f80f96a651240f3074b310a419ff185afd230766539d991623e2886b7b
MD5 79e830c018c429037696fe4411be2f23
BLAKE2b-256 c26b3eef451ae554b9b950a6193de22b073eb0eff9810e7d8d192db487d02478

See more details on using hashes here.

File details

Details for the file mathema_mcp-1.6.0-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for mathema_mcp-1.6.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 adefaf4b221fbe4bd302cb5d52bd01394f982860541f61fe624abf5776a467bd
MD5 770ad55b443883a97960fda8a83c707a
BLAKE2b-256 35d2d623235d53501cc301755d62e2fe652ffd364264f1543b248d38c5be1dbe

See more details on using hashes here.

File details

Details for the file mathema_mcp-1.6.0-cp312-cp312-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for mathema_mcp-1.6.0-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 ba8d3133d702f85ddec753a919d8fa01f94a665a64ebbb25b92cc47eee2151db
MD5 2867945b38512a7482fe4e6d7a4854f2
BLAKE2b-256 4b85bce0a16c3b7180876df461f1f0abe6e14af8f4234207f5b05368b47715e9

See more details on using hashes here.

File details

Details for the file mathema_mcp-1.6.0-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for mathema_mcp-1.6.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 bbdcb2c8154481018463c7dadcda36d351a6ee5ac3e83d4ee3e7b8fe1aae9404
MD5 a3c89972524e795ccf48dce39c929362
BLAKE2b-256 59e59bcef0a2038ccc44545ed3d4810ce13b8e2c5e5564ac85299cfbf179fd01

See more details on using hashes here.

File details

Details for the file mathema_mcp-1.6.0-cp311-cp311-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for mathema_mcp-1.6.0-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 7c6a28bb1e98de0e53735eede8112f63662ac3075a37f0b2513d7c46f1321bc1
MD5 5d57c9357d698c305ed49331089b44d2
BLAKE2b-256 b66ddad325e3f320d8bd444a4809e89838a44c4d5b6d12cdf1ebf702d53abe53

See more details on using hashes here.

File details

Details for the file mathema_mcp-1.6.0-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for mathema_mcp-1.6.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 801552ca2c298b8b03a2e5d64a9b62b85ad0577c6d7334ec1327ed451674432f
MD5 a89babbe3fafd5e0a207d44e72849f44
BLAKE2b-256 ef787e73f4b66a3b6530941650663c4cd06a329c60ad37dee2f7fa80386e9399

See more details on using hashes here.

File details

Details for the file mathema_mcp-1.6.0-cp310-cp310-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for mathema_mcp-1.6.0-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 c80ebb952fe5bc53b32d26e009db570dd6596e7a1573abc60a88a3c0c17ee94e
MD5 8f506e875f30fc5294e6a09cb1c1df1b
BLAKE2b-256 ac2cdc904b2f1564d467a873229fc1986e1384b36e35e275adf1f84c19b421b1

See more details on using hashes here.

File details

Details for the file mathema_mcp-1.6.0-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: mathema_mcp-1.6.0-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 10.5 MB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.12

File hashes

Hashes for mathema_mcp-1.6.0-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 0b0b38a77c818e1b10a838345e155672406490cfb65faff50588288051a05dab
MD5 8a3d544368cd283bdb02121fe4c1ed76
BLAKE2b-256 ea0720b5dba373a65186a9db3ed401c60aa29d24a90ce0246b4c618b95acb467

See more details on using hashes here.

File details

Details for the file mathema_mcp-1.6.0-cp39-cp39-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for mathema_mcp-1.6.0-cp39-cp39-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 7ac7bc9e5e665bcb83061284668926e2d006b51d31a696c521b69ab346c4999f
MD5 d4f612baded8e201ebf3996c263c3335
BLAKE2b-256 f70b6eee17d102d8e3f838654b7e22218a369b7c73adf9b9d11a6ee3ecadb191

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.6.0 This release

10 files

1.5.0

10 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