investing 0.1.146 → 0.1.147
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.
- package/README.md +64 -119
- package/dist/{archiver-web.es-B69gABHP.js → archiver-web.es-1hOOOgcK.js} +1 -1
- package/dist/{archiver-web.es-fg4bLLZa.cjs → archiver-web.es-CaGT2xEQ.cjs} +1 -1
- package/dist/db/index.d.ts +17 -0
- package/dist/db/index.d.ts.map +1 -1
- package/dist/db/schema.d.ts +17 -0
- package/dist/db/schema.d.ts.map +1 -1
- package/dist/index-BDctGCHy.js +15 -0
- package/dist/index-C2kLUUjU.cjs +13 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/prediction-markets/agents/bookmaker-agent.d.ts.map +1 -0
- package/dist/prediction-markets/agents/event-analysis-agent.d.ts.map +1 -0
- package/dist/{predictos → prediction-markets}/agents/index.d.ts +5 -1
- package/dist/prediction-markets/agents/index.d.ts.map +1 -0
- package/dist/prediction-markets/agents/kalshi-momentum-agent.d.ts +4 -0
- package/dist/prediction-markets/agents/kalshi-momentum-agent.d.ts.map +1 -0
- package/dist/prediction-markets/agents/mapper-agent.d.ts.map +1 -0
- package/dist/{predictos → prediction-markets}/agents/polyfactual-research.d.ts +1 -1
- package/dist/prediction-markets/agents/polyfactual-research.d.ts.map +1 -0
- package/dist/prediction-markets/agents/polymarket-position-tracker.d.ts.map +1 -0
- package/dist/{predictos → prediction-markets}/agents/polymarket-put-order.d.ts +1 -1
- package/dist/prediction-markets/agents/polymarket-put-order.d.ts.map +1 -0
- package/dist/prediction-markets/agents/polymarket-updown-15-limit-order-bot.d.ts.map +1 -0
- package/dist/prediction-markets/agents/x402-seller.d.ts.map +1 -0
- package/dist/prediction-markets/ai/callBlockRun.d.ts.map +1 -0
- package/dist/prediction-markets/ai/callGrok.d.ts.map +1 -0
- package/dist/prediction-markets/ai/callOpenAI.d.ts.map +1 -0
- package/dist/prediction-markets/ai/http.d.ts.map +1 -0
- package/dist/{predictos → prediction-markets}/ai/index.d.ts +1 -1
- package/dist/prediction-markets/ai/index.d.ts.map +1 -0
- package/dist/prediction-markets/ai/prompts/analyzeEventMarkets.d.ts.map +1 -0
- package/dist/prediction-markets/ai/prompts/arbitrageAnalysis.d.ts.map +1 -0
- package/dist/prediction-markets/ai/prompts/bookmakerAnalysis.d.ts.map +1 -0
- package/dist/prediction-markets/ai/prompts/searchQueryGenerator.d.ts.map +1 -0
- package/dist/prediction-markets/ai/types.d.ts.map +1 -0
- package/dist/prediction-markets/arbitrage.d.ts.map +1 -0
- package/dist/{predictos → prediction-markets}/clients/polyfactual.d.ts +1 -1
- package/dist/prediction-markets/clients/polyfactual.d.ts.map +1 -0
- package/dist/{predictos → prediction-markets}/clients/polymarket.d.ts +1 -1
- package/dist/prediction-markets/clients/polymarket.d.ts.map +1 -0
- package/dist/{predictos → prediction-markets}/clients/x402.d.ts +1 -1
- package/dist/prediction-markets/clients/x402.d.ts.map +1 -0
- package/dist/{predictos → prediction-markets}/data/kalshi.d.ts +1 -1
- package/dist/prediction-markets/data/kalshi.d.ts.map +1 -0
- package/dist/{predictos → prediction-markets}/data/polymarket.d.ts +1 -1
- package/dist/prediction-markets/data/polymarket.d.ts.map +1 -0
- package/dist/prediction-markets/events.d.ts.map +1 -0
- package/dist/prediction-markets/execution/paper.d.ts +18 -0
- package/dist/prediction-markets/execution/paper.d.ts.map +1 -0
- package/dist/{predictos → prediction-markets}/index.d.ts +7 -5
- package/dist/prediction-markets/index.d.ts.map +1 -0
- package/dist/prediction-markets/strategies/kalshi-momentum.d.ts +12 -0
- package/dist/prediction-markets/strategies/kalshi-momentum.d.ts.map +1 -0
- package/dist/{predictos → prediction-markets}/types.d.ts +118 -2
- package/dist/prediction-markets/types.d.ts.map +1 -0
- package/dist/stocks/index.d.ts +0 -1
- package/dist/stocks/index.d.ts.map +1 -1
- package/dist/stocks/quote-cache-service.d.ts +11 -2
- package/dist/stocks/quote-cache-service.d.ts.map +1 -1
- package/dist/stocks/unified-quote-service.d.ts +15 -6
- package/dist/stocks/unified-quote-service.d.ts.map +1 -1
- package/package.json +15 -49
- package/dist/bookmakerAnalysis-Bfo1zUVm.js +0 -1
- package/dist/bookmakerAnalysis-CHn1W8uX.cjs +0 -1
- package/dist/callGrok-D0D7zBHK.js +0 -1
- package/dist/callGrok-DWO719mN.cjs +0 -1
- package/dist/events-BJOyGWeU.cjs +0 -1
- package/dist/events-OvBb8rgy.js +0 -1
- package/dist/index-D7fsk2gy.js +0 -15
- package/dist/index-_V1Ql5Es.cjs +0 -13
- package/dist/polymarket-updown-15-limit-order-bot-DCC8HE9Z.cjs +0 -1
- package/dist/polymarket-updown-15-limit-order-bot-Dv5oGAF4.js +0 -1
- package/dist/predictos/agents/bookmaker-agent.d.ts.map +0 -1
- package/dist/predictos/agents/event-analysis-agent.d.ts.map +0 -1
- package/dist/predictos/agents/index.d.ts.map +0 -1
- package/dist/predictos/agents/index.js +0 -1
- package/dist/predictos/agents/index.mjs +0 -1
- package/dist/predictos/agents/mapper-agent.d.ts.map +0 -1
- package/dist/predictos/agents/polyfactual-research.d.ts.map +0 -1
- package/dist/predictos/agents/polymarket-position-tracker.d.ts.map +0 -1
- package/dist/predictos/agents/polymarket-put-order.d.ts.map +0 -1
- package/dist/predictos/agents/polymarket-updown-15-limit-order-bot.d.ts.map +0 -1
- package/dist/predictos/agents/x402-seller.d.ts.map +0 -1
- package/dist/predictos/ai/callBlockRun.d.ts.map +0 -1
- package/dist/predictos/ai/callGrok.d.ts.map +0 -1
- package/dist/predictos/ai/callOpenAI.d.ts.map +0 -1
- package/dist/predictos/ai/http.d.ts.map +0 -1
- package/dist/predictos/ai/index.d.ts.map +0 -1
- package/dist/predictos/ai/index.js +0 -1
- package/dist/predictos/ai/index.mjs +0 -1
- package/dist/predictos/ai/prompts/analyzeEventMarkets.d.ts.map +0 -1
- package/dist/predictos/ai/prompts/arbitrageAnalysis.d.ts.map +0 -1
- package/dist/predictos/ai/prompts/bookmakerAnalysis.d.ts.map +0 -1
- package/dist/predictos/ai/prompts/searchQueryGenerator.d.ts.map +0 -1
- package/dist/predictos/ai/types.d.ts.map +0 -1
- package/dist/predictos/arbitrage.d.ts.map +0 -1
- package/dist/predictos/arbitrage.js +0 -1
- package/dist/predictos/arbitrage.mjs +0 -1
- package/dist/predictos/clients/polyfactual.d.ts.map +0 -1
- package/dist/predictos/clients/polymarket.d.ts.map +0 -1
- package/dist/predictos/clients/x402.d.ts.map +0 -1
- package/dist/predictos/data/kalshi.d.ts.map +0 -1
- package/dist/predictos/data/kalshi.js +0 -1
- package/dist/predictos/data/kalshi.mjs +0 -1
- package/dist/predictos/data/polymarket.d.ts.map +0 -1
- package/dist/predictos/data/polymarket.js +0 -1
- package/dist/predictos/data/polymarket.mjs +0 -1
- package/dist/predictos/events.d.ts.map +0 -1
- package/dist/predictos/index.d.ts.map +0 -1
- package/dist/predictos/index.js +0 -1
- package/dist/predictos/index.mjs +0 -1
- package/dist/predictos/types.d.ts.map +0 -1
- package/dist/searchQueryGenerator-DIIs9xw5.js +0 -1
- package/dist/searchQueryGenerator-rCVblXJS.cjs +0 -1
- /package/dist/{predictos → prediction-markets}/agents/bookmaker-agent.d.ts +0 -0
- /package/dist/{predictos → prediction-markets}/agents/event-analysis-agent.d.ts +0 -0
- /package/dist/{predictos → prediction-markets}/agents/mapper-agent.d.ts +0 -0
- /package/dist/{predictos → prediction-markets}/agents/polymarket-position-tracker.d.ts +0 -0
- /package/dist/{predictos → prediction-markets}/agents/polymarket-updown-15-limit-order-bot.d.ts +0 -0
- /package/dist/{predictos → prediction-markets}/agents/x402-seller.d.ts +0 -0
- /package/dist/{predictos → prediction-markets}/ai/callBlockRun.d.ts +0 -0
- /package/dist/{predictos → prediction-markets}/ai/callGrok.d.ts +0 -0
- /package/dist/{predictos → prediction-markets}/ai/callOpenAI.d.ts +0 -0
- /package/dist/{predictos → prediction-markets}/ai/http.d.ts +0 -0
- /package/dist/{predictos → prediction-markets}/ai/prompts/analyzeEventMarkets.d.ts +0 -0
- /package/dist/{predictos → prediction-markets}/ai/prompts/arbitrageAnalysis.d.ts +0 -0
- /package/dist/{predictos → prediction-markets}/ai/prompts/bookmakerAnalysis.d.ts +0 -0
- /package/dist/{predictos → prediction-markets}/ai/prompts/searchQueryGenerator.d.ts +0 -0
- /package/dist/{predictos → prediction-markets}/ai/types.d.ts +0 -0
- /package/dist/{predictos → prediction-markets}/arbitrage.d.ts +0 -0
- /package/dist/{predictos → prediction-markets}/events.d.ts +0 -0
package/README.md
CHANGED
|
@@ -4,22 +4,22 @@
|
|
|
4
4
|
|
|
5
5
|
<!-- template-git-repo:badges:start -->
|
|
6
6
|
<p align="center">
|
|
7
|
-
<a href="https://
|
|
7
|
+
<a href="https://docs.autoinvestment.broker/"><img src="https://img.shields.io/badge/Docs-blue?logo=ReadTheDocs&logoColor=white" alt="Documentation" /></a>
|
|
8
8
|
<br />
|
|
9
|
-
<a href="https://github.com/OpenSourceAGI/
|
|
9
|
+
<a href="https://github.com/OpenSourceAGI/ai-broker-investing-agent/stargazers"><img src="https://img.shields.io/github/stars/OpenSourceAGI/ai-broker-investing-agent" alt="GitHub Stars" /></a>
|
|
10
10
|
<a href="https://www.npmjs.com/package/investing"><img src="https://img.shields.io/npm/dm/investing.svg" alt="NPM Monthly Downloads" /></a>
|
|
11
11
|
<a href="https://www.npmjs.com/package/investing"><img src="https://img.shields.io/npm/v/investing.svg" alt="npm version" /></a>
|
|
12
12
|
<a href="https://www.npmjs.com/package/investing"><img src="https://img.shields.io/npm/dt/investing.svg" alt="NPM Total Downloads" /></a>
|
|
13
13
|
<a href="https://www.npmjs.com/package/investing"><img src="https://img.shields.io/npm/types/investing" alt="TypeScript types" /></a>
|
|
14
14
|
<a href="https://packagephobia.com/result?p=investing"><img src="https://packagephobia.com/badge?p=investing" alt="Install size" /></a>
|
|
15
15
|
<br />
|
|
16
|
-
<a href="https://github.com/OpenSourceAGI/
|
|
17
|
-
<a href="https://github.com/OpenSourceAGI/
|
|
18
|
-
<a href="https://github.com/OpenSourceAGI/
|
|
19
|
-
<a href="https://github.com/OpenSourceAGI/
|
|
20
|
-
<a href="https://github.com/OpenSourceAGI/
|
|
16
|
+
<a href="https://github.com/OpenSourceAGI/ai-broker-investing-agent/issues"><img src="https://img.shields.io/github/issues/OpenSourceAGI/ai-broker-investing-agent?logo=github" alt="GitHub Issues" /></a>
|
|
17
|
+
<a href="https://github.com/OpenSourceAGI/ai-broker-investing-agent/pulls"><img src="https://img.shields.io/github/issues-pr/OpenSourceAGI/ai-broker-investing-agent?logo=github&label=PRs" alt="Open Pull Requests" /></a>
|
|
18
|
+
<a href="https://github.com/OpenSourceAGI/ai-broker-investing-agent/pulls?q=is%3Apr+is%3Aclosed"><img src="https://img.shields.io/github/issues-pr-closed/OpenSourceAGI/ai-broker-investing-agent?logo=github&label=PRs%20merged&color=8957e5" alt="Merged Pull Requests" /></a>
|
|
19
|
+
<a href="https://github.com/OpenSourceAGI/ai-broker-investing-agent/discussions"><img src="https://img.shields.io/github/discussions/OpenSourceAGI/ai-broker-investing-agent" alt="GitHub Discussions" /></a>
|
|
20
|
+
<a href="https://github.com/OpenSourceAGI/ai-broker-investing-agent/commits/main/"><img src="https://img.shields.io/github/last-commit/OpenSourceAGI/ai-broker-investing-agent.svg" alt="GitHub last commit" /></a>
|
|
21
21
|
<br />
|
|
22
|
-
<a href="https://stackblitz.com/github/OpenSourceAGI/
|
|
22
|
+
<a href="https://stackblitz.com/github/OpenSourceAGI/ai-broker-investing-agent/tree/main/packages/investing"><img height="20px" src="https://developer.stackblitz.com/img/open_in_stackblitz.svg" alt="Open in StackBlitz" /></a>
|
|
23
23
|
<img src="https://img.shields.io/badge/Bun-14151A?logo=bun&logoColor=white" alt="Bun" /> <img src="https://img.shields.io/badge/TypeScript-3178C6?logo=typescript&logoColor=white" alt="TypeScript" /> <img src="https://img.shields.io/badge/Drizzle%20ORM-C5F74F?logo=drizzle&logoColor=white" alt="Drizzle ORM" /> <img src="https://img.shields.io/badge/Zod-3E67B1?logo=zod&logoColor=white" alt="Zod" /> <img src="https://img.shields.io/badge/Vite-646CFF?logo=vite&logoColor=white" alt="Vite" /> <img src="https://img.shields.io/badge/Vitest-6E9F18?logo=vitest&logoColor=white" alt="Vitest" />
|
|
24
24
|
</p>
|
|
25
25
|
<!-- template-git-repo:badges:end -->
|
|
@@ -33,8 +33,6 @@ A comprehensive TypeScript/JavaScript library for investment analysis, trading a
|
|
|
33
33
|
- 🤖 **Trading Agents** - Multi-agent framework for automated trading strategies
|
|
34
34
|
- 📊 **Stock Data** - Fetch and analyze stock data from Yahoo Finance, SEC filings, and more
|
|
35
35
|
- 💹 **Prediction Markets** - Polymarket integration for prediction market data
|
|
36
|
-
- 🔮 **PredictOS Core** - Multi-agent prediction-market analysis, Kalshi/Polymarket
|
|
37
|
-
data clients, and cross-platform arbitrage (merged in from the `predictos` package)
|
|
38
36
|
- 🔌 **Alpaca Trading API** - Easy-to-use wrapper for Alpaca trading platform
|
|
39
37
|
- 📈 **Technical Analysis** - Algorithmic trading strategies and indicators
|
|
40
38
|
- 🎯 **Social Trading** - Track and analyze top traders and strategies
|
|
@@ -113,36 +111,51 @@ const leaders = await fetchLeaderboard({
|
|
|
113
111
|
});
|
|
114
112
|
```
|
|
115
113
|
|
|
116
|
-
###
|
|
114
|
+
### Kalshi Momentum Paper Agent
|
|
117
115
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
} from "investing/predictos";
|
|
116
|
+
The prediction-markets package includes a deterministic TypeScript port of the
|
|
117
|
+
momentum rules from PyKalshi's MIT-licensed
|
|
118
|
+
`kalshi-bot-api/examples/momentum_bot.py`. It consumes recorded ticks and uses
|
|
119
|
+
an in-memory paper executor, so it never connects to Kalshi, submits orders, or
|
|
120
|
+
requires credentials.
|
|
124
121
|
|
|
125
|
-
|
|
122
|
+
Run the included replay from `packages/investing`:
|
|
126
123
|
|
|
127
|
-
|
|
128
|
-
|
|
124
|
+
```bash
|
|
125
|
+
bun run demo:kalshi-momentum
|
|
126
|
+
```
|
|
129
127
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
128
|
+
```typescript
|
|
129
|
+
import { runKalshiMomentumPaperAgent } from "investing/prediction-markets";
|
|
130
|
+
|
|
131
|
+
const result = runKalshiMomentumPaperAgent({
|
|
132
|
+
initialCashCents: 10_000,
|
|
133
|
+
ticks: [50, 51, 52, 53, 58].map((yesPriceCents, index) => ({
|
|
134
|
+
ticker: "DEMO-KALSHI-MARKET",
|
|
135
|
+
timestamp: new Date(Date.UTC(2026, 0, 1, 0, index)).toISOString(),
|
|
136
|
+
yesPriceCents,
|
|
137
|
+
})),
|
|
137
138
|
});
|
|
138
139
|
|
|
139
|
-
|
|
140
|
-
const arb = await findArbitrage({ url, model: "grok-4-fast" });
|
|
140
|
+
console.log(result.report);
|
|
141
141
|
```
|
|
142
142
|
|
|
143
|
-
|
|
144
|
-
`
|
|
145
|
-
|
|
143
|
+
Prices are integer cents per contract. A YES tick of `53` implies a NO price
|
|
144
|
+
of `47`. Trade `action` (`BUY`, `SELL`, `HOLD`) is separate from the binary
|
|
145
|
+
`outcome` (`YES`, `NO`): selling YES closes YES contracts and does not mean
|
|
146
|
+
buying NO.
|
|
147
|
+
|
|
148
|
+
Configuration controls `lookback`, `momentumThreshold`, `positionSize`,
|
|
149
|
+
`profitTargetCents`, `stopLossCents`, and `maxPosition`. The defaults preserve
|
|
150
|
+
the upstream example: three consecutive moves, 10 contracts, a 5-cent target,
|
|
151
|
+
a 3-cent stop, and a 50-contract limit. The paper executor fills immediately at
|
|
152
|
+
the recorded outcome price with no fees or slippage and reports cash, open
|
|
153
|
+
positions, and realized/unrealized P&L.
|
|
154
|
+
|
|
155
|
+
This replay is a strategy demonstration, not a backtest or live execution
|
|
156
|
+
system. It assumes complementary YES/NO prices, does not model an order book,
|
|
157
|
+
partial fills, fees, latency, settlement, or market resolution, and does not
|
|
158
|
+
enable the existing unimplemented Kalshi live mapper.
|
|
146
159
|
|
|
147
160
|
### Trading Agents Framework
|
|
148
161
|
|
|
@@ -248,7 +261,7 @@ Get Polymarket leaderboard of top traders.
|
|
|
248
261
|
- `limit` - Number of results (default: 20)
|
|
249
262
|
- `category` - Market category (default: 'overall')
|
|
250
263
|
|
|
251
|
-
###
|
|
264
|
+
### Prediction-Market Agents & Arbitrage
|
|
252
265
|
|
|
253
266
|
```typescript
|
|
254
267
|
import {
|
|
@@ -257,80 +270,26 @@ import {
|
|
|
257
270
|
runMapperAgent,
|
|
258
271
|
findArbitrage,
|
|
259
272
|
getEvents,
|
|
260
|
-
} from "investing/
|
|
273
|
+
} from "investing/prediction-markets";
|
|
261
274
|
```
|
|
262
275
|
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
(`investing/predictos/data/polymarket`).
|
|
281
|
-
- **Multi-agent pipeline** (`investing/predictos/agents`):
|
|
282
|
-
- `runEventAnalysisAgent` — analyzes an event's markets for alpha and a
|
|
283
|
-
predicted winner.
|
|
284
|
-
- `runBookmakerAgent` — aggregates multiple agent analyses (and optional
|
|
285
|
-
external data sources) into a single consolidated assessment.
|
|
286
|
-
- `runMapperAgent` — turns an analysis into Polymarket order parameters
|
|
287
|
-
(pure logic; Kalshi mapping not yet implemented).
|
|
288
|
-
- **Cross-platform arbitrage** (`investing/predictos/arbitrage`) —
|
|
289
|
-
`findArbitrage` parses a Polymarket/Kalshi URL, generates a search query with
|
|
290
|
-
AI, searches the other platform, and evaluates whether the same event is
|
|
291
|
-
mispriced across venues.
|
|
292
|
-
- **Event fetching** (`getEvents`) — resolves a Polymarket/Kalshi/Jupiter URL
|
|
293
|
-
into its raw markets (Kalshi via DFlow, Polymarket via the Gamma API).
|
|
294
|
-
|
|
295
|
-
#### Subpath exports
|
|
296
|
-
|
|
297
|
-
| Import | Contents |
|
|
298
|
-
| --- | --- |
|
|
299
|
-
| `investing/predictos` | Everything (barrel) |
|
|
300
|
-
| `investing/predictos/ai` | AI clients + prompt builders |
|
|
301
|
-
| `investing/predictos/data/kalshi` | Kalshi (DFlow) data client |
|
|
302
|
-
| `investing/predictos/data/polymarket` | Polymarket (Dome) data client |
|
|
303
|
-
| `investing/predictos/agents` | `runEventAnalysisAgent`, `runBookmakerAgent`, `runMapperAgent` |
|
|
304
|
-
| `investing/predictos/arbitrage` | `findArbitrage` |
|
|
305
|
-
|
|
306
|
-
The barrel re-exports the Kalshi (DFlow) client at the top level. The Polymarket
|
|
307
|
-
(Dome) client exposes Kalshi helpers under the same names, so the barrel renames
|
|
308
|
-
those two to `getDomeKalshiMarketsByEvent` / `buildDomeKalshiMarketUrl` — import
|
|
309
|
-
from `investing/predictos/data/polymarket` for their original names. The
|
|
310
|
-
Gamma/CLOB trading client, Polyfactual and x402 are namespaced on the barrel as
|
|
311
|
-
`polymarketClob`, `polyfactual` and `x402` for the same reason.
|
|
312
|
-
|
|
313
|
-
#### Refactor notes (Deno → Node)
|
|
314
|
-
|
|
315
|
-
- Deno HTTP handlers (`Deno.serve`, `new Response(...)`, CORS headers) were
|
|
316
|
-
removed. Each endpoint is now a plain exported async function taking typed
|
|
317
|
-
parameters and returning a typed result; validation failures `throw`.
|
|
318
|
-
- `Deno.env.get("X")` was replaced with config/options objects
|
|
319
|
-
(`AIConfig`, `DataConfig`, per-call `apiKey`/`walletKey`) that fall back to
|
|
320
|
-
`process.env` (`OPENAI_API_KEY`, `XAI_API_KEY`, `BLOCKRUN_WALLET_KEY`,
|
|
321
|
-
`DOME_API_KEY`, `DFLOW_API_KEY`). No secrets are hardcoded.
|
|
322
|
-
- Remote (`https://...`) and `npm:` import specifiers were replaced with normal
|
|
323
|
-
package imports (`ethers`). The global `fetch` (Node 18+) is used throughout.
|
|
324
|
-
- Prompt text and analysis logic are preserved verbatim.
|
|
325
|
-
|
|
326
|
-
#### Not ported (yet)
|
|
327
|
-
|
|
328
|
-
Intentionally left out of the core port — noted for future work: the Next.js
|
|
329
|
-
`terminal/` frontend, the Python alpha-hunter examples, the **pay.sh** payment
|
|
330
|
-
serving flows, **Irys** verifiable-agent storage, wallet-tracking websockets, and
|
|
331
|
-
on-chain order execution (the mapper produces order parameters, but placing
|
|
332
|
-
orders is out of scope). The BlockRun client *is* ported (it only needs `ethers`
|
|
333
|
-
+ `fetch`), but its on-chain micropayment flow is untested in this environment.
|
|
276
|
+
Multi-agent analysis over Polymarket and Kalshi, refactored from Deno/Supabase
|
|
277
|
+
edge functions into plain typed async functions (MIT, see
|
|
278
|
+
`src/prediction-markets/LICENSE`):
|
|
279
|
+
|
|
280
|
+
- **AI clients** — OpenAI, Grok/xAI and BlockRun (x402 micropayments), plus the
|
|
281
|
+
analysis prompt builders.
|
|
282
|
+
- **Market data** — Kalshi via DFlow and Polymarket via Dome/Gamma.
|
|
283
|
+
- `runEventAnalysisAgent` — analyzes an event's markets for alpha and a
|
|
284
|
+
predicted winner.
|
|
285
|
+
- `runBookmakerAgent` — aggregates several agent analyses into one assessment.
|
|
286
|
+
- `runMapperAgent` — turns an analysis into Polymarket order parameters.
|
|
287
|
+
- `findArbitrage` — finds the same event on the other venue and checks whether
|
|
288
|
+
it is mispriced across venues.
|
|
289
|
+
- `getEvents` — resolves a Polymarket/Kalshi URL into its raw markets.
|
|
290
|
+
|
|
291
|
+
Keys are read from options, falling back to `OPENAI_API_KEY`, `XAI_API_KEY`,
|
|
292
|
+
`BLOCKRUN_WALLET_KEY`, `DOME_API_KEY` and `DFLOW_API_KEY`.
|
|
334
293
|
|
|
335
294
|
### Trading Agents
|
|
336
295
|
|
|
@@ -411,12 +370,6 @@ ALPACA_SECRET=your_secret_here
|
|
|
411
370
|
# OpenAI for AI-powered analysis
|
|
412
371
|
OPENAI_API_KEY=your_openai_key
|
|
413
372
|
|
|
414
|
-
# PredictOS: prediction-market analysis and data
|
|
415
|
-
XAI_API_KEY=your_xai_key # Grok/xAI
|
|
416
|
-
BLOCKRUN_WALLET_KEY=your_wallet_key # BlockRun x402 micropayments
|
|
417
|
-
DOME_API_KEY=your_dome_key # Polymarket market data
|
|
418
|
-
DFLOW_API_KEY=your_dflow_key # Kalshi market data
|
|
419
|
-
|
|
420
373
|
# Optional: Alternative LLM providers
|
|
421
374
|
ANTHROPIC_API_KEY=your_anthropic_key
|
|
422
375
|
GOOGLE_API_KEY=your_google_key
|
|
@@ -529,15 +482,7 @@ See the `/examples` directory for complete working examples:
|
|
|
529
482
|
|
|
530
483
|
- [GitHub Repository](https://github.com/vtempest/ai-broker-investment-agent)
|
|
531
484
|
- [Documentation](https://invest.vtempest.com/docs)
|
|
532
|
-
- [Agent skill](../../skills/ask-investing/SKILL.md)
|
|
533
485
|
- [Examples](./examples)
|
|
534
486
|
|
|
535
|
-
## Credits
|
|
536
|
-
|
|
537
|
-
The `predictos` module is a derivative work of
|
|
538
|
-
[PredictOS](https://github.com/PredictionXBT/PredictOS) — all original design and
|
|
539
|
-
logic © 2025 PredictionXBT, MIT licensed. See [`NOTICE`](./NOTICE) and
|
|
540
|
-
[`LICENSE-PredictOS-MIT`](./LICENSE-PredictOS-MIT).
|
|
541
|
-
|
|
542
487
|
- [GitHub Issues](https://github.com/vtempest/ai-broker-investment-agent/issues)
|
|
543
488
|
- [Documentation](https://invest.vtempest.com/docs)
|