New · Vega View is open: institutional-grade risk for your own portfolio. First week free, then $33.33/month. Start your free week →
Institutions & FinTechRisk modelLook-throughModelsOutcome modelsDevelopersProductionDemo
Developers

Vega's risk and outcome models, from your own code

The risk model API is live: a sandbox to try it, with a key issued on request, and production access for approved clients. The outcome model API is live in pilot.

Live

Risk Model API

Send positions or name a fund and get risk back, factor by factor, with funds looked through to what they hold. Use the house model, fit your own, or bring a model you license.

What it does

Risk and models over an API

Read risk

A fund's or a portfolio's risk, broken down by factor.

Build a risk model

Send a model specification, fit it, and compare it with production.

Bring your own

Add your own factors and return series to a model.

How it works

How it works

4 steps, each shown below running against the live API for a test client, exactly as it came back.

  1. 1

    Send positions

    Send your positions to us by API, SFTP or secure upload.

    Your client holdings

    Available on request: deliver client holdings by SFTP or secure upload; each file is checked before it is loaded.

    See it run · 2 calls

    Send a book: stocks, bonds, ETFs, mutual funds and cash

    Code Live
    """Send a book: stocks, bonds, US ETFs, mutual funds and cash, with your own quantities and prices (positions/2)."""
    from vega_risk import Client, VegaError
    
    BOOK = {"contract": "positions/2", "as_of": "2026-10-15", "base_currency": "USD", "price_source": "client", "lines": [
        {"identifier_type": "ticker", "identifier": "AAPL", "asset_class": "equity", "quantity": 400, "price": 250.0, "currency": "USD"},
        {"identifier_type": "ticker", "identifier": "MSFT", "asset_class": "equity", "quantity": 150, "price": 500.0, "currency": "USD"},
        {"identifier_type": "ticker", "identifier": "JPM", "asset_class": "equity", "quantity": 120, "price": 300.0, "currency": "USD"},
        {"identifier_type": "cusip", "identifier": "91282CKP5", "asset_class": "bond", "quantity": 50000, "price": 101.2,
         "price_kind": "clean", "currency": "USD"},
        {"identifier_type": "isin", "identifier": "US91282CKG59", "asset_class": "bond", "quantity": 40000, "price": 99.5,
         "price_kind": "clean", "currency": "USD"},
        {"identifier_type": "ticker", "identifier": "SPY", "asset_class": "fund", "quantity": 40, "price": 600.0, "currency": "USD"},
        {"identifier_type": "ticker", "identifier": "AGG", "asset_class": "fund", "quantity": 600, "price": 100.0, "currency": "USD"},
        {"identifier_type": "ticker", "identifier": "VT", "asset_class": "fund", "quantity": 200, "price": 120.0, "currency": "USD"},
        {"identifier_type": "ticker", "identifier": "GABBX", "asset_class": "fund", "quantity": 500, "price": 30.0, "currency": "USD"},
        {"identifier_type": "ticker", "identifier": "PAHIX", "asset_class": "fund", "quantity": 3000, "price": 6.0, "currency": "USD"},
        {"identifier_type": "client", "identifier": "CASH-USD", "asset_class": "cash", "quantity": 25000, "price": 1.0, "currency": "USD"},
    ]}
    
    vega = Client()
    try:
        vega.books.create("zz-golden", "Zz golden book (FAKE)", BOOK)
    except VegaError as e:
        if e.code != "book_exists":
            raise
        vega.books.put_positions("zz-golden", BOOK)                # the same book again: a new version of the same date
    s = vega.books.positions_status("zz-golden")
    print(f"received via {s.via}: {s.lines} lines, {s.mapped} mapped, {s.unmapped} unmapped, {s.not_mapped} cash / not mapped")
    print(f"checks: {s.verdict}; ready for risk: {s.risk_ready}")
    print(f"positions sha256: {s.sha256}")
    
    Recorded output
    received via api: 11 lines, 10 mapped, 0 unmapped, 1 cash / not mapped
    checks: accepted; ready for risk: True
    positions sha256: fcab5210f364ba023f8f628cb417925773355b4e5986520bf5e2b548f6860d92
    
    Recorded 2026-10-21T07:24:59+00:00

    The same book by secure upload

    Code Live
    """The same book by secure upload: open a session, PUT the file to its signed link (no key on the upload), read it back.
    The positions are exactly those of gp_positions_post: the stored book has the same sha256 whichever route it came by."""
    import hashlib
    import json
    
    import httpx
    from vega_risk import Client
    
    POSITIONS = {"contract": "positions/2", "as_of": "2026-10-15", "base_currency": "USD", "price_source": "client", "lines": [
        {"identifier_type": "ticker", "identifier": "AAPL", "asset_class": "equity", "quantity": 400, "price": 250.0, "currency": "USD"},
        {"identifier_type": "ticker", "identifier": "MSFT", "asset_class": "equity", "quantity": 150, "price": 500.0, "currency": "USD"},
        {"identifier_type": "ticker", "identifier": "JPM", "asset_class": "equity", "quantity": 120, "price": 300.0, "currency": "USD"},
        {"identifier_type": "cusip", "identifier": "91282CKP5", "asset_class": "bond", "quantity": 50000, "price": 101.2,
         "price_kind": "clean", "currency": "USD"},
        {"identifier_type": "isin", "identifier": "US91282CKG59", "asset_class": "bond", "quantity": 40000, "price": 99.5,
         "price_kind": "clean", "currency": "USD"},
        {"identifier_type": "ticker", "identifier": "SPY", "asset_class": "fund", "quantity": 40, "price": 600.0, "currency": "USD"},
        {"identifier_type": "ticker", "identifier": "AGG", "asset_class": "fund", "quantity": 600, "price": 100.0, "currency": "USD"},
        {"identifier_type": "ticker", "identifier": "VT", "asset_class": "fund", "quantity": 200, "price": 120.0, "currency": "USD"},
        {"identifier_type": "ticker", "identifier": "GABBX", "asset_class": "fund", "quantity": 500, "price": 30.0, "currency": "USD"},
        {"identifier_type": "ticker", "identifier": "PAHIX", "asset_class": "fund", "quantity": 3000, "price": 6.0, "currency": "USD"},
        {"identifier_type": "client", "identifier": "CASH-USD", "asset_class": "cash", "quantity": 25000, "price": 1.0, "currency": "USD"},
    ]}
    BOOK = {"book_id": "zz-golden-upload", "name": "Zz golden book (FAKE), by secure upload", "positions": POSITIONS}
    
    body = json.dumps(BOOK, sort_keys=True).encode()
    sha = hashlib.sha256(body).hexdigest()
    vega = Client()
    s = vega.request("POST", "/model-deliveries", json={
        "kind": "positions", "label": "zz golden by upload", "sizes": {"book.json": len(body)},
        "manifest": {"files": [{"path": "book.json", "format": "json", "sha256": sha}]}})
    up = s["uploads"][0]
    r = httpx.put(up["url"], content=body, headers=dict(up["headers"], **{"content-length": str(len(body))}), timeout=60)
    print("upload:", r.status_code, "| session", s["delivery_id"][:8], "kind", s["kind"])
    print("state:", vega.request("GET", f"/model-deliveries/{s['delivery_id']}")["state"], "(the poller brings it in as book zz-golden-upload)")
    
    Recorded output
    upload: 200 | session b85e35ab kind positions
    state: uploaded (the poller brings it in as book zz-golden-upload)
    
    Recorded 2026-10-21T07:25:00+00:00
  2. 2

    Get look-through risk back

    Funds are broken into the holdings they own, and the risk comes back factor by factor.

    See it run

    Risk back, funds looked through, holdings dated

    Code Live
    """Risk back, with the funds looked through to what they hold, and as of when."""
    from vega_risk import Client
    
    vega = Client()
    r = vega.books.risk("zz-golden")
    print(f"{r.total_vol_pct:.2f}% a year: factor {r.factor_vol_pct:.2f}%, specific {r.specific_vol_pct:.2f}%  ({r.model.label})")
    for d in r.top_drivers[:3]:
        print(f"  {d.label or d.factor}: {d.share_of_variance_pct:.1f}% of the variance")
    lt = r.look_through
    print(f"{lt.funds_looked_through} of {lt.funds} funds looked through ({lt.looked_through_pct:.1f}% of the book); "
          f"the model covers {lt.modelled_pct:.1f}%")
    for f in lt.holdings:
        print(f"  {f.key}: holdings as of {f.holdings_as_of} ({f.holdings_source})" + ("" if f.looked_through else ", not looked through"))
    
    Recorded output
    10.74% a year: factor 8.08%, specific 7.08%  (House model Vega Global v1.7 (certified), recorded snapshot 21)
      US equity market: 42.8% of the variance
      US equity: Information Technology: 18.5% of the variance
      US equity style: Beta: -4.5% of the variance
    5 of 5 funds looked through (30.2% of the book); the model covers 94.7%
      fund:SPY: holdings as of 2026-06-30 (sec_nport_f3)
      fund:AGG: holdings as of 2026-05-31 (sec_nport_f3)
      fund:VT: holdings as of 2026-07-31 (sec_nport_f3)
      fund:GABBX: holdings as of 2026-06-30 (sec_nport_f3)
      fund:PAHIX: holdings as of 2026-05-31 (sec_nport_f3)
    
    Recorded 2026-10-21T07:25:01+00:00
  3. 3

    Build your own risk model

    Choose your own factors and settings. Every model you fit is fingerprinted and stays labeled research, not certified, until a person signs it off. Only a signed-off model can become a book's default; otherwise the house model is shown.

    See it run · 3 calls

    Your own model: the house recipe changed, fitted, fingerprinted, carded

    Code Live
    """Your own model: the house fixed-income recipe with a shorter volatility half-life, fitted, fingerprinted, carded."""
    from vega_risk import Client
    
    vega = Client()
    spec = vega.specs.house("fixed_income").set(name="zz_client_hl42", covariance__vol_half_life=42)
    print("recipe fingerprint:", spec.fingerprint, "(the same recipe always gives this fingerprint)")
    fit = vega.fits.create(spec).wait()
    card = vega.models.card(fit)
    print("model:", card.model.id)
    print("certification:", card.certification, "| card sha256:", card.card_sha256)
    
    Recorded output
    recipe fingerprint: 7729f6271dd5058b (the same recipe always gives this fingerprint)
    model: factory:7729f6271dd5058b@rec_s21:cac08f1ec07c7ab2
    certification: candidate | card sha256: 385c74f41117f6c6f06b3e3965bdef76a4e341726959c7c5c21f5c37d800dcd1
    
    Recorded 2026-10-21T07:25:51+00:00

    Your model against the house on the same book

    Code Live
    """Your model against the house on the same book, with the backtest by year."""
    from vega_risk import Client
    
    vega = Client()
    mine = next(m.model for m in vega.models.list() if m.model.name == "zz_client_hl42")
    cmp = vega.books.compare("zz-golden", model_b=mine.id)
    a, b = round(cmp.a.total_vol_pct, 2), round(cmp.b.total_vol_pct, 2)
    print(f"house {a:.2f}%  ->  yours {b:.2f}%  ({b - a:+.2f} points)")
    print("method:", cmp.b.method)
    bt = (cmp.backtest or {}).get("b") or {}                      # your model's backtest on the recorded fixed-income books
    print("verdict:", (bt.get("verdict") or {}).get("verdict"))
    agg = ((bt.get("books") or {}).get("fund:AGG") or {}).get("model") or {}
    for row in agg.get("by_year") or []:                          # bias by year beside the whole window, never a bare figure
        print(f"  AGG bias {row['year']}: {row['bias']:.3f} over {row['n']} days")
    
    Recorded output
    house 10.74%  ->  yours 10.75%  (+0.01 points)
    method: fit: funds on the fit's own vectors (30% of the book), stocks and bonds on the house's unit exposures (64%), the fit's covariance
    verdict: rejected
      AGG bias 2024: 0.980 over 144 days
      AGG bias 2025: 0.940 over 250 days
      AGG bias 2026: 1.115 over 196 days
    
    Recorded 2026-10-21T07:25:51+00:00

    This example model is rejected: in the backtest its risk forecasts were significantly worse than the house model's for one of the test funds, and significantly better for none. Fits that do as well as the house are accepted.

    Where last month's return came from

    Code Live
    """Where last month's return came from: each factor's contribution, from the book's exposures."""
    from vega_risk import Client
    
    vega = Client()
    a = vega.books.attribution("zz-golden")
    print(f"{a.period_start} to {a.period_end} ({a.trading_days} trading days): factor return {a.factor_return_pct:+.2f}%")
    print("total:", "withheld" if a.total_return_pct is None else f"{a.total_return_pct:+.2f}%", f"({a.priced_pct:.0f}% of the book priced)")
    for c in a.contributions[:3]:
        print(f"  {c.factor}: {c.contribution_pct:+.3f}%")
    
    Recorded output
    2026-09-16 to 2026-10-15 (21 trading days): factor return +2.26%
    total: withheld (23% of the book priced)
      ind_45: +1.183%
      market: +1.029%
      sty_profitability: +0.542%
    
    Recorded 2026-10-21T07:25:52+00:00
  4. 4

    Use your licensed model too

    Available on request: send the files of a risk model you already license by SFTP or secure upload; it is scored on the same scorecard as ours, as deliveries build up.

    Your licensed model files

    Available on request: deliver a licensed model's files by SFTP or secure upload; we load them and score the model on the same scorecard as ours, as deliveries build up.

    See it run · 2 calls

    The same book on a FAKE vendor's model

    Code Live
    """The same book on a vendor's model, delivered to us as files, scored the same way.
    (The vendor here is FAKE and its model made up: test files, not a real vendor's data.)"""
    from vega_risk import Client
    
    vega = Client()
    vendor = next(m.model for m in vega.models.list() if m.model.id.startswith("foreign:"))
    r = vega.books.risk("zz-golden", model=vendor.id)
    h = vega.books.risk("zz-golden")
    print(f"{vendor.name} (a FAKE vendor's model): {r.total_vol_pct:.2f}% a year on the {r.vendor_coverage_pct:.1f}% of the book it covers "
          f"(house: {h.total_vol_pct:.2f}% on the whole book)")
    print("fingerprint (the delivery's hash):", vendor.fingerprint)
    
    Recorded output
    Fake Risk Co Fake Global Equity 1.0 (a FAKE vendor's model): 21.66% a year on the 93.8% of the book it covers (house: 10.71% on the whole book)
    fingerprint (the delivery's hash): c41e65f4a71773d6
    
    Recorded 2026-10-21T16:02:36+00:00

    A vendor's model with our covariance and your factor (FAKE vendor, synthetic history)

    Code Live
    """A vendor's model files with our covariance and your own factor: the hybrid, and how it scores against the vendor's own.
    (The vendor here is FAKE and its history synthetic: a test history, not a real vendor's data.)"""
    from vega_risk import Client
    
    vega = Client()
    hybrid = next(m.model for m in vega.models.list() if m.model.id.startswith("composite:"))
    card = vega.models.card(hybrid.id).raw
    print(card["provenance"]["said"])
    print("model:", hybrid.id, "| run:", card["run"]["inputs_hash"], "| card sha256:", card["card_sha256"][:16])
    print("covariance:", card["spec"]["join"]["cross_block"]["params"], "on the vendor's factor returns + your", card["spec"]["custom"][0]["name"])
    sc = card["scorecard"]
    
    
    def by_year(rows):
        return ", ".join(f"{y} {r['b']:.2f}" + ("*" if r["indicative"] else "") for y, r in rows.items())
    
    
    for code in ("H0", "H3", "H4"):
        s = sc[code]
        rb = s["random_books"]
        print(f"{s['what']}: random books median bias {rb['bias_median']:.2f} over the whole window; by year: {by_year(rb['by_year'])}")
        t = s["client_tilt"]
        if t.get("bias") is None:
            print("  client-tilt book:", t.get("withheld"))
            continue
        print(f"  client-tilt book bias {t['bias']:.2f} over the whole window; by year: {by_year(t['by_year'])}")
    print("bias 1.00 = the model's risk matched what happened; * = fewer than 63 days that year (indicative)")
    print("cards (sha256):", {c: sc[c]["card"]["sha256"][:16] for c in ("H0", "H3", "H4")})
    
    Recorded output
    Fake Risk Co (a FAKE vendor), synthetic history 2024-2024
    model: composite:ffb5b95320001831 | run: e88bf3fe83f13099 | card sha256: 3429fa8765412356
    covariance: {'corr_half_life': 126, 'nw_lags': 5, 'vol_half_life': 63} on the vendor's factor returns + your CLIENT_A
    the vendor as delivered: random books median bias 1.00 over the whole window; by year: 2023 1.01, 2024 1.03
      client-tilt book bias 2.71 over the whole window; by year: 2015 3.52*, 2023 2.76, 2024 2.66
    ours + the client factor (this model): random books median bias 1.03 over the whole window; by year: 2023 1.01, 2024 1.03
      client-tilt book bias 0.97 over the whole window; by year: 2015 1.26*, 2023 0.99, 2024 0.95
    ours + a client factor with no information (control): random books median bias 1.04 over the whole window; by year: 2023 1.01, 2024 1.03
      client-tilt book bias 2.25 over the whole window; by year: 2015 2.93*, 2023 2.29, 2024 2.21
    bias 1.00 = the model's risk matched what happened; * = fewer than 63 days that year (indicative)
    cards (sha256): {'H0': '2f3313ea41a01659', 'H3': '790fe5850c1857ca', 'H4': 'afa8fdd0839eec49'}
    
    Recorded 2026-10-21T07:25:56+00:00
Quickstart

Install, then make your first call

Install the package, then run these lines with your key.

Install
pip install vega-risk
python
from vega_risk import Client
vega = Client(api_key="vk_test_...")                      # a sandbox key: demo books on recorded data
risk = vega.books.risk("demo:vega-60-40")
print(f"{risk.total_vol_pct:.2f}% a year;", "top drivers:", ", ".join(d.factor for d in risk.top_drivers[:3]))

Last verified 2026-10-21T07:25:58+00:00

By audience

Start where you are

  1. 1Send positions
  2. 2Get look-through risk back
  3. 3Build your own risk model
  4. 4Use your licensed model too

Send positions, get look-through risk back, and build your own risk model on top.

See each step running →
For quant teams

The raw pieces, at scale

Each call below ran against the live API for a test client and is shown exactly as it came back.

Batch

Many books in one call, persisted and resumable.

See it run

Many books in one call: a batch job and its results

Code Live
"""Many books in one call: a batch job, its progress, and each item's result (the same object the single GET returns)."""
from vega_risk import Client

vega = Client()
books = [b.book_id for b in vega.books.iter()][:20]
items = [dict(book_id=b, kind=k) for b in books for k in ("risk", "exposures")]
job = vega.batches.create(items, idempotency_key="gp-quant-batch-" + "-".join(books)[:80])
print("batch", job.batch_id, "|", job.status, "|", len(items), "items")
done = vega.batches.wait(job.batch_id)
print("status:", done.status, "| progress:", done.progress.done, "of", done.progress.total)
for it in done.items:
    if it.kind == "risk" and it.status == "done":
        r = it.result
        print(f"  {it.book_id}: {r['total_vol_pct']:.2f}% a year ({r['model']['label']}, model as of {r['model_as_of']})")
same = vega.batches.create(items, idempotency_key="gp-quant-batch-" + "-".join(books)[:80])
print("the same Idempotency-Key, the same batch:", same.batch_id == job.batch_id)
Recorded output
batch bt_26e54c9c1698b669 | done | 6 items
status: done | progress: 6 of 6
  zz-golden: 10.71% a year (House model Vega Global v1.7 (certified), recorded snapshot 24, model as of 2026-10-19)
  zz-golden-sftp: 10.71% a year (House model Vega Global v1.7 (certified), recorded snapshot 24, model as of 2026-10-19)
  zz-golden-upload: 10.71% a year (House model Vega Global v1.7 (certified), recorded snapshot 24, model as of 2026-10-19)
the same Idempotency-Key, the same batch: True
Recorded 2026-10-21T16:02:59+00:00

As of a past date

Risk and models on a past date, as they stood then.

See it run

Reproduce what was reported on a past date (three dates)

Code Live
"""What was reported on a past date: risk as of three dates (the model served that day, the book as it stood then)."""
from vega_risk import Client

vega = Client()
for d in ("2026-10-15", "2026-10-16", "2026-10-19"):
    r = vega.books.risk("zz-golden", as_of=d)
    print(f"as of {d}: {r.total_vol_pct:.4f}% a year | model as of {r.model_as_of} (run {r.model.run}) | positions as of {r.positions_as_of}")
a, b = vega.books.risk("zz-golden", as_of="2026-10-16"), vega.books.risk("zz-golden", as_of="2026-10-16")
print("2026-10-16 asked twice, the same result:", a.raw == b.raw)
for d in ("2026-10-15", "2026-10-19"):
    c = vega.models.card("house:vega_global_v1_7", as_of=d)
    print(f"model card as of {d}: sha256 {c.card_sha256[:16]}")
Recorded output
as of 2026-10-15: 10.7405% a year | model as of 2026-10-15 (run f305dc77b9caaa91) | positions as of 2026-10-15
as of 2026-10-16: 10.8158% a year | model as of 2026-10-16 (run 8b4baa4941949183) | positions as of 2026-10-15
as of 2026-10-19: 10.7053% a year | model as of 2026-10-19 (run c3087a274e9a5161) | positions as of 2026-10-15
2026-10-16 asked twice, the same result: True
model card as of 2026-10-15: sha256 178373e71cba3e0c
model card as of 2026-10-19: sha256 12107dfc271b7f72
Recorded 2026-10-21T16:03:06+00:00

Raw exposures and covariance

Exposures, covariance and specific risk as numbers you can load, for any model.

See it run

The model's own numbers: covariance, exposures, specific risk

Code Live
"""The model's own numbers: factor covariance, each security's exposures and specific risk, on a date, for every model you use.
(The vendor here is FAKE and its model made up: test files, not a real vendor's data.)"""
import math

from vega_risk import Client

vega = Client()
house = "house:vega_global_v1_7"
cov = vega.models.covariance(house)
print(f"{cov.model['label']}: {cov.n} factors, covariance as of {cov.model_as_of} ({cov.units.split(';')[0]})")
two = vega.models.covariance(house, factors=["market", "KRD_10Y"])
for f, row in zip(two.factors, two.sigma):
    print(f"  {f}: annual vol {100 * math.sqrt(252 * row[two.factors.index(f)]):.2f}%")
keys = [ln.key for ln in vega.books.positions("zz-golden").lines if getattr(ln, "key", None)][:3]
ex = vega.models.exposures(house, keys)
sp = vega.models.specific(house, keys)
for k in keys:
    top = sorted(ex.exposures[k].raw.items(), key=lambda kv: -abs(kv[1]))[:3]
    print(f"  {k}: " + ", ".join(f"{f} {v:+.3f}" for f, v in top) + f" | specific vol {100 * math.sqrt(252 * sp.specific[k]):.2f}% a year")
for m in vega.models.list():
    if m.model.id != house:
        c = vega.models.covariance(m.model.id)
        print(f"{m.model.id}: {c.n} factors, {m.model.label}" + (" (a FAKE vendor's model)" if m.model.id.startswith("foreign:") else ""))
Recorded output
House model Vega Global v1.7 (certified), recorded snapshot 24: 277 factors, covariance as of 2026-10-19 (daily decimal variance)
  market: annual vol 12.30%
  KRD_10Y: annual vol 0.84%
  equity:320193: sty_profitability +1.762, ind_45 +1.000, market +1.000 | specific vol 24.84% a year
  equity:789019: ind_45 +1.000, market +1.000, sty_liquidity -0.823 | specific vol 27.59% a year
  equity:19617: ind_40 +1.000, market +1.000, sty_resid_vol -0.439 | specific vol 14.92% a year
factory:7729f6271dd5058b@rec_s24:c3087a274e9a5161: 277 factors, Your fixed-income model zz_client_hl42 (research, not certified), fitted on recorded snapshot 24
foreign:7:c41e65f4a71773d6: 9 factors, Your vendor model Fake Risk Co Fake Global Equity 1.0 (as delivered; delivered 2026-10-20) (a FAKE vendor's model)
foreign:7:d8394ace6d2cb9f9: 9 factors, Your vendor model Fake Risk Co Fake Global Equity 1.0 (as delivered; delivered 2026-10-20) (a FAKE vendor's model)
foreign:7:1e38380b34c2b9ab: 9 factors, Your vendor model Fake Risk Co Fake Global Equity 1.0 (as delivered; delivered 2026-10-20) (a FAKE vendor's model)
composite:08531eb047bf5564: 101 factors, Hybrid of Fake Risk Co (a FAKE vendor), synthetic history 2015-2024: the vendor's exposures, our covariance, plus your factor CLIENT_A (research; delivery of 2024-11-29)
Recorded 2026-10-21T16:03:13+00:00

What-if

Risk before and after a hypothetical change to the book, under the house model, your own fits or a licensed model; nothing is stored or sent.

See it run

Each position's contribution, and a what-if

Code Live
"""Where the risk comes from, position by position (the parts add up to the total), and a change's effect before you make it."""
from vega_risk import Client

vega = Client()
c = vega.books.contributions("zz-golden")
print(f"total {c.total_vol_pct:.2f}% a year; the shares add up to {c.check.sum_of_shares_pct:.6f}%")
for p in c.positions[:5]:
    print(f"  {p.key}: weight {p.weight:.3f}, {p.share_of_variance_pct:5.1f}% of the variance, marginal {p.marginal_vol_pct:+.2f}% per unit weight")
w = vega.books.what_if("zz-golden", [dict(identifier="SPY", identifier_type="ticker", asset_class="fund", delta_weight=0.05),
                                     dict(identifier="AGG", identifier_type="ticker", asset_class="fund", delta_weight=-0.05)])
for k in ("total_vol_pct", "factor_vol_pct", "specific_vol_pct"):
    print(f"  {k.replace('_vol_pct', '')}: {w.before[k]:.3f}% -> {w.after[k]:.3f}% ({w.difference[k]:+.3f})")
print(w.note)
Recorded output
total 10.71% a year; the shares add up to 100.000000%
  equity:320193: weight 0.214,  47.2% of the variance, marginal +23.63% per unit weight
  equity:789019: weight 0.160,  37.9% of the variance, marginal +25.31% per unit weight
  equity:19617: weight 0.077,   4.5% of the variance, marginal +6.27% per unit weight
  fund:SPY: weight 0.051,   4.2% of the variance, marginal +8.85% per unit weight
  fund:VT: weight 0.051,   3.2% of the variance, marginal +6.68% per unit weight
  total: 10.705% -> 11.137% (+0.432)
  factor: 8.083% -> 8.641% (+0.558)
  specific: 7.019% -> 7.027% (+0.008)
weights of the book's valued lines; nothing is stored or traded
Recorded 2026-10-21T16:03:15+00:00
For AI assistants

Ask your AI assistant about a client's risk

We are building a connector so that an AI assistant you already use can ask the risk model about a client's portfolio, with the permissions of your key.

For AI assistants Coming soon
{
  "mcpServers": {
    "vega": {
      "command": "vega-risk-mcp",
      "env": {"VEGA_API_KEY": "vk_test_..."}
    }
  }
}

Example conversations Coming soon

What's driving risk in this book?

You What's driving risk in the Vega 60/40 book?

Assistant explain_risk_drivers({"book_id": "demo:vega-60-40"})

Assistant Book demo:vega-60-40 as of 2026-10-15, model: House model Vega Global v1.7 (certified), recorded snapshot 21. Total risk 8.61% a year: factor 8.26%, specific 2.43% (specific is 8.0% of the variance). Largest drivers: US equity market 79.9% of the variance, +6.88 points of volatility; US equity: Information Technology 8.8% of the variance, +0.76 points of volatility; US equity style: Beta 3.2% of the variance, +0.27 points of volatility. By group: equity 85.4%, rates 5.5%, credit 1.1% of the variance. Diversifying (negative share): US equity: Health Care, US equity: Energy, US equity: Financials.

Assistant The book's risk is 8.61% a year under House model Vega Global v1.7 (certified), recorded snapshot 21. Equity factors carry 85.4% of the variance and interest rates 5.5%; the largest single drivers are US equity market (79.9% of the variance), US equity: Information Technology (8.8% of the variance), US equity style: Beta (3.2% of the variance). Specific (security-level) risk is 8.0% of the variance.

Recorded 2026-10-20T07:16:51+00:00

How would trimming tech change it?

You How would trimming tech by 25% change the risk of the Vega 60/40?

Assistant what_if_trim({"book_id": "demo:vega-60-40", "sector": "Information Technology", "trim_pct": 25.0})

Assistant {"sector_weight_before_pct": 23.272516243618053, "sector_weight_after_pct": 17.45438718271354, "change_total_vol_pct": -0.8630730890976137, "funds_looked_through": ["SPY"]} before {"total_vol_pct": 8.605024976032178, "factor_vol_pct": 8.261320600287966} after {"total_vol_pct": 7.741951886934564, "factor_vol_pct": 7.437500128016128}

Assistant Looking through the fund to its stocks, technology is 23.3% of the book. Trimming it by 25% (to 17.5%, the weight spread over the fund's other stocks) moves total risk from 8.61% to 7.74% a year (-0.87 points). Largest drivers before: US equity market (80.0% of the variance), US equity: Information Technology (8.8% of the variance); after: US equity market (87.6% of the variance), US equity: Information Technology (4.8% of the variance). This is a what-if on positions sent for checking: nothing was stored or traded.

Recorded 2026-10-20T07:16:51+00:00

Compare the house model with a client model

You Compare the house model with a client model that describes the yield curve by level, slope and curvature, on the Vega 60/40.

Assistant propose_fit({"kind": "fixed_income", "changes": {"name": "curve_lsc", "curve.us": "lsc", "curve.ns_tau": 1.37}})

Assistant {"status": "queued", "fingerprint": "64eaa8389c55b8d2", "note": "a research fit: it has no serving effect; read it with fit_status, compare it with compare_models"}

Assistant fit_status({"job_id": "<the job>"})

Assistant {"status": "done", "model_id": "factory:64eaa8389c55b8d2@rec_s21:cac08f1ec07c7ab2"}

Assistant compare_models({"book_id": "demo:vega-60-40", "model_b": "<the fitted model>"})

Assistant {"total_vol_pct": 8.612609105495384} vs {"total_vol_pct": 8.645616577171268} difference +0.0330

Assistant On the Vega 60/40 the house model gives 8.61% a year and the level-slope-curvature model 8.65% (+0.04 points). In the backtest on this book, the client model's bias by year is 2024: 0.85, 2025: 1.10, 2026: 0.87 against the house's 2024: 0.85, 2025: 1.11, 2026: 0.87 (1.00 = forecasts in line with realised risk). The model is a research run: using it for the book would be a proposal a person approves.

Recorded 2026-10-20T07:16:51+00:00
Examples

Code beside what it returned

Each output was recorded from a run of the API and is shown exactly as it came back.

Positions & delivery 4

A book's risk in four lines

Code Live
from vega_risk import Client
vega = Client(api_key="vk_test_...")                      # a sandbox key: demo books on recorded data
risk = vega.books.risk("demo:vega-60-40")
print(f"{risk.total_vol_pct:.2f}% a year;", "top drivers:", ", ".join(d.factor for d in risk.top_drivers[:3]))
Recorded output
8.61% a year; top drivers: market, ind_45, sty_beta
Recorded 2026-10-21T07:23:52+00:00
Show all 4

The same with curl

Code Live
curl -s -H "Authorization: Bearer vk_test_..." \
  https://vegainvestmentplatform.ai/v1/books/demo:vega-60-40/risk
Recorded output
{"book_id":"demo:vega-60-40","as_of":"2026-10-15","model":{"id":"house:vega_global_v1_7","name":"Vega Global","version":"1.7","fingerprint":"30e3b67358f3","fingerprint_kind":"registry","house":true,"certification":"certified","label":"House model Vega Global v1.7 (certified), recorded snapshot 21","run":"cac08f1ec07c7ab2","stale_since":null},"basis":"stored","total_vol_pct":8.612609105495384,"factor_vol_pct":8.26132060025028,"specific_vol_pct":2.434669904513212,"var_95_1d_pct":null,"beta":null,"lines":2,"modelled_pct":99.6454,"specific_share_pct":7.991176104128068,"top_drivers":[{"factor":"market","label":"US equity market","group":"equity","exposure":0.5969487433026316,"share_of_variance_pct":79.88560529135157,"vol_contribution_pct":6.880234915303047},{"factor":"ind_45","label":"US equity: Information Technology","group":"equity","exposure":0.2309207845979847,"share_of_variance_pct":8.792457567998325,"vol_contribution_pct":0.7572600010982417},{"factor":"sty_beta","label":"US equity style: Beta","group":"equity","exposure":0.034476082652158284,"share_of_variance_pct":3.1547504723103357,"vol_contribution_pct":0.2717063264338586},{"factor":"ind_35","label":"US equity: Health Care","group":"equity","exposure":0.05332277831241319,"share_of_variance_pct":-1.968170646732877,"vol_contribution_pct":-0.16951084433220315},{"factor":"KRD_10Y","label":"US 10-year rate","group":"rates","exposure":0.594772149763435,"share_of_variance_pct":1.6526231645580098,"vol_contribution_pct":0.1423339731502491},{"factor":"ind_10","label":"US equity: Energy","group":"equity","exposure":0.01812757291215174,"share_of_variance_pct":-1.358349229692872,"vol_contribution_pct":-0.11698930944095472},{"factor":"KRD_7Y","label":"US 7-year rate","group":"rates","exposure":0.38544426643874136,"share_of_variance_pct":1.0992340121961701,"vol_contribution_pct":0.0946727286251096},{"factor":"KRD_LONG","label":"US long (20-30 year) rate","group":"rates","exposure":0.4623996369198102,"share_of_variance_pct":1.0257311863015683,"vol_contribution_pct":0.08834221754931469},{"factor":"KRD_5Y","label":"US 5-year rate","group":"rates","exposure":0.3651126463056784,"share_of_variance_pct":1.0046859481609927,"vol_contribution_pct":0.08652967345294629},{"factor":"ind_40","label":"US equity: Financials","group":"equity","exposure":0.06929290120333277,"share_of_variance_pct":-0.9553827173724442,"vol_contribution_pct":-0.08228337890874836}],"groups":[{"group":"equity","share_of_variance_pct":85.42789945743796},{"group":"rates","share_of_variance_pct":5.504630933461055},{"group":"credit","share_of_variance_pct":1.0762935049729272}],"method":"composed","look_through":null,"specific_missing_share":null,"vendor_coverage_pct":null}
Recorded 2026-10-21T07:23:52+00:00

Send a book: stocks, bonds, ETFs, mutual funds and cash

Code Live
"""Send a book: stocks, bonds, US ETFs, mutual funds and cash, with your own quantities and prices (positions/2)."""
from vega_risk import Client, VegaError

BOOK = {"contract": "positions/2", "as_of": "2026-10-15", "base_currency": "USD", "price_source": "client", "lines": [
    {"identifier_type": "ticker", "identifier": "AAPL", "asset_class": "equity", "quantity": 400, "price": 250.0, "currency": "USD"},
    {"identifier_type": "ticker", "identifier": "MSFT", "asset_class": "equity", "quantity": 150, "price": 500.0, "currency": "USD"},
    {"identifier_type": "ticker", "identifier": "JPM", "asset_class": "equity", "quantity": 120, "price": 300.0, "currency": "USD"},
    {"identifier_type": "cusip", "identifier": "91282CKP5", "asset_class": "bond", "quantity": 50000, "price": 101.2,
     "price_kind": "clean", "currency": "USD"},
    {"identifier_type": "isin", "identifier": "US91282CKG59", "asset_class": "bond", "quantity": 40000, "price": 99.5,
     "price_kind": "clean", "currency": "USD"},
    {"identifier_type": "ticker", "identifier": "SPY", "asset_class": "fund", "quantity": 40, "price": 600.0, "currency": "USD"},
    {"identifier_type": "ticker", "identifier": "AGG", "asset_class": "fund", "quantity": 600, "price": 100.0, "currency": "USD"},
    {"identifier_type": "ticker", "identifier": "VT", "asset_class": "fund", "quantity": 200, "price": 120.0, "currency": "USD"},
    {"identifier_type": "ticker", "identifier": "GABBX", "asset_class": "fund", "quantity": 500, "price": 30.0, "currency": "USD"},
    {"identifier_type": "ticker", "identifier": "PAHIX", "asset_class": "fund", "quantity": 3000, "price": 6.0, "currency": "USD"},
    {"identifier_type": "client", "identifier": "CASH-USD", "asset_class": "cash", "quantity": 25000, "price": 1.0, "currency": "USD"},
]}

vega = Client()
try:
    vega.books.create("zz-golden", "Zz golden book (FAKE)", BOOK)
except VegaError as e:
    if e.code != "book_exists":
        raise
    vega.books.put_positions("zz-golden", BOOK)                # the same book again: a new version of the same date
s = vega.books.positions_status("zz-golden")
print(f"received via {s.via}: {s.lines} lines, {s.mapped} mapped, {s.unmapped} unmapped, {s.not_mapped} cash / not mapped")
print(f"checks: {s.verdict}; ready for risk: {s.risk_ready}")
print(f"positions sha256: {s.sha256}")
Recorded output
received via api: 11 lines, 10 mapped, 0 unmapped, 1 cash / not mapped
checks: accepted; ready for risk: True
positions sha256: fcab5210f364ba023f8f628cb417925773355b4e5986520bf5e2b548f6860d92
Recorded 2026-10-21T07:24:59+00:00

The same book by secure upload

Code Live
"""The same book by secure upload: open a session, PUT the file to its signed link (no key on the upload), read it back.
The positions are exactly those of gp_positions_post: the stored book has the same sha256 whichever route it came by."""
import hashlib
import json

import httpx
from vega_risk import Client

POSITIONS = {"contract": "positions/2", "as_of": "2026-10-15", "base_currency": "USD", "price_source": "client", "lines": [
    {"identifier_type": "ticker", "identifier": "AAPL", "asset_class": "equity", "quantity": 400, "price": 250.0, "currency": "USD"},
    {"identifier_type": "ticker", "identifier": "MSFT", "asset_class": "equity", "quantity": 150, "price": 500.0, "currency": "USD"},
    {"identifier_type": "ticker", "identifier": "JPM", "asset_class": "equity", "quantity": 120, "price": 300.0, "currency": "USD"},
    {"identifier_type": "cusip", "identifier": "91282CKP5", "asset_class": "bond", "quantity": 50000, "price": 101.2,
     "price_kind": "clean", "currency": "USD"},
    {"identifier_type": "isin", "identifier": "US91282CKG59", "asset_class": "bond", "quantity": 40000, "price": 99.5,
     "price_kind": "clean", "currency": "USD"},
    {"identifier_type": "ticker", "identifier": "SPY", "asset_class": "fund", "quantity": 40, "price": 600.0, "currency": "USD"},
    {"identifier_type": "ticker", "identifier": "AGG", "asset_class": "fund", "quantity": 600, "price": 100.0, "currency": "USD"},
    {"identifier_type": "ticker", "identifier": "VT", "asset_class": "fund", "quantity": 200, "price": 120.0, "currency": "USD"},
    {"identifier_type": "ticker", "identifier": "GABBX", "asset_class": "fund", "quantity": 500, "price": 30.0, "currency": "USD"},
    {"identifier_type": "ticker", "identifier": "PAHIX", "asset_class": "fund", "quantity": 3000, "price": 6.0, "currency": "USD"},
    {"identifier_type": "client", "identifier": "CASH-USD", "asset_class": "cash", "quantity": 25000, "price": 1.0, "currency": "USD"},
]}
BOOK = {"book_id": "zz-golden-upload", "name": "Zz golden book (FAKE), by secure upload", "positions": POSITIONS}

body = json.dumps(BOOK, sort_keys=True).encode()
sha = hashlib.sha256(body).hexdigest()
vega = Client()
s = vega.request("POST", "/model-deliveries", json={
    "kind": "positions", "label": "zz golden by upload", "sizes": {"book.json": len(body)},
    "manifest": {"files": [{"path": "book.json", "format": "json", "sha256": sha}]}})
up = s["uploads"][0]
r = httpx.put(up["url"], content=body, headers=dict(up["headers"], **{"content-length": str(len(body))}), timeout=60)
print("upload:", r.status_code, "| session", s["delivery_id"][:8], "kind", s["kind"])
print("state:", vega.request("GET", f"/model-deliveries/{s['delivery_id']}")["state"], "(the poller brings it in as book zz-golden-upload)")
Recorded output
upload: 200 | session b85e35ab kind positions
state: uploaded (the poller brings it in as book zz-golden-upload)
Recorded 2026-10-21T07:25:00+00:00

Risk & look-through 5

A public fund's lines

Code Live
"""A public fund's lines from its latest filing, largest first."""
from vega_risk import Client

vega = Client()
lt = vega.funds.look_through("TIP", limit=10)
print(f"{lt.fund_name}: {lt.lines_total} lines, holdings as of {lt.holdings_as_of}, {lt.modelled_pct:.1f}% modelled")
for ln in lt.lines:
    print(f"  {ln.weight * 100:6.2f}%  {ln.name}")
Recorded output
iShares TIPS Bond ETF: 49 lines, holdings as of 2026-07-31, 100.0% modelled
    3.98%  TSY INFL IX N/B 07/35 1.875
    3.92%  U.S. Treasury Inflation Linked Notes
    3.91%  U.S. Treasury Inflation-Indexed Notes
    3.70%  USTN TII 1.875% 07/15/2034
    3.54%  UNITED STATES TREASURY INFLATION INDEXED BONDS
    3.36%  TSY INFL IX N/B 10/30 1.125
    3.31%  UNITED STATES TREASURY INFLATI 04/30 1.625
    3.31%  U.S. Treasury Inflation Linked Notes
    3.28%  U.S. Treasury Inflation-Indexed Notes
    3.28%  USTN TII 1.375% 07/15/2033
Recorded 2026-10-21T07:23:53+00:00
Show all 5

Risk and its largest drivers

Code Live
"""A book's risk: total volatility and its three largest drivers. Needs VEGA_API_KEY (a sandbox key works)."""
from vega_risk import Client

vega = Client()
risk = vega.books.risk("demo:vega-60-40")
print(f"{risk.total_vol_pct:.2f}% a year (factor {risk.factor_vol_pct:.2f}%, specific {risk.specific_vol_pct:.2f}%)")
print("model:", risk.model.label)
for d in risk.top_drivers[:3]:
    print(f"  {d.label or d.factor:<40} {d.share_of_variance_pct:6.1f}% of the variance")
Recorded output
8.61% a year (factor 8.26%, specific 2.43%)
model: House model Vega Global v1.7 (certified), recorded snapshot 21
  US equity market                           79.9% of the variance
  US equity: Information Technology           8.8% of the variance
  US equity style: Beta                       3.2% of the variance
Recorded 2026-10-21T07:23:53+00:00

Risk back, funds looked through, holdings dated

Code Live
"""Risk back, with the funds looked through to what they hold, and as of when."""
from vega_risk import Client

vega = Client()
r = vega.books.risk("zz-golden")
print(f"{r.total_vol_pct:.2f}% a year: factor {r.factor_vol_pct:.2f}%, specific {r.specific_vol_pct:.2f}%  ({r.model.label})")
for d in r.top_drivers[:3]:
    print(f"  {d.label or d.factor}: {d.share_of_variance_pct:.1f}% of the variance")
lt = r.look_through
print(f"{lt.funds_looked_through} of {lt.funds} funds looked through ({lt.looked_through_pct:.1f}% of the book); "
      f"the model covers {lt.modelled_pct:.1f}%")
for f in lt.holdings:
    print(f"  {f.key}: holdings as of {f.holdings_as_of} ({f.holdings_source})" + ("" if f.looked_through else ", not looked through"))
Recorded output
10.74% a year: factor 8.08%, specific 7.08%  (House model Vega Global v1.7 (certified), recorded snapshot 21)
  US equity market: 42.8% of the variance
  US equity: Information Technology: 18.5% of the variance
  US equity style: Beta: -4.5% of the variance
5 of 5 funds looked through (30.2% of the book); the model covers 94.7%
  fund:SPY: holdings as of 2026-06-30 (sec_nport_f3)
  fund:AGG: holdings as of 2026-05-31 (sec_nport_f3)
  fund:VT: holdings as of 2026-07-31 (sec_nport_f3)
  fund:GABBX: holdings as of 2026-06-30 (sec_nport_f3)
  fund:PAHIX: holdings as of 2026-05-31 (sec_nport_f3)
Recorded 2026-10-21T07:25:01+00:00

Where last month's return came from

Code Live
"""Where last month's return came from: each factor's contribution, from the book's exposures."""
from vega_risk import Client

vega = Client()
a = vega.books.attribution("zz-golden")
print(f"{a.period_start} to {a.period_end} ({a.trading_days} trading days): factor return {a.factor_return_pct:+.2f}%")
print("total:", "withheld" if a.total_return_pct is None else f"{a.total_return_pct:+.2f}%", f"({a.priced_pct:.0f}% of the book priced)")
for c in a.contributions[:3]:
    print(f"  {c.factor}: {c.contribution_pct:+.3f}%")
Recorded output
2026-09-16 to 2026-10-15 (21 trading days): factor return +2.26%
total: withheld (23% of the book priced)
  ind_45: +1.183%
  market: +1.029%
  sty_profitability: +0.542%
Recorded 2026-10-21T07:25:52+00:00

The latest public economic series

Code Live
"""The latest public U.S. economic series, with their owners."""
from vega_risk import Client

vega = Client()
snap = vega.economy.snapshot()
for s in snap.series[:10]:
    print(f"{s['label']:<45} {s['value']:>12} {s['units']:<10} ({s['obs_date']}, {s['owner']})")
Recorded output
Nonfarm payrolls (SA)                             159044.0 thousands  (2026-09-01, U.S. Bureau of Labor Statistics)
Unemployment rate (SA)                                 4.2 percent    (2026-09-01, U.S. Bureau of Labor Statistics)
Average hourly earnings, total private (SA)          37.81 dollars    (2026-09-01, U.S. Bureau of Labor Statistics)
CPI-U all items (SA)                               336.298 index 1982-84=100 (2026-09-01, U.S. Bureau of Labor Statistics)
CPI-U less food and energy (SA)                    338.896 index 1982-84=100 (2026-09-01, U.S. Bureau of Labor Statistics)
Job openings (SA)                                   7079.0 thousands  (2026-08-01, U.S. Bureau of Labor Statistics)
Hires (SA)                                          5192.0 thousands  (2026-08-01, U.S. Bureau of Labor Statistics)
Quits (SA)                                          3066.0 thousands  (2026-08-01, U.S. Bureau of Labor Statistics)
Initial claims (SA)                               199000.0 persons    (2026-10-10, U.S. Department of Labor, Employment and Training Administration)
Continuing claims (SA)                           1710000.0 persons    (2026-10-03, U.S. Department of Labor, Employment and Training Administration)
Recorded 2026-10-21T07:23:53+00:00

Risk models 4

Change the house recipe, fit it, read the risk

Code Live
from vega_risk import Client
vega = Client(api_key="vk_test_...")                       # a sandbox key: demo books on recorded data
spec = vega.specs.house("fixed_income").set(name="curve_lsc", curve__us="lsc", curve__ns_tau=1.37)
fit = vega.fits.create(spec).wait()                         # fitted, then backtested against the house: about a minute
risk = vega.books.risk("demo:vega-60-40", model=fit.model_id)
print(f"{risk.total_vol_pct:.2f}% a year", [d.factor for d in risk.top_drivers[:3]])
Recorded output
8.65% a year ['market', 'ind_45', 'KRD_LEVEL']
Recorded 2026-10-21T07:23:52+00:00
Show all 4

Your model against the house, with bias by year

Code Live
"""Change one choice of the house fixed-income recipe, fit it, and compare it with the house on a book."""
from vega_risk import Client

vega = Client()
spec = vega.specs.house("fixed_income").set(name="curve_lsc", curve__us="lsc", curve__ns_tau=1.37)
print("recipe fingerprint:", spec.fingerprint)
fit = vega.fits.create(spec).wait()                         # fitted, then backtested against the house: about a minute
cmp = vega.books.compare("demo:vega-60-40", model_b=fit)
a, b = round(cmp.a.total_vol_pct, 2), round(cmp.b.total_vol_pct, 2)     # the change between the figures as printed
print(f"house {a:.2f}%  ->  yours {b:.2f}%  ({b - a:+.2f} points)")
report = vega.fits.report(fit)
print("verdict:", report.report["backtest"]["verdict"]["verdict"])
for row in report.report["backtest"]["books"]["fund:AGG"]["model"]["by_year"]:
    print(f"  AGG bias {row['year']}: {row['bias']:.3f} over {row['n']} days")
Recorded output
recipe fingerprint: 64eaa8389c55b8d2
house 8.61%  ->  yours 8.65%  (+0.04 points)
verdict: rejected
  AGG bias 2024: 1.005 over 144 days
  AGG bias 2025: 0.898 over 250 days
  AGG bias 2026: 1.042 over 196 days
Recorded 2026-10-21T07:23:53+00:00

This example model is rejected: in the backtest its risk forecasts were significantly worse than the house model's for one of the test funds, and significantly better for none. Fits that do as well as the house are accepted.

Your own model: the house recipe changed, fitted, fingerprinted, carded

Code Live
"""Your own model: the house fixed-income recipe with a shorter volatility half-life, fitted, fingerprinted, carded."""
from vega_risk import Client

vega = Client()
spec = vega.specs.house("fixed_income").set(name="zz_client_hl42", covariance__vol_half_life=42)
print("recipe fingerprint:", spec.fingerprint, "(the same recipe always gives this fingerprint)")
fit = vega.fits.create(spec).wait()
card = vega.models.card(fit)
print("model:", card.model.id)
print("certification:", card.certification, "| card sha256:", card.card_sha256)
Recorded output
recipe fingerprint: 7729f6271dd5058b (the same recipe always gives this fingerprint)
model: factory:7729f6271dd5058b@rec_s21:cac08f1ec07c7ab2
certification: candidate | card sha256: 385c74f41117f6c6f06b3e3965bdef76a4e341726959c7c5c21f5c37d800dcd1
Recorded 2026-10-21T07:25:51+00:00

Your model against the house on the same book

Code Live
"""Your model against the house on the same book, with the backtest by year."""
from vega_risk import Client

vega = Client()
mine = next(m.model for m in vega.models.list() if m.model.name == "zz_client_hl42")
cmp = vega.books.compare("zz-golden", model_b=mine.id)
a, b = round(cmp.a.total_vol_pct, 2), round(cmp.b.total_vol_pct, 2)
print(f"house {a:.2f}%  ->  yours {b:.2f}%  ({b - a:+.2f} points)")
print("method:", cmp.b.method)
bt = (cmp.backtest or {}).get("b") or {}                      # your model's backtest on the recorded fixed-income books
print("verdict:", (bt.get("verdict") or {}).get("verdict"))
agg = ((bt.get("books") or {}).get("fund:AGG") or {}).get("model") or {}
for row in agg.get("by_year") or []:                          # bias by year beside the whole window, never a bare figure
    print(f"  AGG bias {row['year']}: {row['bias']:.3f} over {row['n']} days")
Recorded output
house 10.74%  ->  yours 10.75%  (+0.01 points)
method: fit: funds on the fit's own vectors (30% of the book), stocks and bonds on the house's unit exposures (64%), the fit's covariance
verdict: rejected
  AGG bias 2024: 0.980 over 144 days
  AGG bias 2025: 0.940 over 250 days
  AGG bias 2026: 1.115 over 196 days
Recorded 2026-10-21T07:25:51+00:00

This example model is rejected: in the backtest its risk forecasts were significantly worse than the house model's for one of the test funds, and significantly better for none. Fits that do as well as the house are accepted.

Vendor & hybrid 2

The same book on a FAKE vendor's model

Code Live
"""The same book on a vendor's model, delivered to us as files, scored the same way.
(The vendor here is FAKE and its model made up: test files, not a real vendor's data.)"""
from vega_risk import Client

vega = Client()
vendor = next(m.model for m in vega.models.list() if m.model.id.startswith("foreign:"))
r = vega.books.risk("zz-golden", model=vendor.id)
h = vega.books.risk("zz-golden")
print(f"{vendor.name} (a FAKE vendor's model): {r.total_vol_pct:.2f}% a year on the {r.vendor_coverage_pct:.1f}% of the book it covers "
      f"(house: {h.total_vol_pct:.2f}% on the whole book)")
print("fingerprint (the delivery's hash):", vendor.fingerprint)
Recorded output
Fake Risk Co Fake Global Equity 1.0 (a FAKE vendor's model): 21.66% a year on the 93.8% of the book it covers (house: 10.71% on the whole book)
fingerprint (the delivery's hash): c41e65f4a71773d6
Recorded 2026-10-21T16:02:36+00:00
Show all 2

A vendor's model with our covariance and your factor (FAKE vendor, synthetic history)

Code Live
"""A vendor's model files with our covariance and your own factor: the hybrid, and how it scores against the vendor's own.
(The vendor here is FAKE and its history synthetic: a test history, not a real vendor's data.)"""
from vega_risk import Client

vega = Client()
hybrid = next(m.model for m in vega.models.list() if m.model.id.startswith("composite:"))
card = vega.models.card(hybrid.id).raw
print(card["provenance"]["said"])
print("model:", hybrid.id, "| run:", card["run"]["inputs_hash"], "| card sha256:", card["card_sha256"][:16])
print("covariance:", card["spec"]["join"]["cross_block"]["params"], "on the vendor's factor returns + your", card["spec"]["custom"][0]["name"])
sc = card["scorecard"]


def by_year(rows):
    return ", ".join(f"{y} {r['b']:.2f}" + ("*" if r["indicative"] else "") for y, r in rows.items())


for code in ("H0", "H3", "H4"):
    s = sc[code]
    rb = s["random_books"]
    print(f"{s['what']}: random books median bias {rb['bias_median']:.2f} over the whole window; by year: {by_year(rb['by_year'])}")
    t = s["client_tilt"]
    if t.get("bias") is None:
        print("  client-tilt book:", t.get("withheld"))
        continue
    print(f"  client-tilt book bias {t['bias']:.2f} over the whole window; by year: {by_year(t['by_year'])}")
print("bias 1.00 = the model's risk matched what happened; * = fewer than 63 days that year (indicative)")
print("cards (sha256):", {c: sc[c]["card"]["sha256"][:16] for c in ("H0", "H3", "H4")})
Recorded output
Fake Risk Co (a FAKE vendor), synthetic history 2024-2024
model: composite:ffb5b95320001831 | run: e88bf3fe83f13099 | card sha256: 3429fa8765412356
covariance: {'corr_half_life': 126, 'nw_lags': 5, 'vol_half_life': 63} on the vendor's factor returns + your CLIENT_A
the vendor as delivered: random books median bias 1.00 over the whole window; by year: 2023 1.01, 2024 1.03
  client-tilt book bias 2.71 over the whole window; by year: 2015 3.52*, 2023 2.76, 2024 2.66
ours + the client factor (this model): random books median bias 1.03 over the whole window; by year: 2023 1.01, 2024 1.03
  client-tilt book bias 0.97 over the whole window; by year: 2015 1.26*, 2023 0.99, 2024 0.95
ours + a client factor with no information (control): random books median bias 1.04 over the whole window; by year: 2023 1.01, 2024 1.03
  client-tilt book bias 2.25 over the whole window; by year: 2015 2.93*, 2023 2.29, 2024 2.21
bias 1.00 = the model's risk matched what happened; * = fewer than 63 days that year (indicative)
cards (sha256): {'H0': '2f3313ea41a01659', 'H3': '790fe5850c1857ca', 'H4': 'afa8fdd0839eec49'}
Recorded 2026-10-21T07:25:56+00:00

Quant 4

Many books in one call: a batch job and its results

Code Live
"""Many books in one call: a batch job, its progress, and each item's result (the same object the single GET returns)."""
from vega_risk import Client

vega = Client()
books = [b.book_id for b in vega.books.iter()][:20]
items = [dict(book_id=b, kind=k) for b in books for k in ("risk", "exposures")]
job = vega.batches.create(items, idempotency_key="gp-quant-batch-" + "-".join(books)[:80])
print("batch", job.batch_id, "|", job.status, "|", len(items), "items")
done = vega.batches.wait(job.batch_id)
print("status:", done.status, "| progress:", done.progress.done, "of", done.progress.total)
for it in done.items:
    if it.kind == "risk" and it.status == "done":
        r = it.result
        print(f"  {it.book_id}: {r['total_vol_pct']:.2f}% a year ({r['model']['label']}, model as of {r['model_as_of']})")
same = vega.batches.create(items, idempotency_key="gp-quant-batch-" + "-".join(books)[:80])
print("the same Idempotency-Key, the same batch:", same.batch_id == job.batch_id)
Recorded output
batch bt_26e54c9c1698b669 | done | 6 items
status: done | progress: 6 of 6
  zz-golden: 10.71% a year (House model Vega Global v1.7 (certified), recorded snapshot 24, model as of 2026-10-19)
  zz-golden-sftp: 10.71% a year (House model Vega Global v1.7 (certified), recorded snapshot 24, model as of 2026-10-19)
  zz-golden-upload: 10.71% a year (House model Vega Global v1.7 (certified), recorded snapshot 24, model as of 2026-10-19)
the same Idempotency-Key, the same batch: True
Recorded 2026-10-21T16:02:59+00:00
Show all 4

Reproduce what was reported on a past date (three dates)

Code Live
"""What was reported on a past date: risk as of three dates (the model served that day, the book as it stood then)."""
from vega_risk import Client

vega = Client()
for d in ("2026-10-15", "2026-10-16", "2026-10-19"):
    r = vega.books.risk("zz-golden", as_of=d)
    print(f"as of {d}: {r.total_vol_pct:.4f}% a year | model as of {r.model_as_of} (run {r.model.run}) | positions as of {r.positions_as_of}")
a, b = vega.books.risk("zz-golden", as_of="2026-10-16"), vega.books.risk("zz-golden", as_of="2026-10-16")
print("2026-10-16 asked twice, the same result:", a.raw == b.raw)
for d in ("2026-10-15", "2026-10-19"):
    c = vega.models.card("house:vega_global_v1_7", as_of=d)
    print(f"model card as of {d}: sha256 {c.card_sha256[:16]}")
Recorded output
as of 2026-10-15: 10.7405% a year | model as of 2026-10-15 (run f305dc77b9caaa91) | positions as of 2026-10-15
as of 2026-10-16: 10.8158% a year | model as of 2026-10-16 (run 8b4baa4941949183) | positions as of 2026-10-15
as of 2026-10-19: 10.7053% a year | model as of 2026-10-19 (run c3087a274e9a5161) | positions as of 2026-10-15
2026-10-16 asked twice, the same result: True
model card as of 2026-10-15: sha256 178373e71cba3e0c
model card as of 2026-10-19: sha256 12107dfc271b7f72
Recorded 2026-10-21T16:03:06+00:00

The model's own numbers: covariance, exposures, specific risk

Code Live
"""The model's own numbers: factor covariance, each security's exposures and specific risk, on a date, for every model you use.
(The vendor here is FAKE and its model made up: test files, not a real vendor's data.)"""
import math

from vega_risk import Client

vega = Client()
house = "house:vega_global_v1_7"
cov = vega.models.covariance(house)
print(f"{cov.model['label']}: {cov.n} factors, covariance as of {cov.model_as_of} ({cov.units.split(';')[0]})")
two = vega.models.covariance(house, factors=["market", "KRD_10Y"])
for f, row in zip(two.factors, two.sigma):
    print(f"  {f}: annual vol {100 * math.sqrt(252 * row[two.factors.index(f)]):.2f}%")
keys = [ln.key for ln in vega.books.positions("zz-golden").lines if getattr(ln, "key", None)][:3]
ex = vega.models.exposures(house, keys)
sp = vega.models.specific(house, keys)
for k in keys:
    top = sorted(ex.exposures[k].raw.items(), key=lambda kv: -abs(kv[1]))[:3]
    print(f"  {k}: " + ", ".join(f"{f} {v:+.3f}" for f, v in top) + f" | specific vol {100 * math.sqrt(252 * sp.specific[k]):.2f}% a year")
for m in vega.models.list():
    if m.model.id != house:
        c = vega.models.covariance(m.model.id)
        print(f"{m.model.id}: {c.n} factors, {m.model.label}" + (" (a FAKE vendor's model)" if m.model.id.startswith("foreign:") else ""))
Recorded output
House model Vega Global v1.7 (certified), recorded snapshot 24: 277 factors, covariance as of 2026-10-19 (daily decimal variance)
  market: annual vol 12.30%
  KRD_10Y: annual vol 0.84%
  equity:320193: sty_profitability +1.762, ind_45 +1.000, market +1.000 | specific vol 24.84% a year
  equity:789019: ind_45 +1.000, market +1.000, sty_liquidity -0.823 | specific vol 27.59% a year
  equity:19617: ind_40 +1.000, market +1.000, sty_resid_vol -0.439 | specific vol 14.92% a year
factory:7729f6271dd5058b@rec_s24:c3087a274e9a5161: 277 factors, Your fixed-income model zz_client_hl42 (research, not certified), fitted on recorded snapshot 24
foreign:7:c41e65f4a71773d6: 9 factors, Your vendor model Fake Risk Co Fake Global Equity 1.0 (as delivered; delivered 2026-10-20) (a FAKE vendor's model)
foreign:7:d8394ace6d2cb9f9: 9 factors, Your vendor model Fake Risk Co Fake Global Equity 1.0 (as delivered; delivered 2026-10-20) (a FAKE vendor's model)
foreign:7:1e38380b34c2b9ab: 9 factors, Your vendor model Fake Risk Co Fake Global Equity 1.0 (as delivered; delivered 2026-10-20) (a FAKE vendor's model)
composite:08531eb047bf5564: 101 factors, Hybrid of Fake Risk Co (a FAKE vendor), synthetic history 2015-2024: the vendor's exposures, our covariance, plus your factor CLIENT_A (research; delivery of 2024-11-29)
Recorded 2026-10-21T16:03:13+00:00

Each position's contribution, and a what-if

Code Live
"""Where the risk comes from, position by position (the parts add up to the total), and a change's effect before you make it."""
from vega_risk import Client

vega = Client()
c = vega.books.contributions("zz-golden")
print(f"total {c.total_vol_pct:.2f}% a year; the shares add up to {c.check.sum_of_shares_pct:.6f}%")
for p in c.positions[:5]:
    print(f"  {p.key}: weight {p.weight:.3f}, {p.share_of_variance_pct:5.1f}% of the variance, marginal {p.marginal_vol_pct:+.2f}% per unit weight")
w = vega.books.what_if("zz-golden", [dict(identifier="SPY", identifier_type="ticker", asset_class="fund", delta_weight=0.05),
                                     dict(identifier="AGG", identifier_type="ticker", asset_class="fund", delta_weight=-0.05)])
for k in ("total_vol_pct", "factor_vol_pct", "specific_vol_pct"):
    print(f"  {k.replace('_vol_pct', '')}: {w.before[k]:.3f}% -> {w.after[k]:.3f}% ({w.difference[k]:+.3f})")
print(w.note)
Recorded output
total 10.71% a year; the shares add up to 100.000000%
  equity:320193: weight 0.214,  47.2% of the variance, marginal +23.63% per unit weight
  equity:789019: weight 0.160,  37.9% of the variance, marginal +25.31% per unit weight
  equity:19617: weight 0.077,   4.5% of the variance, marginal +6.27% per unit weight
  fund:SPY: weight 0.051,   4.2% of the variance, marginal +8.85% per unit weight
  fund:VT: weight 0.051,   3.2% of the variance, marginal +6.68% per unit weight
  total: 10.705% -> 11.137% (+0.432)
  factor: 8.083% -> 8.641% (+0.558)
  specific: 7.019% -> 7.027% (+0.008)
weights of the book's valued lines; nothing is stored or traded
Recorded 2026-10-21T16:03:15+00:00
API reference

Every route, generated from the API's own specification

Errors every route can return

Each route below lists only its own responses; these apply to all of them.

400malformed request (key_in_query, ...)
401missing_key, invalid_key, key_revoked, key_expired, jwt_not_accepted
403missing_scope
404not found for this key (another tenant's id is answered the same way)
409fit_not_done, book_exists, idempotency_in_progress
422invalid_request, positions_refused (the positions v1 validator's report in detail)
429rate_limited, quota_exceeded (Retry-After header)
501not_in_sandbox (the sandbox serves recorded data only)
503not_bound, audit_unavailable
Books 7 routes
GET/booksThis tenant's books
Key scope
books:read
Parameters
  • limit query · integer optional
  • cursor query · string | null optional
Responses
POST/booksCreate a book from its positions (positions/2 or /1)
Key scope
positions:write
Request body
application/json · CreateBook
Responses
GET/books/{book_id}/positionsA book's positions (positions/1 weights, or positions/2 valued lines)
Key scope
books:read
Parameters
  • book_id path · string required
  • as_of query · string | null optional
Responses
PUT/books/{book_id}/positionsReplace a book's positions (positions/1 or positions/2)
Key scope
positions:write
Parameters
  • book_id path · string required
Request body
application/json · object
Responses
GET/books/{book_id}/positions/statusWhere a book's positions stand: received, checked, mapped, ready for risk
Key scope
books:read
Parameters
  • book_id path · string required
  • as_of query · string | null optional
Responses
GET/fi-positions/contractThe fixed-income positions contract, as data
Key scope
books:read
Responses
POST/positions/validateCheck, map, value (and in the sandbox risk) positions; nothing is stored
Key scope
risk:read
Request body
application/json · object
Responses
Risk 8 routes
GET/benchmarksThe benchmarks an active view can use (and a book's stated one)
Key scope
risk:read
Parameters
  • book_id query · string | null optional
Responses
GET/books/{book_id}/activeThe book against a benchmark: tracking error, active VaR and beta, active weights and bets, per position, group and factor
Key scope
risk:read
Parameters
  • book_id path · string required
  • benchmark query · string optional VT | vega-60-40 | IVV | AGG | firm | a fund ticker
  • as_of query · string | null optional
  • look_through query · boolean optional per underlying security (the benchmark's funds too)
  • book_value query · number | null optional USD: active VaR in dollars on this value (default: the priced book's market value)
  • limit query · integer | null optional
Responses
GET/books/{book_id}/contributionsEach position's share of the book's risk (Euler; adds up to the total)
Key scope
risk:read
Parameters
  • book_id path · string required
  • model_id query · string | null optional
  • as_of query · string | null optional
  • look_through query · boolean optional one row per underlying security, held directly and through funds (direct_weight, via_funds_weight)
  • limit query · integer | null optional the largest `limit` rows (default: all; positions_total says how many there are)
  • book_value query · number | null optional USD: VaR in dollars on this value (default: the priced book's market value)
Responses
GET/books/{book_id}/riskA book's stored risk (the nightly result)
Key scope
risk:read
Parameters
  • book_id path · string required
  • model_id query · string | null optional default: the model bound to the book
  • as_of query · string | null optional default: the latest stored date
  • drivers query · string optional top: the 10 largest (top_drivers); all: also EVERY factor with a nonzero exposure (drivers) and the per-group totals (driver_groups)
  • book_value query · number | null optional USD: VaR in dollars on this value (default: the priced book's market value)
Responses
GET/books/{book_id}/stressA scenario's P&L on the book, in percent and dollars, per line (or per security); without `scenario`, every scenario's summary
Key scope
risk:read
Parameters
  • book_id path · string required
  • scenario query · string | null optional a name from /stress/scenarios; omit for all
  • look_through query · boolean optional one row per underlying security, held directly and through funds
  • book_value query · number | null optional USD: P&L in dollars on this value (default: the priced book's market value)
  • limit query · integer | null optional the largest `limit` rows by |P&L| (default: all)
  • as_of query · string | null optional
Responses
POST/books/{book_id}/what-ifThe book's risk before and after a change in its positions (nothing is stored)
Key scope
risk:read
Parameters
  • book_id path · string required
Request body
application/json · object
Responses
POST/riskRisk on demand (inline positions or a book)
Key scope
risk:read
Request body
application/json · OnDemandRequest
Responses
GET/stress/scenariosThe portfolio stress scenarios (the fund pages' library in force) and its version
Key scope
risk:read
Responses
Exposures 2 routes
GET/books/{book_id}/exposuresA book's stored exposures (the nightly result)
Key scope
exposures:read
Parameters
  • book_id path · string required
  • model_id query · string | null optional default: the model bound to the book
  • as_of query · string | null optional default: the latest stored date
Responses
POST/exposuresExposures on demand (inline positions or a book)
Key scope
exposures:read
Request body
application/json · OnDemandRequest
Responses
Attribution 2 routes
POST/attributionAttribution on demand (inline positions or a book)
Key scope
attribution:read
Request body
application/json · OnDemandRequest
Responses
GET/books/{book_id}/attributionA book's stored attribution (the nightly result)
Key scope
attribution:read
Parameters
  • book_id path · string required
  • model_id query · string | null optional default: the model bound to the book
  • as_of query · string | null optional default: the latest stored date
  • period_start query · string | null optional default: one month (21 trading days) before period_end
  • period_end query · string | null optional default: the last day with factor returns
Responses
Scenarios 2 routes
GET/books/{book_id}/scenariosA book's stored scenarios (the nightly result)
Key scope
scenarios:read
Parameters
  • book_id path · string required
  • model_id query · string | null optional default: the model bound to the book
  • as_of query · string | null optional default: the latest stored date
Responses
POST/scenariosScenarios on demand (inline positions or a book)
Key scope
scenarios:read
Request body
application/json · OnDemandRequest
Responses
Batches 3 routes
GET/batchesThis key's batches, newest first, with their progress
Key scope
batch:write
Parameters
  • limit query · integer optional
  • cursor query · string | null optional
Responses
POST/batchesRun several stored-result reads as one batch
Key scope
batch:write
Request body
application/json · BatchRequest
Responses
GET/batches/{batch_id}A batch and its results
Key scope
batch:write
Parameters
  • batch_id path · string required
Responses
Models 7 routes
GET/modelsModels this key may use
Key scope
models:read
Parameters
  • limit query · integer optional
  • cursor query · string | null optional
  • as_of query · string | null optional the models served on that date (default: today's)
Responses
GET/models/{model_id}One model this key may use
Key scope
models:read
Parameters
  • model_id path · string required
  • as_of query · string | null optional the model as served on that date
Responses
GET/models/{model_id}/cardA model's card: coverage, freshness, fingerprint
Key scope
models:read
Parameters
  • model_id path · string required
  • as_of query · string | null optional the card of the model as served on that date
Responses
GET/models/{model_id}/covarianceA model's factor covariance on a date (daily decimal, signed convention)
Key scope
models:read
Parameters
  • model_id path · string required
  • as_of query · string | null optional
  • factors query · string | null optional comma-separated: only these factors
Responses
GET/models/{model_id}/exposuresA model's exposures for the securities asked (per unit weight)
Key scope
models:read
Parameters
  • model_id path · string required
  • keys query · string required comma-separated security keys
  • as_of query · string | null optional
Responses
GET/models/{model_id}/factorsA model's factors: name, label, short label, group
Key scope
models:read
Parameters
  • model_id path · string required
  • as_of query · string | null optional
Responses
GET/models/{model_id}/specificA model's specific risk for the securities asked
Key scope
models:read
Parameters
  • model_id path · string required
  • keys query · string required comma-separated security keys
  • as_of query · string | null optional
Responses
Fits 6 routes
POST/compareTwo models on one book
Key scope
fits:read, risk:read
Request body
application/json · CompareRequest
Responses
GET/fitsYour fits, newest first
Key scope
fits:read
Parameters
  • limit query · integer optional
  • cursor query · string | null optional
Responses
POST/fitsQueue a fit (asynchronous)
Key scope
fits:write
Request body
application/json · FitRequest
Responses
GET/fits/{job_id}A fit's status
Key scope
fits:read
Parameters
  • job_id path · string required
Responses
GET/fits/{job_id}/reportA fit's report (once done)
Key scope
fits:read
Parameters
  • job_id path · string required
Responses
GET/webhooks/secretThe secret that signs your fit callbacks
Key scope
fits:read
Responses
Bring your own 3 routes
POST/factorsUpload your own per-security equity factor
Key scope
byo:write
Request body
application/octet-stream · string text/csv · string
Responses
POST/seriesUpload your own fixed-income series (CSV or Parquet)
Key scope
byo:write
Parameters
  • units query · string | null optional bp | percent | decimal; leave out for a level series
  • filename query · string | null optional
Request body
application/octet-stream · string text/csv · string
Responses
GET/series/{data_hash}One of your stored series
Key scope
byo:write
Parameters
  • data_hash path · string required
Responses
Upload a licensed model 4 routes
GET/model-deliveriesListing
Key scope
models:deliver
Parameters
  • limit query · string optional
  • cursor query · string | null optional
Responses
POST/model-deliveriesCreate
Key scope
models:deliver
Responses
PUT/model-deliveries/uploads/{token}Upload
Key scope
none
Parameters
  • token path · string required
Responses
GET/model-deliveries/{delivery_id}Status
Key scope
models:deliver
Parameters
  • delivery_id path · string required
Responses
Proposals 3 routes
GET/proposalsYour proposals, newest first
Key scope
proposals:write
Parameters
  • limit query · integer optional
  • cursor query · string | null optional
Responses
POST/proposalsPropose that a human bind or certify a model
Key scope
proposals:write
Request body
application/json · ProposalRequest
Responses
GET/proposals/{proposal_id}A proposal and its state
Key scope
proposals:write
Parameters
  • proposal_id path · string required
Responses
Funds 8 routes
POST/fees/portfolioA portfolio's fees: per holding, in total, and the illustrative fee drag
Key scope
none
Request body
application/json · PortfolioFeesBody
Responses
GET/fund/resolveA share class's fund page and class tab
Key scope
none
Parameters
  • ticker query · string | null optional
  • instrument_id query · string | null optional
Responses
GET/fund/{fund_id}/holdingsA fund's holdings from its latest N-PORT filing
Key scope
none
Parameters
  • fund_id path · string required
  • limit query · string optional
Responses
GET/fund/{fund_id}/overviewA fund's page: header, class tabs, fees (precomputed)
Key scope
none
Parameters
  • fund_id path · string required
Responses
GET/fund/{fund_id}/pricesA fund class's daily closes, indexed or in dollars, with comparisons
Key scope
none
Parameters
  • fund_id path · string required
  • class query · string | null optional
  • range query · string optional
  • basis query · string optional
  • compare query · string | null optional
  • from query · string | null optional
  • to query · string | null optional
Responses
GET/fund/{fund_id}/riskA fund's top risk contributors: weight, share of risk, $ on the bad day, vol, beta
Key scope
none
Parameters
  • fund_id path · string required
  • top query · integer optional
Responses
GET/funds/feesFunds' expense ratios and their cheapest share class
Key scope
none
Parameters
  • tickers query · string | null optional comma-separated, up to 1,000
  • instrument_ids query · string | null optional the app's instrument ids, comma-separated
Responses
GET/funds/{ticker}/look-throughA public fund's lines (from its filing)
Key scope
funds:read
Parameters
  • ticker path · string required
  • limit query · integer optional
  • offset query · integer optional
Responses
Economy 1 route
GET/economy/snapshotThe latest public economic series
Key scope
economy:read
Responses
Specs 2 routes
GET/specs/houseThe house recipe, as a document to start from
Key scope
specs:write
Parameters
  • kind query · string optional
Responses
POST/specs/validateValidate a spec and name it (no fit)
Key scope
specs:write
Request body
application/json · SpecBody
Responses
Company 13 routes
GET/company/resolveA ticker's company id
Key scope
none
Parameters
  • ticker query · string required
Responses
GET/company/{company_id}/callsEvery analyzed earnings call, newest first, with the 8-call trend
Key scope
none
Parameters
  • company_id path · integer required
Responses
GET/company/{company_id}/calls/{period}One earnings call's full analysis
Key scope
none
Parameters
  • company_id path · integer required
  • period path · string required
Responses
GET/company/{company_id}/calls/{period}/transcriptThe full transcript of one call
Key scope
none
Parameters
  • company_id path · integer required
  • period path · string required
  • q query · string | null optional
Responses
GET/company/{company_id}/newsNews on a company
Key scope
none
Parameters
  • company_id path · integer required
  • topic query · string | null optional
  • from query · string | null optional
  • to query · string | null optional
  • limit query · integer optional
  • cursor query · string | null optional
Responses
GET/company/{company_id}/overviewA company's Overview: one precomputed read
Key scope
none
Parameters
  • company_id path · integer required
Responses
GET/company/{company_id}/pre-ipoA pre-IPO company's page: registration status and terms as filed
Key scope
none
Parameters
  • company_id path · integer required
Responses
GET/company/{company_id}/pre-ipo/filingsA pre-IPO company's SEC filings
Key scope
none
Parameters
  • company_id path · integer required
Responses
GET/company/{company_id}/pre-ipo/offeringsA pre-IPO company's offering terms by filing (S-1, amendments, final prospectus)
Key scope
none
Parameters
  • company_id path · integer required
Responses
GET/company/{company_id}/pre-ipo/statements/{statement}A pre-IPO company's statement as reported in its newest approved filing (null = not filled in)
Key scope
none
Parameters
  • company_id path · integer required
  • statement path · string required
Responses
GET/company/{company_id}/pricesA company's daily closes, indexed or in dollars, with comparisons
Key scope
none
Parameters
  • company_id path · integer required
  • range query · string optional
  • basis query · string optional
  • compare query · string | null optional
  • from query · string | null optional
  • to query · string | null optional
Responses
GET/company/{company_id}/releasesPress releases on a company
Key scope
none
Parameters
  • company_id path · integer required
  • type query · string | null optional
  • limit query · integer optional
  • cursor query · string | null optional
Responses
GET/company/{company_id}/tearsheetA company's tearsheet
Key scope
none
Parameters
  • company_id path · integer required
  • sections query · string | null optional
  • book_id query · integer | null optional
Responses
Coverage 2 routes
GET/risk/coverageAny ticker's risk number, with its method
Key scope
risk:read
Parameters
  • tickers query · string required comma-separated, up to 1,000
Responses
POST/risk/coverage/requestsHave tickers modeled by the next nightly
Key scope
risk:request
Request body
application/json · CoverageRequestBody
Responses
Screener 4 routes
POST/screenerRun a screen (server-side filter, sort, page)
Key scope
none
Request body
application/json · Query_
Responses
POST/screener/exportA screen as CSV (paying subscribers)
Key scope
none
Request body
application/json · Query_
Responses
POST/screener/facetsCounts per fund for the filter matrix, under the same filters as the screen
Key scope
none
Request body
application/json · Query_
Responses
GET/screener/fieldsThe screener's fields, views and default columns
Key scope
none
Parameters
  • universe query · string optional
Responses
Jobs 3 routes
GET/jobsList Jobs
Key scope
none
Parameters
  • limit query · integer optional
  • cursor query · string | null optional
Responses
  • 200 Successful Response
  • 401 missing_key, invalid_key, key_revoked, key_expired, invalid_token ErrorBody
  • 403 missing_scope, tenant_not_enabled, entitlement_unknown, tenant_not_resolved ErrorBody
  • 404 not_found: no such shelf, job, model, version or saved request for this tenant ErrorBody
  • 409 isolation_pass_required ErrorBody
  • 429 rate_limited ErrorBody
GET/jobs/{job_id}Get Job
Key scope
none
Parameters
  • job_id path · string required
Responses
  • 200 Successful Response
  • 401 missing_key, invalid_key, key_revoked, key_expired, invalid_token ErrorBody
  • 403 missing_scope, tenant_not_enabled, entitlement_unknown, tenant_not_resolved ErrorBody
  • 404 not_found: no such shelf, job, model, version or saved request for this tenant ErrorBody
  • 409 isolation_pass_required ErrorBody
  • 429 rate_limited ErrorBody
GET/jobs/{job_id}/resultJob Result
Key scope
model-portfolios:read
Parameters
  • job_id path · string required
Responses
  • 200 Successful Response
  • 401 missing_key, invalid_key, key_revoked, key_expired, invalid_token ErrorBody
  • 403 missing_scope, tenant_not_enabled, entitlement_unknown, tenant_not_resolved ErrorBody
  • 404 not_found: no such shelf, job, model, version or saved request for this tenant ErrorBody
  • 409 isolation_pass_required, job_not_done ErrorBody
  • 429 rate_limited ErrorBody
Model portfolios 8 routes
GET/model-portfoliosList Models
Key scope
model-portfolios:read
Parameters
  • limit query · integer optional
  • cursor query · string | null optional
Responses
  • 200 Successful Response
  • 401 missing_key, invalid_key, key_revoked, key_expired, invalid_token ErrorBody
  • 403 missing_scope, tenant_not_enabled, entitlement_unknown, tenant_not_resolved ErrorBody
  • 404 not_found: no such shelf, job, model, version or saved request for this tenant ErrorBody
  • 409 isolation_pass_required ErrorBody
  • 429 rate_limited ErrorBody
GET/model-portfolios/{model_id}Get Model
Key scope
model-portfolios:read
Parameters
  • model_id path · string required
Responses
  • 200 Successful Response
  • 401 missing_key, invalid_key, key_revoked, key_expired, invalid_token ErrorBody
  • 403 missing_scope, tenant_not_enabled, entitlement_unknown, tenant_not_resolved ErrorBody
  • 404 not_found: no such shelf, job, model, version or saved request for this tenant ErrorBody
  • 409 isolation_pass_required ErrorBody
  • 429 rate_limited ErrorBody
GET/model-portfolios/{model_id}/diffDiff
Key scope
model-portfolios:read
Parameters
  • model_id path · string required
  • from query · integer required
  • to query · integer required
Responses
  • 200 Successful Response
  • 401 missing_key, invalid_key, key_revoked, key_expired, invalid_token ErrorBody
  • 403 missing_scope, tenant_not_enabled, entitlement_unknown, tenant_not_resolved ErrorBody
  • 404 not_found: no such shelf, job, model, version or saved request for this tenant ErrorBody
  • 409 isolation_pass_required ErrorBody
  • 429 rate_limited ErrorBody
GET/model-portfolios/{model_id}/exportExport
Key scope
model-portfolios:read
Parameters
  • model_id path · string required
  • version query · integer required
  • format query · string optional
Responses
  • 200 Successful Response
  • 401 missing_key, invalid_key, key_revoked, key_expired, invalid_token ErrorBody
  • 403 missing_scope, tenant_not_enabled, entitlement_unknown, tenant_not_resolved ErrorBody
  • 404 not_found: no such shelf, job, model, version or saved request for this tenant ErrorBody
  • 409 isolation_pass_required ErrorBody
  • 429 rate_limited ErrorBody
POST/model-portfolios/{model_id}/retireRetire
Key scope
model-portfolios:write
Parameters
  • model_id path · string required
  • version query · integer required
  • Idempotency-Key header · string | null optional
Request body
application/json · RetireBody
Responses
  • 200 Successful Response
  • 401 missing_key, invalid_key, key_revoked, key_expired, invalid_token ErrorBody
  • 403 missing_scope, tenant_not_enabled, entitlement_unknown, tenant_not_resolved ErrorBody
  • 404 not_found: no such shelf, job, model, version or saved request for this tenant ErrorBody
  • 409 isolation_pass_required, idempotency_in_progress ErrorBody
  • 413 payload_too_large: an outcome request is at most 64 KB ErrorBody
  • 422 invalid_request (the body does not match the schema), idempotency_key_required, idempotency_key_reused ErrorBody
  • 429 rate_limited ErrorBody
POST/model-portfolios/{model_id}/submitSubmit
Key scope
model-portfolios:write
Parameters
  • model_id path · string required
  • version query · integer required
  • Idempotency-Key header · string | null optional
Request body
application/json · SubmitBody
Responses
  • 200 Successful Response
  • 401 missing_key, invalid_key, key_revoked, key_expired, invalid_token ErrorBody
  • 403 missing_scope, tenant_not_enabled, entitlement_unknown, tenant_not_resolved ErrorBody
  • 404 not_found: no such shelf, job, model, version or saved request for this tenant ErrorBody
  • 409 isolation_pass_required, idempotency_in_progress ErrorBody
  • 413 payload_too_large: an outcome request is at most 64 KB ErrorBody
  • 422 invalid_request (the body does not match the schema), idempotency_key_required, idempotency_key_reused ErrorBody
  • 429 rate_limited ErrorBody
GET/model-portfolios/{model_id}/versionsList Versions
Key scope
model-portfolios:read
Parameters
  • model_id path · string required
Responses
  • 200 Successful Response
  • 401 missing_key, invalid_key, key_revoked, key_expired, invalid_token ErrorBody
  • 403 missing_scope, tenant_not_enabled, entitlement_unknown, tenant_not_resolved ErrorBody
  • 404 not_found: no such shelf, job, model, version or saved request for this tenant ErrorBody
  • 409 isolation_pass_required ErrorBody
  • 429 rate_limited ErrorBody
GET/model-portfolios/{model_id}/versions/{version}Get Version
Key scope
model-portfolios:read
Parameters
  • model_id path · string required
  • version path · integer required
Responses
  • 200 Successful Response
  • 401 missing_key, invalid_key, key_revoked, key_expired, invalid_token ErrorBody
  • 403 missing_scope, tenant_not_enabled, entitlement_unknown, tenant_not_resolved ErrorBody
  • 404 not_found: no such shelf, job, model, version or saved request for this tenant ErrorBody
  • 409 isolation_pass_required ErrorBody
  • 429 rate_limited ErrorBody
Outcomes 1 route
POST/outcomes/optimizeOptimize
Key scope
outcomes:run
Parameters
  • Idempotency-Key header · string | null optional
Request body
application/json · OptimizeBody
Responses
  • 201 A repeat of a finished request: the stored record (repeat true); no new job. object
  • 202 Accepted: a job; poll the URL in poll, then GET /v1/jobs/{job_id}/result. object
  • 401 missing_key, invalid_key, key_revoked, key_expired, invalid_token ErrorBody
  • 403 missing_scope, tenant_not_enabled, entitlement_unknown, tenant_not_resolved ErrorBody
  • 404 not_found: no such shelf, job, model, version or saved request for this tenant ErrorBody
  • 409 isolation_pass_required, idempotency_in_progress ErrorBody
  • 413 payload_too_large: an outcome request is at most 64 KB ErrorBody
  • 422 invalid_request (the body does not match the schema), idempotency_key_required, idempotency_key_reused, fund_not_on_shelf, risk_set_not_allowed ErrorBody
  • 429 rate_limited, too_many_open_jobs, compute_budget_exceeded ErrorBody
Saved requests 3 routes
GET/saved-requestsList Saved
Key scope
shelves:write
Parameters
  • limit query · integer optional
  • cursor query · string | null optional
Responses
  • 200 Successful Response
  • 401 missing_key, invalid_key, key_revoked, key_expired, invalid_token ErrorBody
  • 403 missing_scope, tenant_not_enabled, entitlement_unknown, tenant_not_resolved ErrorBody
  • 404 not_found: no such shelf, job, model, version or saved request for this tenant ErrorBody
  • 409 isolation_pass_required ErrorBody
  • 429 rate_limited ErrorBody
POST/saved-requestsSave Request
Key scope
shelves:write
Parameters
  • Idempotency-Key header · string | null optional
Request body
application/json · SavedRequestBody
Responses
  • 201 Successful Response
  • 401 missing_key, invalid_key, key_revoked, key_expired, invalid_token ErrorBody
  • 403 missing_scope, tenant_not_enabled, entitlement_unknown, tenant_not_resolved ErrorBody
  • 404 not_found: no such shelf, job, model, version or saved request for this tenant ErrorBody
  • 409 isolation_pass_required, idempotency_in_progress ErrorBody
  • 413 payload_too_large: an outcome request is at most 64 KB ErrorBody
  • 422 invalid_request (the body does not match the schema), idempotency_key_required, idempotency_key_reused ErrorBody
  • 429 rate_limited ErrorBody
GET/saved-requests/{saved_id}Get Saved
Key scope
shelves:write
Parameters
  • saved_id path · string required
Responses
  • 200 Successful Response
  • 401 missing_key, invalid_key, key_revoked, key_expired, invalid_token ErrorBody
  • 403 missing_scope, tenant_not_enabled, entitlement_unknown, tenant_not_resolved ErrorBody
  • 404 not_found: no such shelf, job, model, version or saved request for this tenant ErrorBody
  • 409 isolation_pass_required ErrorBody
  • 429 rate_limited ErrorBody
Shelves 4 routes
GET/shelvesList Shelves
Key scope
shelves:write
Parameters
  • limit query · integer optional
  • cursor query · string | null optional
Responses
  • 200 Successful Response
  • 401 missing_key, invalid_key, key_revoked, key_expired, invalid_token ErrorBody
  • 403 missing_scope, tenant_not_enabled, entitlement_unknown, tenant_not_resolved ErrorBody
  • 404 not_found: no such shelf, job, model, version or saved request for this tenant ErrorBody
  • 409 isolation_pass_required ErrorBody
  • 429 rate_limited ErrorBody
POST/shelvesCreate Shelf
Key scope
shelves:write
Parameters
  • Idempotency-Key header · string | null optional
Request body
application/json · ShelfBody
Responses
  • 201 Successful Response
  • 401 missing_key, invalid_key, key_revoked, key_expired, invalid_token ErrorBody
  • 403 missing_scope, tenant_not_enabled, entitlement_unknown, tenant_not_resolved ErrorBody
  • 404 not_found: no such shelf, job, model, version or saved request for this tenant ErrorBody
  • 409 isolation_pass_required, idempotency_in_progress ErrorBody
  • 413 payload_too_large: an outcome request is at most 64 KB ErrorBody
  • 422 invalid_request (the body does not match the schema), idempotency_key_required, idempotency_key_reused, shelf_refused ErrorBody
  • 429 rate_limited ErrorBody
GET/shelves/{shelf_id}Get Shelf
Key scope
shelves:write
Parameters
  • shelf_id path · string required
  • version query · integer | null optional
Responses
  • 200 Successful Response
  • 401 missing_key, invalid_key, key_revoked, key_expired, invalid_token ErrorBody
  • 403 missing_scope, tenant_not_enabled, entitlement_unknown, tenant_not_resolved ErrorBody
  • 404 not_found: no such shelf, job, model, version or saved request for this tenant ErrorBody
  • 409 isolation_pass_required ErrorBody
  • 429 rate_limited ErrorBody
PUT/shelves/{shelf_id}Replace Shelf
Key scope
shelves:write
Parameters
  • shelf_id path · string required
  • Idempotency-Key header · string | null optional
Request body
application/json · ShelfBody
Responses
  • 200 Successful Response
  • 401 missing_key, invalid_key, key_revoked, key_expired, invalid_token ErrorBody
  • 403 missing_scope, tenant_not_enabled, entitlement_unknown, tenant_not_resolved ErrorBody
  • 404 not_found: no such shelf, job, model, version or saved request for this tenant ErrorBody
  • 409 isolation_pass_required, idempotency_in_progress ErrorBody
  • 413 payload_too_large: an outcome request is at most 64 KB ErrorBody
  • 422 invalid_request (the body does not match the schema), idempotency_key_required, idempotency_key_reused, shelf_refused ErrorBody
  • 429 rate_limited ErrorBody
Data shapes 87

AttributionResult

  • as_of string required
  • basis string required stored = the nightly result; on_demand = computed for this request
  • book_id string | null optional null for an on-demand call on inline positions
  • contributions Contribution[] required
  • factor_return_pct number required
  • method string | null optional
  • model ModelLabel required
  • model_as_of string | null optional live books: the date of the model's data used (the latest recorded set on or before as_of)
  • period_end string required
  • period_start string required
  • positions_as_of string | null optional live books: the date of the positions used (the latest on or before as_of)
  • priced_pct number | null optional share of the book's gross weight with a return over the period, percent
  • specific_return_pct number | null optional total - factor; null with total
  • total_return_pct number | null optional null when too little of the book has prices (see priced_pct)
  • trading_days integer | null optional

Batch

  • batch_id string required
  • created_at string required
  • items BatchItemOut[] required
  • progress BatchProgress | null optional items finished of the total (live batches run in the background)
  • status string required

BatchItem

  • as_of string | null optional
  • book_id string required
  • kind string required
  • model_id string | null optional

BatchItemOut

  • as_of string | null optional
  • book_id string required
  • error ErrorDetail | null optional
  • kind string required
  • model_id string | null optional
  • result object | null optional the same object the matching GET /v1/books/{book_id}/<kind> returns
  • status string required

BatchList

  • batches BatchSummary[] required
  • next_cursor string | null optional

BatchProgress

  • done integer required
  • total integer required

BatchRequest

  • items BatchItem[] required

BatchSummary

  • batch_id string required
  • created_at string required
  • progress BatchProgress required
  • status string required

BookCreated

  • book_id string required
  • contract string required
  • created boolean required false when the feed was refused (nothing stored)
  • evaluation BookEvaluation required
  • name string required

BookEvaluation

  • as_of string | null optional
  • base_currency string | null optional
  • contract string required
  • lines object[] | null optional valued lines: weight, value, price source and date (a vendor price is withheld)
  • look_through object | null optional
  • mapping object | null optional mapped / unmapped (with why_public) / not_mapped (derivatives, cash)
  • risk object | null optional the house model's risk of the book (sandbox), or null
  • risk_note string | null optional
  • validation object required verdict (accepted | refused, the whole feed), refused rows {row, identifier, code, why_public}, warnings, bond_checks
  • valuation object | null optional source, mode (shadow | fixed_weights), priced_share, held_share, not_yet_risked_share, modelled_share, gross, net, held

BookInfo

  • book_id string required
  • kind string optional
  • latest_as_of string | null optional
  • model ModelLabel | null optional the model bound to this book (the house model when none is bound; null for a client book the nightly has not risked yet)
  • name string required

BookList

  • books BookInfo[] required
  • next_cursor string | null optional pass as cursor for the next page; null on the last page

BookPositionsV2

  • as_of string required
  • book_id string required
  • contract string required
  • lines object[] | null optional
  • mapping object | null optional
  • received_at string | null optional
  • sha256 string | null optional
  • validation object | null optional
  • valuation object | null optional

CompareRequest

  • book_id string required
  • model_a string | null optional default: the house model
  • model_b string required

CompareResult

  • a RiskResult required
  • as_of string required
  • b RiskResult required
  • backtest object | null optional each fitted side's backtest on this book and the house's, bias by year beside the whole window
  • book_id string required
  • difference object required b minus a, percentage points: total_vol_pct, factor_vol_pct, specific_vol_pct
  • note string | null optional

Contribution

  • contribution_pct number required
  • factor string required

CoverageRecord

  • as_of string | null optional
  • asset_class string | null optional
  • basis string | null optional
  • coverage_pct number | null optional
  • daily_reset boolean | null optional a leveraged / inverse fund that resets daily
  • disclosure string | null optional the daily-reset disclosure, shown with the number when daily_reset
  • display_name string | null optional the clean name to show (SEC series / class names for funds, the company's name for stocks); fall back to the ticker
  • estimated boolean | null optional
  • estimated_label string | null optional "Estimated" on P4
  • exposures object | null optional the 12 largest exposures; key-rate durations as + duration
  • frequency string | null optional
  • holdings_lookthrough_pending boolean | null optional holdings-based in coverage, look-through not yet published: the number shown is the returns tier's, under its own method
  • inherited_from string | null optional
  • method string required holdings_based | returns_based | proxy_total_vol | proxy_category | none
  • method_label string required shown with every number: a volatility never appears without it
  • n_classes integer | null optional
  • note string | null optional
  • parent_fund string | null optional the fund whose holdings a share class's risk is modeled from
  • portfolio_id string | null optional
  • r2 number | null optional
  • reason string | null optional
  • requested_at string | null optional
  • share_class_note string | null optional shown with the number when the risk comes from a parent fund
  • sigma_annual number | null optional annualized volatility, a decimal (0.136 = 13.6%)
  • sigma_display string required the one display string: "13.6% a year · Holdings-based" (+ " · Estimated"), or "—" when there is no number
  • sigma_factor number | null optional
  • sigma_specific number | null optional
  • status string required modelled (the status value; American: modeled): a number below; queued: modeled by the next nightly; none: request it; under_review: risk under review, no number shown (src/compute/risk_under_review); ended: a fund that has ended (liquidated, merged, deregistered, delisted), no number shown, never queued
  • ticker string required
  • ticker_collision object | null optional the ticker is also a non-US listing: {resolved, other, rule}; the US listing's security type wins
  • tier string | null optional P1 (best) to P4; P4 is estimated

CoverageRequestBody

  • tickers string[] required the tickers to have modeled by the next nightly

CoverageRequestRow

  • note string required
  • record CoverageRecord required
  • request_id integer | null optional the open request (one per ticker, shared by every caller); none when already modeled
  • status string required
  • ticker string required

CoverageRequests

  • n integer required
  • queued integer required
  • requests CoverageRequestRow[] required

CreateBook

  • book_id string required
  • name string required
  • positions object required positions/2 (with contract) or positions/1 (weights)

Driver

  • exposure number required the book's stored exposure (a duration on KRD_ / OAS_ factors, else a weight)
  • factor string required
  • group string required rates | credit | currency | equity | commodity | implied_vol | alternatives | other
  • label string | null optional the factor in plain words, e.g. 'US equity: Information Technology'
  • share_of_variance_pct number required Euler share of the total variance, percent (negative = diversifying)
  • vol_contribution_pct number required contribution to the annual volatility, percentage points (sums with specific to total)

DriverGroup

  • factors integer required its factors with a nonzero exposure
  • group string required
  • hist_var_pct number | null optional
  • hist_var_usd number | null optional
  • net_tilt number required the sum of the group's exposures, in the factors' own units
  • share_of_variance_pct number required the group's summed share of the variance, percent
  • var_pct number | null optional
  • var_usd number | null optional

DriverRow

  • exposure number required the book's exposure to the factor (stored-exposure units: KRD_ / OAS_ are changes)
  • factor string required
  • group string required Market | Sectors | Styles | Rates | Credit | Countries/Regions | Alternatives (a vendor's factors: Vendor model)
  • hist_var_pct number | null optional its share of the historical VaR, percent (the mean loss on the tail days)
  • hist_var_usd number | null optional
  • label string required the factor in plain words (long form)
  • share_of_variance_pct number required its share of the book's variance, percent (can be negative)
  • short_label string required clean and untruncated: 'Beta', 'Information Technology', 'US 10-year rate' (Vega sector names)
  • var_pct number | null optional its share of the normal 1-day 95% VaR, percent (= the share of the variance)
  • var_usd number | null optional its normal VaR contribution in dollars (with a book value)

EconomySnapshot

  • groups object[] required
  • latest_observation string | null optional
  • note string | null optional
  • one_liners [] optional
  • recorded string | null optional
  • series object[] required
  • source string required

ErrorBody

  • error ErrorDetail required

ErrorDetail

  • code string required stable machine code, e.g. invalid_key, missing_scope, book_not_found, positions_refused
  • detail object optional structured detail; always carries request_id
  • message string required a plain-English sentence

Exposure

  • exposure number required
  • factor string required
  • sign string optional
  • unit string optional

ExposuresResult

  • as_of string required
  • basis string required stored = the nightly result; on_demand = computed for this request
  • book_id string | null optional null for an on-demand call on inline positions
  • exposures Exposure[] required
  • model ModelLabel required
  • model_as_of string | null optional live books: the date of the model's data used (the latest recorded set on or before as_of)
  • positions_as_of string | null optional live books: the date of the positions used (the latest on or before as_of)

FactorCatalogue

  • factors FactorInfo[] required
  • model ModelLabel required
  • model_as_of string | null optional

FactorInfo

  • factor string required
  • group string required
  • label string required
  • short_label string required

FeeHolding

  • instrument_id string | null optional the app's instrument id (Vega View search), e.g. fund:922908363
  • ticker string | null optional
  • value number required the position's value in dollars

FitJob

  • callback object | null optional the callback URL, when it was sent, and each delivery attempt
  • created_at string required
  • error JobError | null optional
  • fingerprint string required
  • finished_at string | null optional
  • inputs object required the recorded set the fit runs on: {label, inputs_hash}
  • job_id string required
  • kind string required
  • model_id string | null optional once done: pass it as model_id to the risk and compare routes
  • name string | null optional
  • reason string | null optional while queued: why it waits, in plain words
  • retry_after_s integer | null optional poll again after this many seconds (also the Retry-After header)
  • source string | null optional showcase = a precomputed equity fit
  • started_at string | null optional
  • status string required

FitList

  • fits FitJob[] required
  • next_cursor string | null optional

FitReport

  • job FitJob required
  • model ModelLabel required
  • report object required structure (factors, window, PSD), every sandbox book's risk under the model, and the backtest against the house: whole-window statistics with BY-YEAR bias rows, the paired bootstrap and the verdict

FitRequest

  • callback_url string | null optional https URL called (POST, signed) when the fit finishes; see GET /webhooks/secret
  • spec object required a spec document (see POST /specs/validate)
  • validate boolean optional also backtest the model against the house (bias by year, the verdict); about a minute instead of about 15 seconds

FundFee

  • as_of string | null optional
  • cheapest_class object | null optional the cheapest class of the same fund that a retail investor can buy, when cheaper (open, not insurance-only, not institutional-only or retirement-plan, a stated minimum of at most $10,000), with its minimum
  • class_id string | null optional
  • display_name string | null optional the fund's clean name (SEC series / class names)
  • fee_12b1 number | null optional
  • fee_waiver number | null optional
  • gross_expense_ratio number | null optional
  • instrument_id string | null optional
  • management_fee number | null optional
  • net_er_basis string | null optional
  • net_expense_ratio number | null optional a fraction (0.0004 = 0.04%): net of waivers
  • net_expense_ratio_display string required "0.04% a year", or "—" when there is none
  • note string | null optional
  • ref string | null optional the SEC filing's accession number
  • review_flag string | null optional set when the figure looked implausible and was kept for review
  • series_id string | null optional
  • source_label string | null optional SEC prospectus fee table | Third-party ETF data
  • status string required
  • ticker string | null optional
  • waiver_end_date string | null optional

FundFees

  • fees FundFee[] required
  • found integer required
  • n integer required

FundHoldings

  • holdings_as_of string | null optional the date of the holdings report looked through
  • holdings_source string | null optional where those holdings come from (e.g. the fund's N-PORT filing)
  • key string required fund:<TICKER>
  • looked_through boolean required its holdings were looked through (else its published exposure vector stands for it)
  • modelled_pct number | null optional share of the fund's own value the model covers, percent
  • name string | null optional
  • weight number required the fund's weight in the book

GroupShare

  • group string required
  • share_of_variance_pct number required

HouseSpec

  • document object required
  • inputs string required the recorded set the sandbox fits on, e.g. rec_s21
  • kind string required

JobError

  • code string required
  • message string required

LookThrough

  • as_of string required
  • fund_name string required
  • holdings_as_of string required the date of the filing the lines come from
  • holdings_source string required
  • lines LookThroughLine[] required
  • lines_total integer required
  • modelled_pct number required
  • offset integer required
  • sleeves object[] | null optional
  • snapshot integer required
  • ticker string required
  • weights_sum_pct number required

LookThroughLine

  • asset_class string | null optional
  • country string | null optional
  • currency string | null optional
  • duration_contribution number | null optional
  • key string | null optional
  • line_kind string | null optional
  • maturity_bucket string | null optional
  • modelled boolean | null optional
  • name string | null optional
  • region string | null optional
  • share_of_factor_risk_pct number | null optional
  • sleeve string | null optional
  • ticker string | null optional
  • vega_industry string | null optional
  • vega_sector string | null optional
  • weight number | null optional fraction of the fund

LookThroughSummary

  • funds integer required fund lines in the book
  • funds_looked_through integer required
  • holdings FundHoldings[] optional one row per fund line: what was looked through, as of when
  • looked_through_pct number required share of the book's gross weight held in funds that were looked through, percent
  • modelled_pct number required share of the book's gross weight the model covers, percent
  • securities integer | null optional distinct securities held, directly or through funds
  • top object[] optional the largest securities by weight in the book, through funds and directly

ModelCard

  • card_sha256 string required sha256 of the card's canonical JSON: the same model, the same card
  • certification string | null optional
  • fingerprint string | null optional
  • kind string required house | fit
  • model ModelLabel required

ModelInfo

  • bound boolean required bound to one of this tenant's books (else a house model it may request)
  • default boolean optional the model used when a call names none
  • model ModelLabel required

ModelLabel

  • binding_id string | null optional
  • certification string optional
  • fingerprint string | null optional
  • fingerprint_kind string optional
  • house boolean optional
  • id string required house:<set code> | factory:<spec fp>@<panel fp> | foreign:<entity>:<delivery hash> | composite:<spec fp>
  • label string required the sentence shown next to every number made with this model
  • name string required
  • run string | null optional inputs hash of the run that produced the numbers
  • stale_since string | null optional set when the nightly kept the last good run
  • version string | null optional
  • via string | null optional a bound model: the level it is bound at (firm, account, portfolio)

ModelList

  • models ModelInfo[] required
  • next_cursor string | null optional pass as cursor for the next page; null on the last page

OnDemandRequest

  • as_of string | null optional
  • book_id string | null optional
  • model_id string required
  • positions Positions | null optional

PortfolioFees

  • fee_drag object | null optional ILLUSTRATIVE: value after 10 and 20 years with and without fees, at assumed_return
  • holdings object[] required per holding: ticker, value, net ER (+ display), annual_cost_usd, source_label, as_of, cheapest_class
  • illustrative_note string | null optional
  • portfolio object required weighted_net_expense_ratio (+ display), total_annual_fees_usd, value_with_er_pct, holdings_without_er

PortfolioFeesBody

  • assumed_return number optional the assumed annual return of the illustrative fee drag
  • holdings FeeHolding[] required

PositionLine

  • account string | null optional
  • asset_class string | null optional
  • company_id integer | null optional
  • currency string optional
  • identifier string | null required
  • identifier_type string required
  • market_value number | null optional
  • name string | null optional
  • quantity number | null optional
  • weight number | null optional

Positions

  • as_of string required
  • base_currency string optional
  • calendar string optional
  • lines PositionLine[] optional
  • meta object optional
  • portfolio_key string required
  • provenance Provenance required
  • total_market_value number | null optional

PositionsAccepted

  • as_of string required
  • book_id string required
  • content_hash string required sha256 of the accepted positions (the audit log keeps this, never the lines)
  • lines integer required
  • warnings object[] optional the positions v1 validator's warnings

PositionsOut

  • book_id string required
  • positions Positions required

PositionsStatus

  • as_of string required
  • book_id string required
  • contract string required
  • held boolean required
  • lines integer required
  • mapped integer | null optional
  • modelled_share number | null optional
  • not_mapped integer | null optional cash and derivatives: stored, not mapped to a security
  • received_at string required
  • risk_ready boolean required
  • sha256 string required sha256 of the stored positions: the same book sent by any route has the same hash
  • unmapped integer | null optional
  • verdict string | null optional
  • versions string[] optional every stored date of this book
  • via string required api | sftp | upload: the route the version came in by
  • why_not_ready string | null optional

PositionsStored

  • book_id string required
  • contract string required
  • evaluation BookEvaluation required
  • fi object | null optional the bond lines through the fixed-income checks and store (when switched on)
  • stored boolean required

PositionsV2Body

  • as_of string required
  • base_currency string optional
  • contract string optional
  • lines object[] required positions/2 lines: identifier_type, identifier, asset_class, quantity, price?, price_kind?, currency, terms?, ...
  • price_source string optional
  • refuse_share number optional

Proposal

  • book_id string | null optional
  • client_name string | null optional
  • created_at string required
  • decided_at string | null optional
  • decided_by string | null optional
  • human_only string required who decides: a human approver, never the API
  • kind string required
  • model_id string required
  • note string | null optional
  • proposal_id string required
  • proposed_by_key string | null optional
  • reason string required
  • status string required
  • via string | null optional

ProposalList

  • next_cursor string | null optional
  • proposals Proposal[] required

ProposalRequest

  • book_id string | null optional
  • kind string required
  • model_id string required
  • reason string required

Provenance

  • licence_holder string | null optional
  • received_at string | null optional
  • source string required
  • vintage string | null optional

Query_

  • columns string[] | null optional
  • cursor string | null optional
  • filters object[] optional
  • group string | null optional funds: "fund" (the default: one row per fund, classes nested) or "class" (flat)
  • include_frozen boolean | null optional funds: frozen funds (trading_status_code "frozen"); default shown, sorted last
  • include_incomplete boolean optional funds: also the records the quality gates mark incomplete (complete: false)
  • include_untraded boolean optional
  • limit integer optional
  • sort object[] optional
  • spark string | null optional "1y": 52 weekly closes per row, indexed to 1.0
  • stats string[] | null optional ["sector_median"]: per peer group, median / p25 / p75 over the whole universe
  • universe string optional
  • view string optional

RiskCoverage

  • counts object required {modelled, queued, none}, and under_review / ended when any ticker is: the values sum to n
  • coverage CoverageRecord[] required
  • n integer required

RiskResult

  • as_of string required
  • basis string required stored = the nightly result; on_demand = computed for this request
  • beta number | null optional
  • book_id string | null optional null for an on-demand call on inline positions
  • book_value_source string | null optional
  • book_value_usd number | null optional the book value the dollars are on: ?book_value, else the priced book's market value
  • bound_model object | null optional your model is bound but not served on this answer: which, and why (the house is shown)
  • comparison object | null optional on your bound model: the house's figures for the same book, and the difference
  • driver_groups DriverGroup[] | null optional ?drivers=all: per group, the summed share and the net tilt
  • drivers DriverRow[] | null optional ?drivers=all: EVERY factor with a nonzero exposure, largest share first (null otherwise)
  • factor_vol_pct number required
  • groups GroupShare[] optional factor variance by group, percent of the total
  • lines integer required
  • look_through LookThroughSummary | null optional live books: what was looked through, and as of when
  • method string | null optional published (the snapshot's own figures) | composed (a mix of funds) | fit | positions (your own lines: stocks, bonds and funds looked through)
  • model ModelLabel required
  • model_as_of string | null optional live books: the date of the model's data used (the latest recorded set on or before as_of)
  • modelled_pct number required share of book value the model covers, percent
  • positions_as_of string | null optional live books: the date of the positions used (the latest on or before as_of)
  • specific_missing_share number | null optional share of the book with no specific risk in the model (e.g. a bond's issuer risk), a fraction
  • specific_share_pct number | null optional specific variance as a share of the total, percent
  • specific_vol_pct number required
  • top_drivers Driver[] optional the largest factor contributions, by absolute share
  • total_vol_pct number required annualized total volatility, percent
  • var object | null optional ?drivers=all: 1-day 95% VaR, normal and historical (method, window, %, $ with a book value)
  • var_95_1d_pct number | null optional one-day 95% VaR, percent of book value: the published figure for a fund; null for a mix of funds
  • vendor_coverage_pct number | null optional on a vendor model: share of the book's gross weight the vendor's model carries, percent (the rest is not in the numbers)

ScenarioOutcome

  • name string required
  • pnl_pct number required book P&L under the scenario, percent of book value
  • scenario_id string required

ScenariosResult

  • as_of string required
  • basis string required stored = the nightly result; on_demand = computed for this request
  • book_id string | null optional null for an on-demand call on inline positions
  • model ModelLabel required
  • model_as_of string | null optional live books: the date of the model's data used (the latest recorded set on or before as_of)
  • positions_as_of string | null optional live books: the date of the positions used (the latest on or before as_of)
  • scenarios ScenarioOutcome[] required house-factor scenarios only (roadmap I.3)

SeriesStored

  • data_hash string required sha256 of the series: name it in a spec's custom[].data_hash
  • filename string | null optional
  • first string required
  • kind string | null optional
  • last string required
  • rows integer required
  • rules string[] | null optional the rules that say which bonds load on a series
  • size integer | null optional
  • stored boolean | null optional false when these exact bytes were stored before
  • stored_at string | null optional
  • units string | null optional
  • units_given string | null optional
  • use_in_spec object | null optional
  • warnings [] optional

SpecBody

  • document object required a spec document: kind fixed_income (fitted in the sandbox), equity (precomputed showcase fits only), multi_asset (not on this release)

SpecValidated

  • fingerprint string required the recipe's name: the same document always has the same fingerprint
  • fingerprint_version integer required
  • kind string required
  • name string | null optional
  • spec object required the document as validated, every default filled in

WebhookSecret

  • algorithm string required
  • format string required
  • header string required
  • secret string required HMAC-SHA256 key for X-Vega-Signature; keep it like a password

RetireBody

  • note string required

ShelfBody

  • name string required
  • families string[] required

SubmitBody

  • note string required

OutcomeAccount

  • type string required

OutcomeClient

  • label string | null optional
  • summary string | null optional

OutcomeContribution

  • start_year integer required
  • end_year integer required
  • amount_per_year number required

OutcomeForLife

  • age integer required
  • sex string | null optional
  • spouse OutcomeSpouse | null optional
  • fixed_age integer | null optional

OutcomeGoal

  • kind string required
  • required_probability number | null optional
  • amount number | null optional
  • horizon_years integer | null optional
  • amount_per_year number | null optional
  • start_year integer | null optional
  • years integer | null optional
  • for_life OutcomeForLife | null optional
  • name string required
  • priority string required

OutcomeGuaranteedIncome

  • label string | null optional
  • start_age integer required
  • amount_per_year number required
  • cola string | number | null optional

Outcome

  • kind string | null optional
  • required_probability number | null optional
  • amount number | null optional
  • horizon_years integer | null optional
  • amount_per_year number | null optional
  • start_year integer | null optional
  • years integer | null optional
  • for_life OutcomeForLife | null optional
  • starting_assets number required
  • account OutcomeAccount | null optional
  • contributions OutcomeContribution[] | null optional
  • guaranteed_income OutcomeGuaranteedIncome[] | null optional
  • goals OutcomeGoal[] | null optional

OutcomeOutput

  • quick boolean | null optional
  • quick_then_full boolean | null optional

OutcomeSpouse

  • age integer required
  • sex string | null optional

OutcomeUniverse

  • funds string[] required

OptimizeBody

  • shelf_id string required
  • shelf_version integer | null optional
  • universe OutcomeUniverse | null optional
  • outcome Outcome required
  • output OutcomeOutput | null optional
  • client OutcomeClient | null optional
  • model_id string | null optional
  • role string | null optional
  • risk_model_spec_id string | null optional

SavedRequestBody

  • name string required
  • request OptimizeBody required
Changelog

What changed

2026-10-21 · v1 (preview)
  • Batches: many books in one call, a job id, its progress and each result; idempotent and resumed after a restart.
  • as_of on every risk and model call: the model served that day and the book as it stood then.
  • Quant outputs: a model's factor covariance, exposures and specific risk per date; each position's contribution and a what-if.
  • OpenAPI document and a Postman collection to download; the Python client covers every route.
2026-10-19 · v1 (preview)
  • Sandbox: demo books on a recorded snapshot, reached with a sandbox key issued on request.
  • Model builder: validate a spec, start from the house recipe, fit it (fixed income), read the report with bias by year, compare it with the house on a book.
  • Fund look-through, the economy snapshot, your own spread series (upload and fit), proposals that a person acts on.
  • Python client 0.1.0 and a local MCP server for AI assistants (read-only tools and propose-only requests).
Live

Outcome Model API Live in pilot

The Outcome Model API is live in pilot. Client access opens when our return assumptions are published; request access now and we'll set up your shelf. What follows documents the request it takes and the record it returns.

It builds a model portfolio toward a stated goal, such as reaching an amount by a date or paying an income for a number of years, using Vega's risk model and return assumptions on a fund shelf the manager chooses, such as its own funds.

Every projected figure is labeled hypothetical. Projections are not a forecast or a guarantee.

A person reviews each model before it is delivered. Models reach the manager as files, and what to do with them is the manager's decision. The API does not place trades and does not assign models to accounts.

Where it stands

Outcome routes (optimize, jobs, model portfolios, saved requests)Live in pilot (internal and demo accounts)
The engine that solvesRuns behind the API; every result records the engine version and configuration that produced it
Return assumptionsA draft, not yet published: every result is labeled draft
Stress scenariosOne stress scenario, Covid-style, comes back without a figure for now

Routes

  • POST /v1/shelves
  • PUT /v1/shelves/{shelf_id}
  • GET /v1/shelves
  • GET /v1/shelves/{shelf_id}
  • POST /v1/outcomes/optimize (202: a job)
  • GET /v1/jobs
  • GET /v1/jobs/{job_id}
  • GET /v1/jobs/{job_id}/result
  • GET /v1/model-portfolios
  • GET /v1/model-portfolios/{model_id}
  • GET /v1/model-portfolios/{model_id}/versions
  • GET /v1/model-portfolios/{model_id}/versions/{version}
  • POST /v1/model-portfolios/{model_id}/submit
  • POST /v1/model-portfolios/{model_id}/retire
  • GET /v1/model-portfolios/{model_id}/diff
  • GET /v1/model-portfolios/{model_id}/export
  • POST /v1/saved-requests
  • GET /v1/saved-requests
  • GET /v1/saved-requests/{saved_id}

The request: POST /v1/outcomes/optimize

universe.fundsthe funds the engine may use, each a line of your shelf: 1 to 300 unique tickers, in any order. Without it, the engine uses all the funds on your shelf
outcome.starting_assetsassets today: more than 0, up to 1,000,000,000
outcome.account.typetaxable or tax_deferred
outcome.contributions[]savings each year in today's dollars: start_year, end_year, amount_per_year; years 1 to 60, end not before start; up to 10
outcome.kindone goal: target_wealth or income
amount, horizon_yearstarget_wealth: the target in today's dollars (more than 0), in 1 to 60 years
amount_per_year, start_year, yearsincome: the amount a year in today's dollars (more than 0), the first year (1 to 60), and years (1 to 60) or for_life
outcome.for_lifeplan the income for life, which sets the planning age: age 18 to 100, optional sex, optional spouse (age, optional sex), optional fixed_age 50 to 110
outcome.guaranteed_income[]Social Security and other outside income: optional label, start_age 18 to 100, amount_per_year, cola ("cpi" or -5% to 10%); up to 4
required_probabilitythe required chance: 0.5 to 0.99; 0.8 when absent
outcome.goals[]several goals instead of one kind: name, priority (needs or wants), kind and its fields, optional required_probability; 1 to 8, not nested
clienta label for people (label up to 80 characters, summary up to 400). It is not sent to the engine and does not change the result

Priority is needs or wants; other values are refused, as are other account types, unknown fields and values of the wrong type. A fund that is not on your shelf is refused with 422 fund_not_on_shelf. House benchmark funds are used as reference and are held only when they're on your shelf.

The record: one version of a model portfolio

Who and whentenant_id, model_id, version, name, created_at, status (draft, submitted, approved, retired), approval (name, email, time, note) once a person signs off
What it was computed onrisk_set, cma (version, sha256, draft), engine (sha, configuration, solver, library versions, tolerances), seed, paths
The solverole, solve (status optimal or best_found_within_time, retries). A best_found_within_time solve, or one with retries, is saved but can't be approved
The portfoliolines: series_id, class_id, ticker (display only), name, weight, risk_method (holdings_based, returns_based, proxy_total_vol, proxy_category, money_market), estimated, lookthrough, covered_as_cash, expense_ratio, modeled_share, equity_share, equity_estimated, cusip, isin; cash_target
Figures (hypothetical)analytics: expected_return, vol, p_success, required_probability, meets_goal, expense_ratio, te, sharpe, beta_to_benchmark, cvar95_annual
Coveragelook_through, weighted_average_share, share_with_measured_risk_basis
Labelslabels (hypothetical, draft, interim), excluded_funds (with the reason), disclosures
Integrityresult_sha256, request_fingerprint (same inputs), fingerprint (same content)

Printed with every figure

  • Hypothetical · draft
  • Capital market assumptions are a draft and have not been published.
  • Hypothetical results produced by a model from assumptions, not the results of any account and not a guarantee of future results. Actual returns, fees and outcomes will differ, and losses are possible. This draft is not a recommendation to buy or sell any security.
  • A line whose risk comes from its own returns carries "Risk estimated from returns".

Same request, same result

The seed is a hash of what the engine receives, with the configuration, the data, the return assumptions and the risk model, so the same request returns the same result, bit for bit. The client block is a label for people and never changes the result. Which funds you list and every outcome value do; the order you list them in does not.

What a result looks like (illustration, hypothetical)

An illustration of the figures and labels from one run of the engine on a hypothetical client, recorded on snapshot 34. It is the engine's output, not an API response. Fund names are placeholders.

{ "portfolio": { "role": "max_probability", "meets_goal": false,
    "weights": [ {"ticker": "FUND_A", "weight": 0.1994, "risk_method": "holdings_based"},
                 {"ticker": "FUND_B", "weight": 0.1425, "risk_method": "holdings_based"}, "… 9 more" ],
    "analytics": { "expected_return": 0.0596, "vol": 0.0531, "cvar95_annual": 0.0594,
                   "fees": {"expense_ratio": 0.0005}, "projection": {"p_success": 0.6276} } },
  "disclosures": [ "Illustrative · hypothetical · not investment advice",
                   "Hypothetical results produced by a model from assumptions; not the results of any account and not a guarantee." ] }

It falls short of the goal, a 62.8% hypothetical chance against 80% required, and the result says so.

API access

Request API access

Tell us what you would like to build; we review each request and send a key.