BANGER
Product status: Banger’s public beta is paper-only. References to live execution are future-looking. Venue rules and legal claims can change; verify current primary sources for your jurisdiction.
2026-07-23 · 3 min read · reviewed 2026-10-14

Risk Management for Prediction-Market Bots

A risk control needs a defined input, an enforced action and observable evidence. A limit described in a plan does not prove that a running strategy honors it. Test the exact runtime and mode rather than assuming a familiar field name implies a particular safeguard.

For event-contract research, start with the exact payout and account model. A fully paid ordinary binary long can lose its stake and costs. That observation does not cover financed positions or every venue product, and it does not make a price stop executable at its requested level.

Separate the questions each control answers

A position limit bounds a specified exposure measure. An order-rate limit bounds activity over a clock window. A loss control reacts to the losses its valuation model can observe. A session stop addresses resource lifetime. These are related but different operations; none should inherit the guarantees of another.

Keep units and scope visible. Does a limit apply to one market side, a strategy's portfolio, every strategy in an account, or shared infrastructure? Do not describe a per-context cap as an account-wide guarantee without testing that shared enforcement.

Declare actual Banger fields

The public 0.1.7 RiskEnvelope accepts the fields shown below. Unset limits are optional, so a declaration with no values should not be described as comprehensive protection. The following numbers are small fixture inputs chosen to illustrate behavior, not sensible defaults for an investor.

from decimal import Decimal
from banger import RiskEnvelope

# Illustrative offline-fixture limits, not recommended account allocations.
example_risk = RiskEnvelope(
    max_position_usd=Decimal("10"),
    max_daily_loss_usd=Decimal("2"),
    max_open_positions=2,
    max_concentration_pct=0.5,
    max_orders_per_minute=3,
)
# A strategy class can declare: risk = example_risk
# This declaration does not start a session, send orders or flatten positions.

max_position_usd concerns cumulative cost basis in an open position, so repeated acquisitions must be considered together. max_open_positions counts positions; it does not infer that their outcomes are independent. max_concentration_pct is a declared portfolio-share control, not a stress model for every common event.

Know what the loss control does

In the packaged forward-paper context, max_daily_loss_usd compares mark-to-market P&L with a current UTC-day baseline and blocks additional opening orders once the threshold is reached. This is different from a worst-case-settlement loss bound or a guarantee that the account cannot lose more afterward.

An existing holding can remain exposed. A missing or stale mark limits what the monitor can observe. Test the baseline clock and carry existing positions through the failure fixture; do not call a rejected new order evidence of automatic flattening. Historical backtesting is a separate context with its own clock and model.

Test enforcement rather than promising it

The limits in the example and the packaged position/loss behavior were exercised offline with synthetic ticks. That verifies those fixtures, not a newly signed-in production account, uninterrupted market data or a real venue's order state.

Define shutdown as a state transition

Disabling new submissions, requesting cancellation, confirming terminal orders and disposing of held exposure are distinct steps. An interrupted process can leave uncertainty. Preserve it explicitly rather than displaying an unsupported all-clear.

For paper sessions, verify the stopped record and resource cleanup while retaining the simulated history. A stopped worker is not proof that a real account is flat. A desired reduction also needs an executable model and current data; a stop-loss threshold cannot manufacture liquidity.

Keep the research conclusion bounded

Banger's public beta is paper-only. The public package uses on_market_tick(market, tick, ctx), actual Context methods and named risk fields; it does not ship the invented per_trade_cap/daily_loss_stop/kill_switch configuration previously described here. Paper use does not require claiming a public live deployment or copying venue secrets into examples.

The packaged forward-paper model can assume a fill at a non-crossing limit. Review that assumption alongside fees, price units and exposure logs. A useful risk test establishes that specified constraints held for the observed path; it does not establish profitable trading, universal safety or readiness to deploy capital.

Sources

Keep reading

Run your first strategy free

Paper-trade on Polymarket and Kalshi market data without venue keys.

Start free