Metadata-Version: 2.4
Name: sipQuant
Version: 2.0.0
Summary: The Python toolkit for SIP Global benchmark data: index API client, pricing, structured products, risk and physical trade logistics.
Author-email: SIP Global <packages@sipglobally.com>
License-Expression: Apache-2.0
Project-URL: SIP Global, https://sipglobally.com
Project-URL: Data plans, https://sipglobally.com/data/
Project-URL: Homepage, https://github.com/Systematic-Index-Partners/sipQuant
Project-URL: Documentation, https://sipquant.readthedocs.io/en/latest/
Project-URL: Bug Tracker, https://github.com/Systematic-Index-Partners/sipQuant/issues
Keywords: commodities,benchmark,index,quant,derivatives,structured-products,risk,trade,logistics,mcp
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Operating System :: OS Independent
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Financial and Insurance Industry
Classifier: Topic :: Office/Business :: Financial
Classifier: Topic :: Scientific/Engineering :: Mathematics
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy>=1.23
Provides-Extra: mcp
Requires-Dist: mcp<2,>=1.2; extra == "mcp"
Dynamic: license-file

<p align="center">
  <a href="https://sipglobally.com/">
    <picture>
      <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/Systematic-Index-Partners/sipQuant/main/docs/source/_static/logo-light.png">
      <img src="https://raw.githubusercontent.com/Systematic-Index-Partners/sipQuant/main/docs/source/_static/logo.png" alt="SIP Global" width="120">
    </picture>
  </a>
</p>

<h1 align="center">sipQuant</h1>

<p align="center">
  <b>The Python toolkit for SIP Global benchmark data.</b><br>
  The reference price for specialty commodities, in your research, valuation and risk stack.
</p>

<p align="center">
  <a href="https://pypi.org/project/sipQuant/"><img src="https://img.shields.io/pypi/v/sipQuant?color=193244&label=PyPI" alt="PyPI"></a>
  <a href="https://www.python.org/downloads/"><img src="https://img.shields.io/badge/python-3.10%2B-0063A8" alt="Python 3.10+"></a>
  <a href="https://github.com/Systematic-Index-Partners/sipQuant/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-Apache--2.0-387630" alt="Apache-2.0"></a>
  <a href="https://sipquant.readthedocs.io/en/latest/"><img src="https://img.shields.io/badge/docs-readthedocs-C9A45C" alt="Docs"></a>
</p>

---

SIP Global publishes one global standard for physical specialty commodities: the **SIP Indices**, daily reference prices across markets and commodities worldwide, with history back to June 1988. sipQuant is the official client. It pulls every index from the SIP Global API as a typed series and carries it through pricing, structured products, risk, portfolio construction and physical trade logistics.

- **One dependency.** Pure NumPy and the Python standard library. Nothing to audit beyond `numpy`.
- **Built for desks.** Option and structured product pricing, VaR and stress testing, OTC book management and index governance in one package.
- **Physical first.** Basis, grade and freight differentials, container loads, landed cost, Incoterms and HS codes sit next to the quant tools.
- **AI ready.** A local MCP server lets Claude, Cursor and other assistants query SIP data and run the toolkit.

## Install

```bash
pip install sipQuant
```

Python 3.10 or later. The MCP server is an optional extra: `pip install "sipQuant[mcp]"`.

## Quickstart

Data access requires a SIP Global API key. Set it once:

```bash
export SIP_API_KEY=your_key
```

Plans and keys: [sipglobally.com/data](https://sipglobally.com/data/).

```python
import numpy as np
import sipQuant as sq

indices = sq.data.catalog()
ps = sq.data.fetch('US_VAN_TL', start='2020-01-01')
r = np.diff(np.log(ps['values']))

sq.risk.var(r, alpha=0.05, method='historical')
sq.risk.rollingVol(r, window=21)
sq.fit.fitOU(ps['values'], dt=1/252)
```

Every series arrives as a validated `sq.schema.PriceSeries` (dates as `datetime64[D]`, values as `float64`). API errors raise `sq.data.SIPAPIError` with `status`, `message` and, on a 429, `retry_after`.

## Structured products

Price the hedges producers and consumers actually trade, straight off a SIP Index.

```python
spot, vol = ps['values'][-1], float(np.std(r) * np.sqrt(252))

sq.pricing.structured.threeWayCollar(S=spot, putBuyStrike=0.95 * spot, putSellStrike=0.85 * spot,
                                     callSellStrike=1.12 * spot, T=0.5, r=0.04, sigma=vol)
sq.pricing.structured.participatingForward(F=spot, K=0.97 * spot, T=0.5, r=0.04, sigma=vol,
                                           participation=0.5)
sq.pricing.structured.accumulator(S=spot, K=0.92 * spot, knockOut=1.08 * spot, T=0.5, r=0.04,
                                  sigma=vol, qtyPerFix=100, nFixings=26, seed=7)
```

Also in the package: knock-out forwards, collared swaps, commodity swaps and swaptions, Asian, barrier, spread and Monte Carlo options, and forward curve bootstrapping.

## Risk management

```python
sq.risk.cvar(r, alpha=0.01)
sq.risk.maxDrawdown(ps['values'])
sq.risk.stressTest(positions=[5e6, -2e6], shocks=[[-0.25, -0.20], [0.15, 0.10]])
```

Historical, parametric and Cornish-Fisher VaR, CVaR, component and marginal VaR, stress scenarios, drawdown, Sortino, Calmar, tracking error and tail index. Liquidity adjusted VaR, market impact and optimal liquidation live in `sq.trading.liquidity`.

## Physical trade

```python
load = sq.physical.containers.loadContainer(120, 100, 120, 600, container='40hc')
cost = sq.physical.landed.landedCost(price=240, qty=load['netKg'] / 1000,
                                     freight=2800, insurance=60, dutyPct=0, vatPct=5)
```

The calculators published at [sipglobally.com/tools](https://sipglobally.com/tools/), ported to code: container loading, landed cost, unit conversion, HS code lookup, the spec catalog and Incoterms 2020.

## Package map

| Area | Contents |
| --- | --- |
| `sq.data` | SIP Global API client: `catalog`, `fetch`, `SIPAPIError`. |
| `sq.schema` | Validated containers: `PriceSeries`, `SparsePriceSeries`, `TradeRecord`, `QuoteSheet`, `ForwardCurve`, `OTCPosition`, `IndexSpec`. |
| `sq.pricing.options` | Black-Scholes, binomial, trinomial, implied vol, Kirk spread, barrier, Asian, Monte Carlo. |
| `sq.pricing.structured` | Three-way collar, participating forward, knock-out forward, collared swap, accumulator. |
| `sq.pricing.bootstrap` | Forward, convenience yield, discount, zero and spread curves, vol surface. |
| `sq.risk` | VaR, CVaR, component and marginal VaR, stress tests, drawdown, performance ratios, tail index. |
| `sq.portfolio` | Mean-variance, efficient frontier, risk parity, HRP, Black-Litterman, max Sharpe, min CVaR. |
| `sq.trading` | OTC instruments (`otc`), dealer book (`book`), liquidity (`liquidity`), order vocabulary (`orders`). |
| `sq.quant` | Econometrics, state space, factors, ML, fitting, distributions, simulation, dimensionality reduction. |
| `sq.physical` | Basis and differentials, units, containers, landed cost, Incoterms, HS codes, spec catalog. |
| `sq.index` | Index calculation, audit trail, restatement, roll schedule, proxy regression, backtest. |

Every 1.x import path (`sq.options`, `sq.otc`, `sq.fit`, `sipQuant.commodity` and the rest) still resolves.

## MCP server

SIP Global runs a hosted MCP server for AI assistants. Connect it from Claude Code:

```bash
claude mcp add --transport http sip https://api.sipglobally.com/mcp --header "Authorization: Bearer $SIP_API_KEY"
```

It serves `list_indices`, `get_index_history`, `get_index_summary`, `search_markets` and `get_commodity_profile`. To add the sipQuant calculators and quant tools, run the local server as well:

```bash
pip install "sipQuant[mcp]"
claude mcp add sip-local -e SIP_API_KEY=$SIP_API_KEY -- sipquant-mcp
```

Setup for Claude Desktop and Cursor, and the full tool list, are in the [docs](https://sipquant.readthedocs.io/en/latest/mcp.html).

## Data plans

| Plan | Price | Rate limit |
| --- | --- | --- |
| Individual | \$6,000 per year (\$600 per month) | 60 requests per minute |
| Enterprise | By contract | 1,200 requests per minute |

SIP data is licensed for research, valuation and settlement. Details at [sipglobally.com/data](https://sipglobally.com/data/).

## Documentation

Guides, worked examples and the full API reference: [sipquant.readthedocs.io](https://sipquant.readthedocs.io/en/latest/).

## About SIP Global

SIP Global (Systematic Index Partners Ltd.) is a physical commodity trading and brokerage company headquartered in Calgary, Alberta, trading worldwide. It publishes the SIP Indices, the reference prices for specialty commodities, and brings systematic rigour, transparent pricing and real liquidity to physically settled markets.

*Tota Ad Manum.*

[sipglobally.com](https://sipglobally.com/)

## License

Apache-2.0. © 2026 Systematic Index Partners Ltd. Contact: 
+ brayden@sipglobally.com 
+ mitch@sipglobally.com
