QuoteEngine is the SimpleFunctions automated quoting workflow. It maintains bid/ask quotes for a prediction-market contract, adjusts around mid-price movement, applies inventory and exposure limits, and can run in paper mode before live execution. Use this page for operational setup. Use Real-Time Data API when you want to build your own market-making system from raw orderbooks, trades, candles, and movers.Documentation Index
Fetch the complete documentation index at: https://docs.simplefunctions.dev/llms.txt
Use this file to discover all available pages before exploring further.
Mental model
| Component | Role |
|---|---|
| Quote | One configured market-making instruction for a ticker or Polymarket token. |
| QuoteEngine | Local daemon that refreshes market data, computes quote levels, places/cancels orders, and tracks state. |
| Spread | Base distance between bid and ask, in cents. Wider spread reduces adverse-selection risk but lowers fill rate. |
| Inventory skew | Moves quotes away from inventory you already hold, so the engine does not keep adding the same exposure. |
| Bias | Manual or thesis-driven directional lean, in cents. Positive bias is bullish; negative bias is bearish. |
| Fade | Temporary spread widening after a fill, then decay back toward the configured spread. |
| Paper mode | Simulated fills from live data. No live orders. Use for onboarding and dry runs. |
First safe run
Start with paper mode and tight limits:Quote creation flags
| Flag | Use |
|---|---|
--paper | Simulate fills from live data instead of placing live orders. |
--spread <n> | Base spread in cents. Default is 2. |
--size <n> | Contracts per side per layer. Default is 5. |
--threshold <n> | Requote when mid moves more than n cents. |
--max-long <n> | Max YES contracts. |
--max-short <n> | Max NO contracts. |
--max-exposure <n> | Max dollar exposure. |
--stop-loss <n> | Stop if P&L is below -n dollars. |
--no-skew | Disable inventory skew. Use only when you are intentionally running symmetric quotes. |
--bias <n> | Manual bias in cents, from -10 to 10. |
--bias-mode <mode> | manual, thesis, or off. |
--thesis-id <id> | Use a specific thesis for auto-bias. |
--thesis-auto | Auto-pick the best matching thesis for this ticker. |
--min-spread <n> | Minimum allowed spread in cents. |
--max-spread <n> | Maximum allowed spread in cents. |
--fade <n> | Widen spread by n cents after fill. |
--fade-decay <n> | Seconds for fill fade to decay. Default is 30. |
--layers <n> | Quote layers per side. Default is 1. |
--layer-spacing <n> | Cents between layers. Default is 1. |
--requote-delay <ms> | Debounce requotes. |
--venue <name> | Force kalshi or polymarket; otherwise inferred from ticker shape. |
Bias patterns
Use--bias-mode off or omit bias for neutral quoting:
--thesis-auto only when you are comfortable with automatic thesis matching:
Operational loop
A production-style loop should be explicit:Agent integration
For an external agent, separate research from execution:--paper, --max-exposure, --stop-loss, and small size limits.
If Claude Code or Codex is driving the workflow, give it this boundary:
Live execution checklist
Before removing--paper:
sf status --jsonshows expected auth and exchange configuration.sf quoteengine status --jsonis understood and clean.- The quote has explicit
--max-long,--max-short,--max-exposure, and--stop-loss. - The spread is wider than the minimum tick noise you observed in paper mode.
- The operator knows how to run
sf quoteengine stop. - A separate process monitors fills, P&L, stale books, and exchange status.
Related docs
Real-Time Data API
Raw market data for custom quoting, replay, and research systems.
Trade intents
Declarative execution workflow for non-market-making trades.
Headless agent
Let Claude Code, Codex, cron, or CI drive
sf safely.Risk gates
Portfolio and execution risk controls.