delphi-kit
Python tools for Delphi, the prediction market on the Gensyn chain. It has a library, a
delphi command, an MCP server so AI agents can trade under spending limits, and alerts.
It reads straight from the chain, so you need no API key to list, search, price or track anything. A wallet key is only needed to trade.
It covers every Delphi market on mainnet: the current LMSR markets and both older parimutuel (DPM) generations. That's 1,027 markets as of November 2026.
pip install delphi-kit # library + CLI
pip install "delphi-kit[mcp]" # + MCP server
Find a market and price a trade
$ delphi search bitcoin --limit 3
0x44CF6d128e086961b7c0844dE6285c75046d7B7C Dec 25 05:00 $ 27.85 Yes 17% No 83%
Will Bitcoin exceed $100,000 by Christmas 2026?
0x662Bba4819098F000d33d1e09Dff5dC3C3a5aa87 Dec 31 00:00 $ 19.11 Yes 33% No 67%
Will Bitcoin's Coinbase BTC-USD price be above $80,000 at 00:00 UTC on Dec 31, 2026?
0xc43F7318bf91915dba2A3A02489bdEd2aDC1731f Jan 01 02:00 $ 39.52 Yes 22% No 78%
Will Bitcoin reach $100k in 2026?
$ delphi quote 0x4F5DC6b636c226CeC0C2403f988f24431b9Cc463 Yes --usd 5
buy 7.7223 Yes shares costs $4.9996 (avg 0.6474); probability 50.4% → 75.3%
Most Delphi pools hold $10–$50, so a $5 trade can move the price 25 points. Every quote shows the probability after your trade so you see that before you pay.
delphi market <address> prints the rules the AI judge will apply and the sources it will read. It also checks
that the rules file matches the hash stored on chain.
Library
from delphi_kit import Delphi
d = Delphi() # mainnet, read-only
for m in d.search("election", limit=5):
print(m.summary())
m = d.market("0x4F5DC6b636c226CeC0C2403f988f24431b9Cc463")
print(m.rules, m.sources, m.metadata_verified)
q = d.quote_buy(m, "Yes", usd=2) # shares, average price, probability before/after
print(q.shares, q.average_price, q.probability_after)
d = Delphi(private_key="0x...") # or set DELPHI_PRIVATE_KEY
t = d.buy(m, "Yes", usd=2, max_slippage=0.02) # approves only what this trade needs
d.sell(m, "Yes") # everything you hold in that outcome
for p in d.positions(): # every market, with what to do next
print(p.question, p.outcome_label, p.shares, p.value_usd, p.action) # action: redeem | liquidate | None
You can pass an address or a Market anywhere one is expected, and outcomes take a label ("Yes") or an index.
Money comes back as USD floats and shares as decimal numbers; every object has .to_dict().
Command line
| command | does |
|---|---|
delphi markets [--status open|settled|…|all] |
list markets with live odds, soonest to close first |
delphi search <words> |
keyword search over questions, outcomes and rules |
delphi market <address> |
one market in full: rules, sources, deadlines, fee, hash check |
delphi quote <address> <outcome> --usd N | --shares N | --sell N |
price a trade, send nothing |
delphi buy <address> <outcome> --usd N |
buy (asks you to type yes first unless --yes) |
delphi sell <address> <outcome> [--shares N] |
sell, default everything |
delphi positions [wallet] |
what a wallet holds and can collect |
delphi collect <address> |
redeem a settled market, or liquidate an expired or failed one |
delphi balance |
your USDC and gas |
delphi watch … |
alerts, see below |
Add --json to any command for machine output, and --network testnet or --network competition-testnet to
leave mainnet.
MCP server: let an agent trade, with limits
Claude Code:
claude mcp add delphi -- uvx --from "delphi-kit[mcp]" delphi-mcp
Claude Desktop, Cursor, or anything else that speaks MCP over stdio:
{
"mcpServers": {
"delphi": {
"command": "uvx",
"args": ["--from", "delphi-kit[mcp]", "delphi-mcp"],
"env": {
"DELPHI_PRIVATE_KEY": "0x...",
"DELPHI_ALLOW_TRADING": "true",
"DELPHI_MAX_TRADE_USD": "2",
"DELPHI_MAX_DAILY_USD": "10"
}
}
}
}
The read tools are list_markets, get_market, quote_buy, quote_sell, get_positions and wallet_status.
The write tools are buy, sell and collect.
Without a key or DELPHI_ALLOW_TRADING=true the server is read-only, and the write tools say so instead of
sending anything. With trading on, every buy is checked first:
| setting | default |
|---|---|
DELPHI_MAX_TRADE_USD |
5 per trade |
DELPHI_MAX_DAILY_USD |
20 per UTC day, kept in a ledger file so a restart doesn't reset it |
DELPHI_MAX_SLIPPAGE |
0.03 |
DELPHI_ALLOWED_MARKETS |
all (comma list of addresses to restrict) |
Use a separate wallet for the agent and only put in what you're willing to lose.
Alerts
Delphi has no notifications or webhooks, so delphi watch polls the chain and tells you about:
- new markets
- moves of 10 points or more (
--move) - markets about to close (
--closing-hours) - markets that close, settle (with the winner), fail or expire
- money your wallet can now collect (
--wallet)
delphi watch --query "bitcoin" --telegram # TELEGRAM_BOT_TOKEN, TELEGRAM_CHAT_ID
delphi watch --wallet 0xYou --webhook https://… # each alert POSTed as JSON
delphi watch --json --once # one pass, JSON lines (for cron)
The first run records a baseline, and alerts start from the second check.
What this does that the official SDK doesn't
@gensyn-ai/gensyn-delphi-sdk 2.1.0 is TypeScript
only. Its mainnet config has the two DPM deployments but not the LMSR one, and LMSR is where most open markets
are (56 of 82 when this was written). LMSR quote functions also return three values where DPM returns one. Full
notes are in docs/contracts.md.
| SDK 2.1.0 | delphi-kit | |
|---|---|---|
| Language | TypeScript | Python |
| Mainnet LMSR markets | no | yes |
| List markets and positions without an API key | no (REST API needs a key) | yes, from chain |
| Keyword search | no (category filter only) | yes |
| Rules-file hash check | no | yes |
| Buy with a dollar budget | no (exact shares) | yes, never over budget |
| Default approval | unlimited | exact amount |
| Agent spending limits | no | yes |
| Alerts | no | yes |
Tests
uv run pytest tests/test_unit.py # offline, about a second
uv run pytest tests/test_fork.py -s # needs Foundry's anvil, about a minute, no real money
The fork tests run a private copy of Gensyn mainnet and put a throwaway wallet through two full lifecycles:
- LMSR: buy with a $3 budget, sell half, jump the clock past the deadline, settle as Delphi's oracle relayer, redeem the winnings.
- DPM: buy, let the market expire unsettled, liquidate.
License
MIT
Metadata
Release files for delphi-kit 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| delphi_kit-0.1.1.tar.gz | 33.7 kB | Without provenance | Details for delphi_kit-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| delphi_kit-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for delphi_kit-0.1.1-py3-none-any.whl |
Total release size: 75.5 kB
Release files / delphi_kit-0.1.1.tar.gz
| Download URL | delphi_kit-0.1.1.tar.gz |
|---|---|
| Size | 33.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f58fed3539be5d4acdda8d2f73d4852e6dde100b86478cde0ea6264f36c1d9ea
|
|
BLAKE2b-256 checksum How to use checksums |
53fa98e7eeeacca11969a12cb1a99d6668760ef90929bf4c6defb7aa8be912c7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.8 {"installer":{"name":"uv","version":"0.13.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / delphi_kit-0.1.1-py3-none-any.whl
| Download URL | delphi_kit-0.1.1-py3-none-any.whl |
|---|---|
| Size | 41.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ef033182a788632ff7f0f8afd100f5470a93dad7a4c7051ebbbcf32b902f341f
|
|
BLAKE2b-256 checksum How to use checksums |
a5deaf966a98f5b5268b2877718f3d01dc8aeae4b48fdaf5ea16e0d9708750f1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.8 {"installer":{"name":"uv","version":"0.13.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for delphi-kit 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.