A persistent ontology of countries, militant groups, leaders, places, and financial instruments, with every news item, financial move, whale trade, forecaster question, and seismic event linked to the entities they touch. The same data Trench consumes every 10 minutes to decide which conflict markets to trade; now available to your stack.
pip install trench-core ships the
OntologyStore class that backs every endpoint below, typed entities,
alias resolver, event log, market linker, all stdlib + SQLite. Build your own
graph from your own seed, or hit the API for ours.
74+ named entities (countries, groups, leaders, places, instruments) with stable IDs, aliases, and 65+ typed relationships (funds, hostile_to, allied_with, leading_indicator_for, located_in).
News from 70+ RSS feeds, Telegram OSINT, Twitter, financial moves on 11 instruments, Polymarket whale flow, Manifold/Metaculus forecaster consensus, USGS seismic data, and a curated geopolitical events calendar, all auto-tagged with the entities they touch.
Source-diversity corroboration scores per Kalshi/Polymarket conflict ticker, distinct source-type count divided by 5, capped at 1.0. Updated every tick.
Live event-volume surge alerts when an entity cluster sees 3× its baseline rate in 5 minutes, the same signal that triggers the trading bot to re-evaluate.
All endpoints are read-only. Anonymous tier (60 req/h per IP) is open; higher tiers require an API key passed as X-API-Key header.
?type=country?entity=iran&source_type=financialAnonymous, no key needed:
curl https://trenchsignals.io/v1/ontology/entities?type=country
With a key (raises your rate limit):
curl -H 'X-API-Key: ts_xxxxxxxx' \\ https://trenchsignals.io/v1/ontology/digest
Python:
import requests
r = requests.get(
"https://trenchsignals.io/v1/ontology/confluence/kalshi/KXUSAIRANAGREEMENT-27-26JUL",
headers={"X-API-Key": "ts_xxxxxxxx"},
)
print(r.json()) # → {score, source_type_count, source_types, ...}
The graph is the data, the bot is the agent. The same code that
produces every signal on /log ships as the
trench-bot package. One command to install, one to
configure, one to run a single analysis cycle.
pip install trench-bot # PyPI publish pending; today: pip install -e . from the repo export ANTHROPIC_API_KEY=sk-ant-... trench-bot init # writes ~/.trench/config.toml trench-bot run --tick-once # one cycle, exits cleanly
Defaults are paper-trade mode, $1,000 paper bankroll, Claude
Haiku for cheap first-touch (under $0.05 per cycle). State
persists under ~/.trench/. Real trading needs
--live plus Kalshi or Polymarket credentials.
Methodology, config reference, and the going-live guide live
in the package README.
The open-source scoring stack (trench-core, MIT)
ships separately as the framework trench-bot depends on.
The graph is fed by an autonomous bot that polls 70+ news feeds, Telegram channels, Twitter, financial markets (11 instruments), Polymarket whale flow, Manifold/Metaculus forecasters, USGS seismic data, and a curated calendar, every 10 minutes. Each event is tagged with the entities it touches via a deterministic alias resolver covering 200+ proper-noun terms. Source-type credibility weights drive the confluence scoring.
For more detail on how the engine works, see the About page on the live dashboard.