delphi-kit 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- delphi_kit-0.1.0/PKG-INFO +190 -0
- delphi_kit-0.1.0/README.md +176 -0
- delphi_kit-0.1.0/pyproject.toml +36 -0
- delphi_kit-0.1.0/pyproject.toml.orig +33 -0
- delphi_kit-0.1.0/src/delphi_kit/__init__.py +9 -0
- delphi_kit-0.1.0/src/delphi_kit/abi/DelphiFactory.json +1 -0
- delphi_kit-0.1.0/src/delphi_kit/abi/DpmGateway.json +1 -0
- delphi_kit-0.1.0/src/delphi_kit/abi/DpmGatewayLegacy.json +1 -0
- delphi_kit-0.1.0/src/delphi_kit/abi/LmsrGateway.json +1 -0
- delphi_kit-0.1.0/src/delphi_kit/abi/LmsrMarket.json +1 -0
- delphi_kit-0.1.0/src/delphi_kit/abi/__init__.py +0 -0
- delphi_kit-0.1.0/src/delphi_kit/chain.py +135 -0
- delphi_kit-0.1.0/src/delphi_kit/cli.py +191 -0
- delphi_kit-0.1.0/src/delphi_kit/client.py +483 -0
- delphi_kit-0.1.0/src/delphi_kit/limits.py +93 -0
- delphi_kit-0.1.0/src/delphi_kit/mcp_server.py +180 -0
- delphi_kit-0.1.0/src/delphi_kit/models.py +118 -0
- delphi_kit-0.1.0/src/delphi_kit/networks.py +98 -0
- delphi_kit-0.1.0/src/delphi_kit/py.typed +0 -0
- delphi_kit-0.1.0/src/delphi_kit/search.py +40 -0
- delphi_kit-0.1.0/src/delphi_kit/watch.py +209 -0
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: delphi-kit
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Read and trade Delphi prediction markets from Python and AI agents, with no API key: every market type, quotes, trades, positions, search, alerts and an MCP server.
|
|
5
|
+
Keywords: delphi,gensyn,prediction-markets,mcp,agents,web3
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Requires-Dist: httpx>=0.27
|
|
8
|
+
Requires-Dist: web3>=7
|
|
9
|
+
Requires-Dist: mcp>=2.3 ; extra == 'mcp'
|
|
10
|
+
Requires-Python: >=3.10
|
|
11
|
+
Project-URL: Repository, https://github.com/neromtoobad/delphi-kit
|
|
12
|
+
Provides-Extra: mcp
|
|
13
|
+
Description-Content-Type: text/markdown
|
|
14
|
+
|
|
15
|
+
# delphi-kit
|
|
16
|
+
|
|
17
|
+
Python tools for [Delphi](https://delphi.fyi), the prediction market on the Gensyn chain. It has a library, a
|
|
18
|
+
`delphi` command, an MCP server so AI agents can trade under spending limits, and alerts.
|
|
19
|
+
|
|
20
|
+
It reads straight from the chain, so you need **no API key** to list, search, price or track anything. A wallet
|
|
21
|
+
key is only needed to trade.
|
|
22
|
+
|
|
23
|
+
It covers **every Delphi market on mainnet**: the current LMSR markets and both older parimutuel (DPM)
|
|
24
|
+
generations. That's 1,027 markets as of November 2026.
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
pip install delphi-kit # library + CLI
|
|
28
|
+
pip install "delphi-kit[mcp]" # + MCP server
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Find a market and price a trade
|
|
32
|
+
|
|
33
|
+
```console
|
|
34
|
+
$ delphi search bitcoin --limit 3
|
|
35
|
+
0x44CF6d128e086961b7c0844dE6285c75046d7B7C Dec 25 05:00 $ 27.85 Yes 17% No 83%
|
|
36
|
+
Will Bitcoin exceed $100,000 by Christmas 2026?
|
|
37
|
+
0x662Bba4819098F000d33d1e09Dff5dC3C3a5aa87 Dec 31 00:00 $ 19.11 Yes 33% No 67%
|
|
38
|
+
Will Bitcoin's Coinbase BTC-USD price be above $80,000 at 00:00 UTC on Dec 31, 2026?
|
|
39
|
+
0xc43F7318bf91915dba2A3A02489bdEd2aDC1731f Jan 01 02:00 $ 39.52 Yes 22% No 78%
|
|
40
|
+
Will Bitcoin reach $100k in 2026?
|
|
41
|
+
|
|
42
|
+
$ delphi quote 0x4F5DC6b636c226CeC0C2403f988f24431b9Cc463 Yes --usd 5
|
|
43
|
+
buy 7.7223 Yes shares costs $4.9996 (avg 0.6474); probability 50.4% → 75.3%
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Most Delphi pools hold $10–$50, so a $5 trade can move the price 25 points. Every quote shows the probability
|
|
47
|
+
after your trade so you see that before you pay.
|
|
48
|
+
|
|
49
|
+
`delphi market <address>` prints the rules the AI judge will apply and the sources it will read. It also checks
|
|
50
|
+
that the rules file matches the hash stored on chain.
|
|
51
|
+
|
|
52
|
+
## Library
|
|
53
|
+
|
|
54
|
+
```python
|
|
55
|
+
from delphi_kit import Delphi
|
|
56
|
+
|
|
57
|
+
d = Delphi() # mainnet, read-only
|
|
58
|
+
for m in d.search("election", limit=5):
|
|
59
|
+
print(m.summary())
|
|
60
|
+
|
|
61
|
+
m = d.market("0x4F5DC6b636c226CeC0C2403f988f24431b9Cc463")
|
|
62
|
+
print(m.rules, m.sources, m.metadata_verified)
|
|
63
|
+
|
|
64
|
+
q = d.quote_buy(m, "Yes", usd=2) # shares, average price, probability before/after
|
|
65
|
+
print(q.shares, q.average_price, q.probability_after)
|
|
66
|
+
|
|
67
|
+
d = Delphi(private_key="0x...") # or set DELPHI_PRIVATE_KEY
|
|
68
|
+
t = d.buy(m, "Yes", usd=2, max_slippage=0.02) # approves only what this trade needs
|
|
69
|
+
d.sell(m, "Yes") # everything you hold in that outcome
|
|
70
|
+
|
|
71
|
+
for p in d.positions(): # every market, with what to do next
|
|
72
|
+
print(p.question, p.outcome_label, p.shares, p.value_usd, p.action) # action: redeem | liquidate | None
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
You can pass an address or a `Market` anywhere one is expected, and outcomes take a label (`"Yes"`) or an index.
|
|
76
|
+
Money comes back as USD floats and shares as decimal numbers; every object has `.to_dict()`.
|
|
77
|
+
|
|
78
|
+
## Command line
|
|
79
|
+
|
|
80
|
+
| command | does |
|
|
81
|
+
|---|---|
|
|
82
|
+
| `delphi markets [--status open\|settled\|…\|all]` | list markets with live odds, soonest to close first |
|
|
83
|
+
| `delphi search <words>` | keyword search over questions, outcomes and rules |
|
|
84
|
+
| `delphi market <address>` | one market in full: rules, sources, deadlines, fee, hash check |
|
|
85
|
+
| `delphi quote <address> <outcome> --usd N \| --shares N \| --sell N` | price a trade, send nothing |
|
|
86
|
+
| `delphi buy <address> <outcome> --usd N` | buy (asks you to type `yes` first unless `--yes`) |
|
|
87
|
+
| `delphi sell <address> <outcome> [--shares N]` | sell, default everything |
|
|
88
|
+
| `delphi positions [wallet]` | what a wallet holds and can collect |
|
|
89
|
+
| `delphi collect <address>` | redeem a settled market, or liquidate an expired or failed one |
|
|
90
|
+
| `delphi balance` | your USDC and gas |
|
|
91
|
+
| `delphi watch …` | alerts, see below |
|
|
92
|
+
|
|
93
|
+
Add `--json` to any command for machine output, and `--network testnet` or `--network competition-testnet` to
|
|
94
|
+
leave mainnet.
|
|
95
|
+
|
|
96
|
+
## MCP server: let an agent trade, with limits
|
|
97
|
+
|
|
98
|
+
Claude Code:
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
claude mcp add delphi -- uvx --from "delphi-kit[mcp]" delphi-mcp
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
Claude Desktop, Cursor, or anything else that speaks MCP over stdio:
|
|
105
|
+
|
|
106
|
+
```json
|
|
107
|
+
{
|
|
108
|
+
"mcpServers": {
|
|
109
|
+
"delphi": {
|
|
110
|
+
"command": "uvx",
|
|
111
|
+
"args": ["--from", "delphi-kit[mcp]", "delphi-mcp"],
|
|
112
|
+
"env": {
|
|
113
|
+
"DELPHI_PRIVATE_KEY": "0x...",
|
|
114
|
+
"DELPHI_ALLOW_TRADING": "true",
|
|
115
|
+
"DELPHI_MAX_TRADE_USD": "2",
|
|
116
|
+
"DELPHI_MAX_DAILY_USD": "10"
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
The read tools are `list_markets`, `get_market`, `quote_buy`, `quote_sell`, `get_positions` and `wallet_status`.
|
|
124
|
+
The write tools are `buy`, `sell` and `collect`.
|
|
125
|
+
|
|
126
|
+
Without a key or `DELPHI_ALLOW_TRADING=true` the server is read-only, and the write tools say so instead of
|
|
127
|
+
sending anything. With trading on, every buy is checked first:
|
|
128
|
+
|
|
129
|
+
| setting | default |
|
|
130
|
+
|---|---|
|
|
131
|
+
| `DELPHI_MAX_TRADE_USD` | 5 per trade |
|
|
132
|
+
| `DELPHI_MAX_DAILY_USD` | 20 per UTC day, kept in a ledger file so a restart doesn't reset it |
|
|
133
|
+
| `DELPHI_MAX_SLIPPAGE` | 0.03 |
|
|
134
|
+
| `DELPHI_ALLOWED_MARKETS` | all (comma list of addresses to restrict) |
|
|
135
|
+
|
|
136
|
+
Use a separate wallet for the agent and only put in what you're willing to lose.
|
|
137
|
+
|
|
138
|
+
## Alerts
|
|
139
|
+
|
|
140
|
+
Delphi has no notifications or webhooks, so `delphi watch` polls the chain and tells you about:
|
|
141
|
+
|
|
142
|
+
- new markets
|
|
143
|
+
- moves of 10 points or more (`--move`)
|
|
144
|
+
- markets about to close (`--closing-hours`)
|
|
145
|
+
- markets that close, settle (with the winner), fail or expire
|
|
146
|
+
- money your wallet can now collect (`--wallet`)
|
|
147
|
+
|
|
148
|
+
```bash
|
|
149
|
+
delphi watch --query "bitcoin" --telegram # TELEGRAM_BOT_TOKEN, TELEGRAM_CHAT_ID
|
|
150
|
+
delphi watch --wallet 0xYou --webhook https://… # each alert POSTed as JSON
|
|
151
|
+
delphi watch --json --once # one pass, JSON lines (for cron)
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
The first run records a baseline, and alerts start from the second check.
|
|
155
|
+
|
|
156
|
+
## What this does that the official SDK doesn't
|
|
157
|
+
|
|
158
|
+
[`@gensyn-ai/gensyn-delphi-sdk`](https://www.npmjs.com/package/@gensyn-ai/gensyn-delphi-sdk) 2.1.0 is TypeScript
|
|
159
|
+
only. Its mainnet config has the two DPM deployments but **not the LMSR one**, and LMSR is where most open markets
|
|
160
|
+
are (56 of 82 when this was written). LMSR quote functions also return three values where DPM returns one. Full
|
|
161
|
+
notes are in [docs/contracts.md](docs/contracts.md).
|
|
162
|
+
|
|
163
|
+
| | SDK 2.1.0 | delphi-kit |
|
|
164
|
+
|---|---|---|
|
|
165
|
+
| Language | TypeScript | Python |
|
|
166
|
+
| Mainnet LMSR markets | no | yes |
|
|
167
|
+
| List markets and positions without an API key | no (REST API needs a key) | yes, from chain |
|
|
168
|
+
| Keyword search | no (category filter only) | yes |
|
|
169
|
+
| Rules-file hash check | no | yes |
|
|
170
|
+
| Buy with a dollar budget | no (exact shares) | yes, never over budget |
|
|
171
|
+
| Default approval | unlimited | exact amount |
|
|
172
|
+
| Agent spending limits | no | yes |
|
|
173
|
+
| Alerts | no | yes |
|
|
174
|
+
|
|
175
|
+
## Tests
|
|
176
|
+
|
|
177
|
+
```bash
|
|
178
|
+
uv run pytest tests/test_unit.py # offline, about a second
|
|
179
|
+
uv run pytest tests/test_fork.py -s # needs Foundry's anvil, about a minute, no real money
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
The fork tests run a private copy of Gensyn mainnet and put a throwaway wallet through two full lifecycles:
|
|
183
|
+
|
|
184
|
+
- **LMSR:** buy with a $3 budget, sell half, jump the clock past the deadline, settle as Delphi's oracle relayer,
|
|
185
|
+
redeem the winnings.
|
|
186
|
+
- **DPM:** buy, let the market expire unsettled, liquidate.
|
|
187
|
+
|
|
188
|
+
## License
|
|
189
|
+
|
|
190
|
+
MIT
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
# delphi-kit
|
|
2
|
+
|
|
3
|
+
Python tools for [Delphi](https://delphi.fyi), the prediction market on the Gensyn chain. It has a library, a
|
|
4
|
+
`delphi` command, an MCP server so AI agents can trade under spending limits, and alerts.
|
|
5
|
+
|
|
6
|
+
It reads straight from the chain, so you need **no API key** to list, search, price or track anything. A wallet
|
|
7
|
+
key is only needed to trade.
|
|
8
|
+
|
|
9
|
+
It covers **every Delphi market on mainnet**: the current LMSR markets and both older parimutuel (DPM)
|
|
10
|
+
generations. That's 1,027 markets as of November 2026.
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
pip install delphi-kit # library + CLI
|
|
14
|
+
pip install "delphi-kit[mcp]" # + MCP server
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Find a market and price a trade
|
|
18
|
+
|
|
19
|
+
```console
|
|
20
|
+
$ delphi search bitcoin --limit 3
|
|
21
|
+
0x44CF6d128e086961b7c0844dE6285c75046d7B7C Dec 25 05:00 $ 27.85 Yes 17% No 83%
|
|
22
|
+
Will Bitcoin exceed $100,000 by Christmas 2026?
|
|
23
|
+
0x662Bba4819098F000d33d1e09Dff5dC3C3a5aa87 Dec 31 00:00 $ 19.11 Yes 33% No 67%
|
|
24
|
+
Will Bitcoin's Coinbase BTC-USD price be above $80,000 at 00:00 UTC on Dec 31, 2026?
|
|
25
|
+
0xc43F7318bf91915dba2A3A02489bdEd2aDC1731f Jan 01 02:00 $ 39.52 Yes 22% No 78%
|
|
26
|
+
Will Bitcoin reach $100k in 2026?
|
|
27
|
+
|
|
28
|
+
$ delphi quote 0x4F5DC6b636c226CeC0C2403f988f24431b9Cc463 Yes --usd 5
|
|
29
|
+
buy 7.7223 Yes shares costs $4.9996 (avg 0.6474); probability 50.4% → 75.3%
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Most Delphi pools hold $10–$50, so a $5 trade can move the price 25 points. Every quote shows the probability
|
|
33
|
+
after your trade so you see that before you pay.
|
|
34
|
+
|
|
35
|
+
`delphi market <address>` prints the rules the AI judge will apply and the sources it will read. It also checks
|
|
36
|
+
that the rules file matches the hash stored on chain.
|
|
37
|
+
|
|
38
|
+
## Library
|
|
39
|
+
|
|
40
|
+
```python
|
|
41
|
+
from delphi_kit import Delphi
|
|
42
|
+
|
|
43
|
+
d = Delphi() # mainnet, read-only
|
|
44
|
+
for m in d.search("election", limit=5):
|
|
45
|
+
print(m.summary())
|
|
46
|
+
|
|
47
|
+
m = d.market("0x4F5DC6b636c226CeC0C2403f988f24431b9Cc463")
|
|
48
|
+
print(m.rules, m.sources, m.metadata_verified)
|
|
49
|
+
|
|
50
|
+
q = d.quote_buy(m, "Yes", usd=2) # shares, average price, probability before/after
|
|
51
|
+
print(q.shares, q.average_price, q.probability_after)
|
|
52
|
+
|
|
53
|
+
d = Delphi(private_key="0x...") # or set DELPHI_PRIVATE_KEY
|
|
54
|
+
t = d.buy(m, "Yes", usd=2, max_slippage=0.02) # approves only what this trade needs
|
|
55
|
+
d.sell(m, "Yes") # everything you hold in that outcome
|
|
56
|
+
|
|
57
|
+
for p in d.positions(): # every market, with what to do next
|
|
58
|
+
print(p.question, p.outcome_label, p.shares, p.value_usd, p.action) # action: redeem | liquidate | None
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
You can pass an address or a `Market` anywhere one is expected, and outcomes take a label (`"Yes"`) or an index.
|
|
62
|
+
Money comes back as USD floats and shares as decimal numbers; every object has `.to_dict()`.
|
|
63
|
+
|
|
64
|
+
## Command line
|
|
65
|
+
|
|
66
|
+
| command | does |
|
|
67
|
+
|---|---|
|
|
68
|
+
| `delphi markets [--status open\|settled\|…\|all]` | list markets with live odds, soonest to close first |
|
|
69
|
+
| `delphi search <words>` | keyword search over questions, outcomes and rules |
|
|
70
|
+
| `delphi market <address>` | one market in full: rules, sources, deadlines, fee, hash check |
|
|
71
|
+
| `delphi quote <address> <outcome> --usd N \| --shares N \| --sell N` | price a trade, send nothing |
|
|
72
|
+
| `delphi buy <address> <outcome> --usd N` | buy (asks you to type `yes` first unless `--yes`) |
|
|
73
|
+
| `delphi sell <address> <outcome> [--shares N]` | sell, default everything |
|
|
74
|
+
| `delphi positions [wallet]` | what a wallet holds and can collect |
|
|
75
|
+
| `delphi collect <address>` | redeem a settled market, or liquidate an expired or failed one |
|
|
76
|
+
| `delphi balance` | your USDC and gas |
|
|
77
|
+
| `delphi watch …` | alerts, see below |
|
|
78
|
+
|
|
79
|
+
Add `--json` to any command for machine output, and `--network testnet` or `--network competition-testnet` to
|
|
80
|
+
leave mainnet.
|
|
81
|
+
|
|
82
|
+
## MCP server: let an agent trade, with limits
|
|
83
|
+
|
|
84
|
+
Claude Code:
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
claude mcp add delphi -- uvx --from "delphi-kit[mcp]" delphi-mcp
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Claude Desktop, Cursor, or anything else that speaks MCP over stdio:
|
|
91
|
+
|
|
92
|
+
```json
|
|
93
|
+
{
|
|
94
|
+
"mcpServers": {
|
|
95
|
+
"delphi": {
|
|
96
|
+
"command": "uvx",
|
|
97
|
+
"args": ["--from", "delphi-kit[mcp]", "delphi-mcp"],
|
|
98
|
+
"env": {
|
|
99
|
+
"DELPHI_PRIVATE_KEY": "0x...",
|
|
100
|
+
"DELPHI_ALLOW_TRADING": "true",
|
|
101
|
+
"DELPHI_MAX_TRADE_USD": "2",
|
|
102
|
+
"DELPHI_MAX_DAILY_USD": "10"
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
The read tools are `list_markets`, `get_market`, `quote_buy`, `quote_sell`, `get_positions` and `wallet_status`.
|
|
110
|
+
The write tools are `buy`, `sell` and `collect`.
|
|
111
|
+
|
|
112
|
+
Without a key or `DELPHI_ALLOW_TRADING=true` the server is read-only, and the write tools say so instead of
|
|
113
|
+
sending anything. With trading on, every buy is checked first:
|
|
114
|
+
|
|
115
|
+
| setting | default |
|
|
116
|
+
|---|---|
|
|
117
|
+
| `DELPHI_MAX_TRADE_USD` | 5 per trade |
|
|
118
|
+
| `DELPHI_MAX_DAILY_USD` | 20 per UTC day, kept in a ledger file so a restart doesn't reset it |
|
|
119
|
+
| `DELPHI_MAX_SLIPPAGE` | 0.03 |
|
|
120
|
+
| `DELPHI_ALLOWED_MARKETS` | all (comma list of addresses to restrict) |
|
|
121
|
+
|
|
122
|
+
Use a separate wallet for the agent and only put in what you're willing to lose.
|
|
123
|
+
|
|
124
|
+
## Alerts
|
|
125
|
+
|
|
126
|
+
Delphi has no notifications or webhooks, so `delphi watch` polls the chain and tells you about:
|
|
127
|
+
|
|
128
|
+
- new markets
|
|
129
|
+
- moves of 10 points or more (`--move`)
|
|
130
|
+
- markets about to close (`--closing-hours`)
|
|
131
|
+
- markets that close, settle (with the winner), fail or expire
|
|
132
|
+
- money your wallet can now collect (`--wallet`)
|
|
133
|
+
|
|
134
|
+
```bash
|
|
135
|
+
delphi watch --query "bitcoin" --telegram # TELEGRAM_BOT_TOKEN, TELEGRAM_CHAT_ID
|
|
136
|
+
delphi watch --wallet 0xYou --webhook https://… # each alert POSTed as JSON
|
|
137
|
+
delphi watch --json --once # one pass, JSON lines (for cron)
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
The first run records a baseline, and alerts start from the second check.
|
|
141
|
+
|
|
142
|
+
## What this does that the official SDK doesn't
|
|
143
|
+
|
|
144
|
+
[`@gensyn-ai/gensyn-delphi-sdk`](https://www.npmjs.com/package/@gensyn-ai/gensyn-delphi-sdk) 2.1.0 is TypeScript
|
|
145
|
+
only. Its mainnet config has the two DPM deployments but **not the LMSR one**, and LMSR is where most open markets
|
|
146
|
+
are (56 of 82 when this was written). LMSR quote functions also return three values where DPM returns one. Full
|
|
147
|
+
notes are in [docs/contracts.md](docs/contracts.md).
|
|
148
|
+
|
|
149
|
+
| | SDK 2.1.0 | delphi-kit |
|
|
150
|
+
|---|---|---|
|
|
151
|
+
| Language | TypeScript | Python |
|
|
152
|
+
| Mainnet LMSR markets | no | yes |
|
|
153
|
+
| List markets and positions without an API key | no (REST API needs a key) | yes, from chain |
|
|
154
|
+
| Keyword search | no (category filter only) | yes |
|
|
155
|
+
| Rules-file hash check | no | yes |
|
|
156
|
+
| Buy with a dollar budget | no (exact shares) | yes, never over budget |
|
|
157
|
+
| Default approval | unlimited | exact amount |
|
|
158
|
+
| Agent spending limits | no | yes |
|
|
159
|
+
| Alerts | no | yes |
|
|
160
|
+
|
|
161
|
+
## Tests
|
|
162
|
+
|
|
163
|
+
```bash
|
|
164
|
+
uv run pytest tests/test_unit.py # offline, about a second
|
|
165
|
+
uv run pytest tests/test_fork.py -s # needs Foundry's anvil, about a minute, no real money
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
The fork tests run a private copy of Gensyn mainnet and put a throwaway wallet through two full lifecycles:
|
|
169
|
+
|
|
170
|
+
- **LMSR:** buy with a $3 budget, sell half, jump the clock past the deadline, settle as Delphi's oracle relayer,
|
|
171
|
+
redeem the winnings.
|
|
172
|
+
- **DPM:** buy, let the market expire unsettled, liquidate.
|
|
173
|
+
|
|
174
|
+
## License
|
|
175
|
+
|
|
176
|
+
MIT
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "delphi-kit"
|
|
3
|
+
version = "0.1.0"
|
|
4
|
+
description = "Read and trade Delphi prediction markets from Python and AI agents, with no API key: every market type, quotes, trades, positions, search, alerts and an MCP server."
|
|
5
|
+
requires-python = ">=3.10"
|
|
6
|
+
readme = "README.md"
|
|
7
|
+
license = "MIT"
|
|
8
|
+
keywords = [
|
|
9
|
+
"delphi",
|
|
10
|
+
"gensyn",
|
|
11
|
+
"prediction-markets",
|
|
12
|
+
"mcp",
|
|
13
|
+
"agents",
|
|
14
|
+
"web3",
|
|
15
|
+
]
|
|
16
|
+
dependencies = [
|
|
17
|
+
"httpx>=0.27",
|
|
18
|
+
"web3>=7",
|
|
19
|
+
]
|
|
20
|
+
|
|
21
|
+
[project.optional-dependencies]
|
|
22
|
+
mcp = ["mcp>=2.3"]
|
|
23
|
+
|
|
24
|
+
[project.scripts]
|
|
25
|
+
delphi = "delphi_kit.cli:main"
|
|
26
|
+
delphi-mcp = "delphi_kit.mcp_server:main"
|
|
27
|
+
|
|
28
|
+
[project.urls]
|
|
29
|
+
Repository = "https://github.com/neromtoobad/delphi-kit"
|
|
30
|
+
|
|
31
|
+
[build-system]
|
|
32
|
+
requires = ["uv_build>=0.12.20,<0.13.0"]
|
|
33
|
+
build-backend = "uv_build"
|
|
34
|
+
|
|
35
|
+
[dependency-groups]
|
|
36
|
+
dev = ["pytest>=9.2.0"]
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "delphi-kit"
|
|
3
|
+
version = "0.1.0"
|
|
4
|
+
description = "Read and trade Delphi prediction markets from Python and AI agents, with no API key: every market type, quotes, trades, positions, search, alerts and an MCP server."
|
|
5
|
+
requires-python = ">=3.10"
|
|
6
|
+
readme = "README.md"
|
|
7
|
+
license = "MIT"
|
|
8
|
+
keywords = ["delphi", "gensyn", "prediction-markets", "mcp", "agents", "web3"]
|
|
9
|
+
dependencies = [
|
|
10
|
+
"httpx>=0.27",
|
|
11
|
+
"web3>=7",
|
|
12
|
+
]
|
|
13
|
+
|
|
14
|
+
[project.optional-dependencies]
|
|
15
|
+
mcp = [
|
|
16
|
+
"mcp>=2.3",
|
|
17
|
+
]
|
|
18
|
+
|
|
19
|
+
[build-system]
|
|
20
|
+
requires = ["uv_build>=0.12.20,<0.13.0"]
|
|
21
|
+
build-backend = "uv_build"
|
|
22
|
+
|
|
23
|
+
[dependency-groups]
|
|
24
|
+
dev = [
|
|
25
|
+
"pytest>=9.2.0",
|
|
26
|
+
]
|
|
27
|
+
|
|
28
|
+
[project.scripts]
|
|
29
|
+
delphi = "delphi_kit.cli:main"
|
|
30
|
+
delphi-mcp = "delphi_kit.mcp_server:main"
|
|
31
|
+
|
|
32
|
+
[project.urls]
|
|
33
|
+
Repository = "https://github.com/neromtoobad/delphi-kit"
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"""delphi-kit: read and trade Delphi prediction markets from Python, with no API key."""
|
|
2
|
+
|
|
3
|
+
from .client import Delphi, DelphiError, InsufficientFunds
|
|
4
|
+
from .models import Market, Position, Quote, Trade
|
|
5
|
+
from .networks import NETWORKS, Deployment, Network
|
|
6
|
+
|
|
7
|
+
__all__ = ["Delphi", "DelphiError", "InsufficientFunds", "Market", "Position", "Quote", "Trade",
|
|
8
|
+
"NETWORKS", "Network", "Deployment"]
|
|
9
|
+
__version__ = "0.1.0"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
[{"inputs":[{"internalType":"address","name":"implementation","type":"address"},{"internalType":"uint256","name":"marketCreationFee","type":"uint256"},{"internalType":"address","name":"marketCreationFeeRecipient","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"FailedDeployment","type":"error"},{"inputs":[{"internalType":"uint256","name":"firstIdx","type":"uint256"},{"internalType":"uint256","name":"lastIdx","type":"uint256"}],"name":"FirstIdxExceedsLastIdx","type":"error"},{"inputs":[{"internalType":"address","name":"implementation","type":"address"}],"name":"ImplementationIsNotAContract","type":"error"},{"inputs":[],"name":"ImplementationIsZeroAddress","type":"error"},{"inputs":[{"internalType":"uint256","name":"balance","type":"uint256"},{"internalType":"uint256","name":"needed","type":"uint256"}],"name":"InsufficientBalance","type":"error"},{"inputs":[{"internalType":"uint256","name":"lastIdx","type":"uint256"},{"internalType":"uint256","name":"marketCount","type":"uint256"}],"name":"LastIdxOutOfBounds","type":"error"},{"inputs":[{"internalType":"uint256","name":"provided","type":"uint256"},{"internalType":"uint256","name":"maximum","type":"uint256"}],"name":"MarketCreationFeeIsTooHigh","type":"error"},{"inputs":[{"internalType":"uint256","name":"provided","type":"uint256"},{"internalType":"uint256","name":"minimum","type":"uint256"}],"name":"MarketCreationFeeIsTooLow","type":"error"},{"inputs":[],"name":"MarketCreationFeeRecipientIsZeroAddress","type":"error"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"SafeERC20FailedOperation","type":"error"},{"inputs":[{"internalType":"uint256","name":"settlementFees","type":"uint256"},{"internalType":"uint256","name":"marketCreationFee","type":"uint256"}],"name":"SettlementFeesExceedMarketCreationFee","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"deployer","type":"address"},{"indexed":true,"internalType":"address","name":"implementation","type":"address"},{"indexed":false,"internalType":"address","name":"newMarketProxy","type":"address"},{"components":[{"internalType":"uint256","name":"outcomeCount","type":"uint256"},{"internalType":"uint256","name":"b","type":"uint256"},{"internalType":"uint256","name":"tradingFee","type":"uint256"},{"internalType":"uint256","name":"tradingDeadline","type":"uint256"},{"internalType":"uint256","name":"earliestResolveTime","type":"uint256"},{"internalType":"uint256","name":"settlementDeadline","type":"uint256"}],"indexed":false,"internalType":"struct ILmsrMarketTypes.MarketConfig","name":"newMarketConfig","type":"tuple"},{"components":[{"internalType":"string","name":"uri","type":"string"},{"internalType":"bytes32","name":"uriContentHash","type":"bytes32"}],"indexed":false,"internalType":"struct IDelphiMarket.VerifiableUri","name":"newMarketMetadata","type":"tuple"}],"name":"NewMarketProxy","type":"event"},{"inputs":[],"name":"IMPLEMENTATION","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MARKET_CREATION_FEE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MARKET_CREATION_FEE_RECIPIENT","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"SETTLEMENT_FEES","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TOKEN","outputs":[{"internalType":"contract IERC20Metadata","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"initialDeposit_","type":"uint256"},{"components":[{"internalType":"uint256","name":"outcomeCount","type":"uint256"},{"internalType":"uint256","name":"b","type":"uint256"},{"internalType":"uint256","name":"tradingFee","type":"uint256"},{"internalType":"uint256","name":"tradingDeadline","type":"uint256"},{"internalType":"uint256","name":"earliestResolveTime","type":"uint256"},{"internalType":"uint256","name":"settlementDeadline","type":"uint256"}],"internalType":"struct ILmsrMarketTypes.MarketConfig","name":"newMarketConfig_","type":"tuple"},{"components":[{"internalType":"string","name":"uri","type":"string"},{"internalType":"bytes32","name":"uriContentHash","type":"bytes32"}],"internalType":"struct IDelphiMarket.VerifiableUri","name":"newMarketMetadata_","type":"tuple"}],"name":"deployNewMarketProxy","outputs":[{"internalType":"address","name":"newMarketProxy","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"firstIdx","type":"uint256"},{"internalType":"uint256","name":"lastIdx","type":"uint256"}],"name":"getMarketProxies","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTotalMarketProxiesCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"marketProxies","type":"address[]"}],"name":"marketProxiesExist","outputs":[{"internalType":"bool[]","name":"res","type":"bool[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"marketProxy","type":"address"}],"name":"marketProxyExists","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"}]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
[{"inputs":[{"internalType":"contract IERC20Metadata","name":"token_","type":"address"},{"internalType":"address","name":"owner_","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"uint256","name":"allowance","type":"uint256"},{"internalType":"uint256","name":"required","type":"uint256"}],"name":"AllowanceTooLow","type":"error"},{"inputs":[],"name":"BuyTooSmall","type":"error"},{"inputs":[{"internalType":"address","name":"delphiFactory","type":"address"}],"name":"DelphiFactoryIsNotContract","type":"error"},{"inputs":[],"name":"DelphiFactoryIsZeroAddress","type":"error"},{"inputs":[],"name":"GatewayNotInitialized","type":"error"},{"inputs":[],"name":"GrossTokensOutNotPositive","type":"error"},{"inputs":[{"internalType":"address","name":"initializer","type":"address"},{"internalType":"address","name":"deployer","type":"address"}],"name":"InitializerNotDeployer","type":"error"},{"inputs":[],"name":"InvalidInitialization","type":"error"},{"inputs":[],"name":"MarketNotOpen","type":"error"},{"inputs":[{"internalType":"address","name":"marketProxy","type":"address"}],"name":"MarketProxyNotDeployedByFactory","type":"error"},{"inputs":[],"name":"NotInitializing","type":"error"},{"inputs":[{"internalType":"address","name":"caller","type":"address"}],"name":"NotOracleRelayer","type":"error"},{"inputs":[],"name":"OracleRelayerNotSet","type":"error"},{"inputs":[{"internalType":"uint256","name":"newSupply","type":"uint256"},{"internalType":"uint256","name":"minDelta","type":"uint256"}],"name":"OutcomeSupplyBelowMinDelta","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","type":"error"},{"inputs":[],"name":"SellOverlap","type":"error"},{"inputs":[],"name":"SellTooSmall","type":"error"},{"inputs":[{"internalType":"address","name":"marketProxy","type":"address"}],"name":"SettlementAlreadyLocked","type":"error"},{"inputs":[{"internalType":"address","name":"marketProxy","type":"address"}],"name":"SettlementNotLocked","type":"error"},{"inputs":[{"internalType":"uint256","name":"sharesIn","type":"uint256"},{"internalType":"uint256","name":"minDelta","type":"uint256"}],"name":"SharesInBelowMinDelta","type":"error"},{"inputs":[{"internalType":"uint256","name":"sharesIn","type":"uint256"},{"internalType":"uint256","name":"supply","type":"uint256"}],"name":"SharesInExceedSupply","type":"error"},{"inputs":[{"internalType":"uint256","name":"sharesOut","type":"uint256"},{"internalType":"uint256","name":"minDelta","type":"uint256"}],"name":"SharesOutBelowMinDelta","type":"error"},{"inputs":[],"name":"SqrtOverlap","type":"error"},{"inputs":[{"internalType":"uint8","name":"decimals","type":"uint8"}],"name":"TokenDecimalsTooHigh","type":"error"},{"inputs":[{"internalType":"uint8","name":"decimals","type":"uint8"}],"name":"TokenDecimalsTooLow","type":"error"},{"inputs":[{"internalType":"uint256","name":"tokensIn","type":"uint256"},{"internalType":"uint256","name":"minTokensIn","type":"uint256"}],"name":"TokensInBelowMin","type":"error"},{"inputs":[{"internalType":"uint256","name":"tokensIn","type":"uint256"},{"internalType":"uint256","name":"maxTokensIn","type":"uint256"}],"name":"TokensInExceedsMax","type":"error"},{"inputs":[{"internalType":"uint256","name":"tokensOut","type":"uint256"},{"internalType":"uint256","name":"minTokensOut","type":"uint256"}],"name":"TokensOutBelowMin","type":"error"},{"inputs":[],"name":"ZeroNetTokensIn","type":"error"},{"inputs":[],"name":"ZeroOracleRelayerAddress","type":"error"},{"inputs":[],"name":"ZeroSharesIn","type":"error"},{"inputs":[],"name":"ZeroSharesOut","type":"error"},{"inputs":[],"name":"ZeroTokensIn","type":"error"},{"inputs":[],"name":"ZeroTokensOut","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IDynamicParimutuelMarket","name":"marketProxy","type":"address"},{"indexed":true,"internalType":"address","name":"buyer","type":"address"},{"indexed":true,"internalType":"uint256","name":"outcomeIdx","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"tokensIn","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"sharesOut","type":"uint256"}],"name":"GatewayBuy","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IDynamicParimutuelMarket","name":"marketProxy","type":"address"},{"indexed":true,"internalType":"address","name":"liquidator","type":"address"},{"indexed":false,"internalType":"uint256[]","name":"outcomeIndices","type":"uint256[]"},{"indexed":false,"internalType":"uint256[]","name":"sharesIn","type":"uint256[]"},{"indexed":false,"internalType":"uint256","name":"totalTokensOut","type":"uint256"}],"name":"GatewayLiquidation","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"marketProxy","type":"address"}],"name":"GatewayMarketFailed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"marketProxy","type":"address"},{"indexed":false,"internalType":"uint256","name":"winningOutcomeIdx","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"marketCreatorReward","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"refund","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"marketCreatorTradingFeesCut","type":"uint256"}],"name":"GatewayMarketSettled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IDynamicParimutuelMarket","name":"marketProxy","type":"address"},{"indexed":true,"internalType":"address","name":"redeemer","type":"address"},{"indexed":false,"internalType":"uint256","name":"sharesIn","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"tokensOut","type":"uint256"}],"name":"GatewayRedemption","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IDynamicParimutuelMarket","name":"marketProxy","type":"address"},{"indexed":true,"internalType":"address","name":"seller","type":"address"},{"indexed":true,"internalType":"uint256","name":"outcomeIdx","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"sharesIn","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"tokensOut","type":"uint256"}],"name":"GatewaySell","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint64","name":"version","type":"uint64"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"marketProxy","type":"address"},{"indexed":true,"internalType":"address","name":"keeper","type":"address"}],"name":"MarketResolutionRequested","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousRelayer","type":"address"},{"indexed":true,"internalType":"address","name":"newRelayer","type":"address"}],"name":"OracleRelayerSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferStarted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[],"name":"MIN_SHARES_DELTA","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MIN_TOKENS_DELTA","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TOKEN","outputs":[{"internalType":"contract IERC20Metadata","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TOKEN_DECIMAL_SCALER","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"acceptOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IDynamicParimutuelMarket","name":"marketProxy","type":"address"},{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IDynamicParimutuelMarket","name":"marketProxy","type":"address"},{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"outcomeIdx","type":"uint256"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IDynamicParimutuelMarket","name":"marketProxy","type":"address"},{"internalType":"address[]","name":"owners","type":"address[]"},{"internalType":"uint256[]","name":"outcomeIndices","type":"uint256[]"}],"name":"batchBalanceOf","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IDynamicParimutuelMarket","name":"marketProxy","type":"address"},{"internalType":"uint256","name":"outcomeIdx","type":"uint256"},{"internalType":"uint256","name":"sharesOut","type":"uint256"},{"internalType":"uint256","name":"maxTokensIn","type":"uint256"}],"name":"buyExactOut","outputs":[{"internalType":"uint256","name":"tokensIn","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IDynamicParimutuelMarket","name":"marketProxy","type":"address"},{"internalType":"uint256","name":"outcomeIdx","type":"uint256"},{"internalType":"uint256","name":"sharesOut","type":"uint256"},{"internalType":"uint256","name":"maxTokensIn","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"buyExactOutWithPermit","outputs":[{"internalType":"uint256","name":"tokensIn","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"initialPool","type":"uint256"},{"internalType":"uint256","name":"outcomeCount","type":"uint256"}],"name":"calculateInitialDepositAndRefund","outputs":[{"internalType":"uint256","name":"initialDeposit","type":"uint256"},{"internalType":"uint256","name":"refund","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"initialDeposit","type":"uint256"},{"internalType":"uint256","name":"outcomeCount","type":"uint256"}],"name":"calculateInitialPoolAndRefund","outputs":[{"internalType":"uint256","name":"initialPool","type":"uint256"},{"internalType":"uint256","name":"refund","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"delphiFactory","outputs":[{"internalType":"contract IDelphiFactory","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"marketProxy","type":"address"}],"name":"failMarket","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IDynamicParimutuelMarket","name":"marketProxy","type":"address"}],"name":"getMarket","outputs":[{"components":[{"components":[{"internalType":"uint256","name":"outcomeCount","type":"uint256"},{"internalType":"uint256","name":"k","type":"uint256"},{"internalType":"uint256","name":"tradingFee","type":"uint256"},{"internalType":"uint256","name":"tradingDeadline","type":"uint256"},{"internalType":"uint256","name":"settlementDeadline","type":"uint256"}],"internalType":"struct IDynamicParimutuelMarketTypes.MarketConfig","name":"config","type":"tuple"},{"internalType":"uint256","name":"initialPool","type":"uint256"},{"internalType":"uint256","name":"pool","type":"uint256"},{"internalType":"uint256","name":"tradingFees","type":"uint256"},{"internalType":"uint256","name":"refund","type":"uint256"},{"internalType":"uint256","name":"sumTerm36","type":"uint256"},{"internalType":"uint256","name":"winningOutcomeIdx","type":"uint256"}],"internalType":"struct IDynamicParimutuelMarketTypes.Market","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IDelphiFactory","name":"delphiFactory_","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IDynamicParimutuelMarket","name":"marketProxy","type":"address"},{"internalType":"address","name":"operator","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"isOperator","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IDynamicParimutuelMarket","name":"marketProxy","type":"address"},{"internalType":"uint256[]","name":"outcomeIndices","type":"uint256[]"}],"name":"liquidate","outputs":[{"internalType":"uint256[]","name":"sharesIn","type":"uint256[]"},{"internalType":"uint256","name":"totalTokensOut","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IDynamicParimutuelMarket","name":"marketProxy","type":"address"}],"name":"liquidateMarketCreationShares","outputs":[{"internalType":"uint256","name":"_totalTokensOut","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IDynamicParimutuelMarket","name":"marketProxy","type":"address"}],"name":"marketCreationSharesLiquidated","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IDynamicParimutuelMarket","name":"marketProxy","type":"address"}],"name":"marketCreator","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IDynamicParimutuelMarket","name":"marketProxy","type":"address"}],"name":"marketCreatorSharesPerOutcome","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IDynamicParimutuelMarket","name":"marketProxy","type":"address"}],"name":"marketCreatorTotalSharesLiquidationValue","outputs":[{"internalType":"uint256","name":"tokensOut","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IDynamicParimutuelMarket","name":"marketProxy","type":"address"},{"internalType":"uint256","name":"outcomeIdx","type":"uint256"}],"name":"marketCreatorWinningSharesSettlementValue","outputs":[{"internalType":"uint256","name":"tokensOut","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IDynamicParimutuelMarket","name":"marketProxy","type":"address"}],"name":"marketMetadata","outputs":[{"components":[{"internalType":"string","name":"uri","type":"string"},{"internalType":"bytes32","name":"uriContentHash","type":"bytes32"}],"internalType":"struct IDelphiMarket.VerifiableUri","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IDynamicParimutuelMarket","name":"marketProxy","type":"address"}],"name":"marketStatus","outputs":[{"internalType":"enum IDynamicParimutuelMarketTypes.MarketStatus","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IDynamicParimutuelMarket","name":"marketProxy","type":"address"}],"name":"maxInitialDeposit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IDynamicParimutuelMarket","name":"marketProxy","type":"address"}],"name":"maxK","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IDynamicParimutuelMarket","name":"marketProxy","type":"address"}],"name":"maxOutcomeCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IDynamicParimutuelMarket","name":"marketProxy","type":"address"}],"name":"maxSettlementWindow","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IDynamicParimutuelMarket","name":"marketProxy","type":"address"}],"name":"maxTradingFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IDynamicParimutuelMarket","name":"marketProxy","type":"address"}],"name":"maxTradingWindow","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IDynamicParimutuelMarket","name":"marketProxy","type":"address"}],"name":"minInitialDeposit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IDynamicParimutuelMarket","name":"marketProxy","type":"address"}],"name":"minK","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IDynamicParimutuelMarket","name":"marketProxy","type":"address"}],"name":"minOutcomeCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IDynamicParimutuelMarket","name":"marketProxy","type":"address"}],"name":"minSettlementWindow","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IDynamicParimutuelMarket","name":"marketProxy","type":"address"}],"name":"minTradingFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IDynamicParimutuelMarket","name":"marketProxy","type":"address"}],"name":"minTradingWindow","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"oracleRelayer","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IDynamicParimutuelMarket","name":"marketProxy","type":"address"}],"name":"outcomeSuppliesSum","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IDynamicParimutuelMarket","name":"marketProxy","type":"address"},{"internalType":"uint256","name":"outcomeIdx","type":"uint256"},{"internalType":"uint256","name":"sharesOut","type":"uint256"}],"name":"quoteBuyExactOut","outputs":[{"internalType":"uint256","name":"tokensIn","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IDynamicParimutuelMarket","name":"marketProxy","type":"address"},{"internalType":"uint256","name":"outcomeIdx","type":"uint256"},{"internalType":"uint256","name":"sharesIn","type":"uint256"}],"name":"quoteSellExactIn","outputs":[{"internalType":"uint256","name":"tokensOut","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IDynamicParimutuelMarket","name":"marketProxy","type":"address"}],"name":"redeem","outputs":[{"internalType":"uint256","name":"sharesIn","type":"uint256"},{"internalType":"uint256","name":"tokensOut","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"marketProxy","type":"address"}],"name":"resolveMarket","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IDynamicParimutuelMarket","name":"marketProxy","type":"address"},{"internalType":"uint256","name":"outcomeIdx","type":"uint256"},{"internalType":"uint256","name":"sharesIn","type":"uint256"},{"internalType":"uint256","name":"minTokensOut","type":"uint256"}],"name":"sellExactIn","outputs":[{"internalType":"uint256","name":"tokensOut","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"oracleRelayer_","type":"address"}],"name":"setOracleRelayer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"marketProxy","type":"address"},{"internalType":"uint256","name":"winningOutcomeIdx","type":"uint256"},{"internalType":"address","name":"oracleFeeRecipient","type":"address"}],"name":"settleMarket","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"marketProxy","type":"address"}],"name":"settlementLocked","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IDynamicParimutuelMarket","name":"marketProxy","type":"address"},{"internalType":"uint256[]","name":"outcomeIndices","type":"uint256[]"}],"name":"spotImpliedProbabilities","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IDynamicParimutuelMarket","name":"marketProxy","type":"address"},{"internalType":"uint256","name":"outcomeIdx","type":"uint256"}],"name":"spotImpliedProbability","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IDynamicParimutuelMarket","name":"marketProxy","type":"address"},{"internalType":"uint256","name":"outcomeIdx","type":"uint256"}],"name":"spotPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IDynamicParimutuelMarket","name":"marketProxy","type":"address"},{"internalType":"uint256[]","name":"outcomeIndices","type":"uint256[]"}],"name":"spotPrices","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IDynamicParimutuelMarket","name":"marketProxy","type":"address"},{"internalType":"uint256[]","name":"outcomeIndices","type":"uint256[]"}],"name":"totalSupplies","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IDynamicParimutuelMarket","name":"marketProxy","type":"address"},{"internalType":"uint256","name":"outcomeIdx","type":"uint256"}],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]
|