investing 0.1.90 → 0.1.91
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/LICENSE-PredictOS-MIT +22 -0
- package/NOTICE +10 -0
- package/README.md +139 -8
- package/dist/{archiver-web.es-CMvEbZze.js → archiver-web.es-B69gABHP.js} +1 -1
- package/dist/{archiver-web.es-syfSm6ET.cjs → archiver-web.es-fg4bLLZa.cjs} +1 -1
- package/dist/bookmakerAnalysis-Bfo1zUVm.js +1 -0
- package/dist/bookmakerAnalysis-CHn1W8uX.cjs +1 -0
- package/dist/callGrok-D0D7zBHK.js +1 -0
- package/dist/callGrok-DWO719mN.cjs +1 -0
- package/dist/db/index.d.ts +0 -17
- package/dist/db/index.d.ts.map +1 -1
- package/dist/db/schema.d.ts +0 -17
- package/dist/db/schema.d.ts.map +1 -1
- package/dist/events-BJOyGWeU.cjs +1 -0
- package/dist/events-OvBb8rgy.js +1 -0
- package/dist/index-D7fsk2gy.js +15 -0
- package/dist/index-_V1Ql5Es.cjs +13 -0
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/polymarket-updown-15-limit-order-bot-DCC8HE9Z.cjs +1 -0
- package/dist/polymarket-updown-15-limit-order-bot-Dv5oGAF4.js +1 -0
- package/dist/predictos/agents/bookmaker-agent.d.ts +8 -0
- package/dist/predictos/agents/bookmaker-agent.d.ts.map +1 -0
- package/dist/predictos/agents/event-analysis-agent.d.ts +8 -0
- package/dist/predictos/agents/event-analysis-agent.d.ts.map +1 -0
- package/dist/predictos/agents/index.d.ts +21 -0
- package/dist/predictos/agents/index.d.ts.map +1 -0
- package/dist/predictos/agents/index.js +1 -0
- package/dist/predictos/agents/index.mjs +1 -0
- package/dist/predictos/agents/mapper-agent.d.ts +17 -0
- package/dist/predictos/agents/mapper-agent.d.ts.map +1 -0
- package/dist/predictos/agents/polyfactual-research.d.ts +47 -0
- package/dist/predictos/agents/polyfactual-research.d.ts.map +1 -0
- package/dist/predictos/agents/polymarket-position-tracker.d.ts +31 -0
- package/dist/predictos/agents/polymarket-position-tracker.d.ts.map +1 -0
- package/dist/predictos/agents/polymarket-put-order.d.ts +88 -0
- package/dist/predictos/agents/polymarket-put-order.d.ts.map +1 -0
- package/dist/predictos/agents/polymarket-updown-15-limit-order-bot.d.ts +92 -0
- package/dist/predictos/agents/polymarket-updown-15-limit-order-bot.d.ts.map +1 -0
- package/dist/predictos/agents/x402-seller.d.ts +34 -0
- package/dist/predictos/agents/x402-seller.d.ts.map +1 -0
- package/dist/predictos/ai/callBlockRun.d.ts +54 -0
- package/dist/predictos/ai/callBlockRun.d.ts.map +1 -0
- package/dist/predictos/ai/callGrok.d.ts +22 -0
- package/dist/predictos/ai/callGrok.d.ts.map +1 -0
- package/dist/predictos/ai/callOpenAI.d.ts +19 -0
- package/dist/predictos/ai/callOpenAI.d.ts.map +1 -0
- package/dist/predictos/ai/http.d.ts +19 -0
- package/dist/predictos/ai/http.d.ts.map +1 -0
- package/dist/predictos/ai/index.d.ts +19 -0
- package/dist/predictos/ai/index.d.ts.map +1 -0
- package/dist/predictos/ai/index.js +1 -0
- package/dist/predictos/ai/index.mjs +1 -0
- package/dist/predictos/ai/prompts/analyzeEventMarkets.d.ts +12 -0
- package/dist/predictos/ai/prompts/analyzeEventMarkets.d.ts.map +1 -0
- package/dist/predictos/ai/prompts/arbitrageAnalysis.d.ts +14 -0
- package/dist/predictos/ai/prompts/arbitrageAnalysis.d.ts.map +1 -0
- package/dist/predictos/ai/prompts/bookmakerAnalysis.d.ts +17 -0
- package/dist/predictos/ai/prompts/bookmakerAnalysis.d.ts.map +1 -0
- package/dist/predictos/ai/prompts/searchQueryGenerator.d.ts +18 -0
- package/dist/predictos/ai/prompts/searchQueryGenerator.d.ts.map +1 -0
- package/dist/predictos/ai/types.d.ts +214 -0
- package/dist/predictos/ai/types.d.ts.map +1 -0
- package/dist/predictos/arbitrage.d.ts +8 -0
- package/dist/predictos/arbitrage.d.ts.map +1 -0
- package/dist/predictos/arbitrage.js +1 -0
- package/dist/predictos/arbitrage.mjs +1 -0
- package/dist/predictos/clients/polyfactual.d.ts +72 -0
- package/dist/predictos/clients/polyfactual.d.ts.map +1 -0
- package/dist/predictos/clients/polymarket.d.ts +283 -0
- package/dist/predictos/clients/polymarket.d.ts.map +1 -0
- package/dist/predictos/clients/x402.d.ts +213 -0
- package/dist/predictos/clients/x402.d.ts.map +1 -0
- package/dist/predictos/data/kalshi.d.ts +66 -0
- package/dist/predictos/data/kalshi.d.ts.map +1 -0
- package/dist/predictos/data/kalshi.js +1 -0
- package/dist/predictos/data/kalshi.mjs +1 -0
- package/dist/predictos/data/polymarket.d.ts +105 -0
- package/dist/predictos/data/polymarket.d.ts.map +1 -0
- package/dist/predictos/data/polymarket.js +1 -0
- package/dist/predictos/data/polymarket.mjs +1 -0
- package/dist/predictos/events.d.ts +9 -0
- package/dist/predictos/events.d.ts.map +1 -0
- package/dist/predictos/index.d.ts +22 -7
- package/dist/predictos/index.d.ts.map +1 -1
- package/dist/predictos/index.js +1 -0
- package/dist/predictos/index.mjs +1 -0
- package/dist/predictos/types.d.ts +408 -0
- package/dist/predictos/types.d.ts.map +1 -0
- package/dist/searchQueryGenerator-DIIs9xw5.js +1 -0
- package/dist/searchQueryGenerator-rCVblXJS.cjs +1 -0
- package/dist/stocks/index.d.ts +1 -0
- package/dist/stocks/index.d.ts.map +1 -1
- package/dist/stocks/quote-cache-service.d.ts +2 -11
- package/dist/stocks/quote-cache-service.d.ts.map +1 -1
- package/dist/stocks/unified-quote-service.d.ts +6 -15
- package/dist/stocks/unified-quote-service.d.ts.map +1 -1
- package/package.json +45 -6
- package/dist/index-BEjkn5lM.js +0 -15
- package/dist/index-ali5NIt6.cjs +0 -13
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Kalshi market data client (via the DFlow API).
|
|
3
|
+
*
|
|
4
|
+
* DFlow provides Kalshi market data. Ported from the PredictOS `dflow`
|
|
5
|
+
* shared client. The API key is read from the `apiKey` option, falling back
|
|
6
|
+
* to `process.env.DFLOW_API_KEY`.
|
|
7
|
+
*/
|
|
8
|
+
export interface DFlowRequestOptions {
|
|
9
|
+
method?: "GET" | "POST" | "PUT" | "DELETE";
|
|
10
|
+
headers?: Record<string, string>;
|
|
11
|
+
params?: Record<string, string | number | boolean | undefined>;
|
|
12
|
+
/** DFlow API key; falls back to `process.env.DFLOW_API_KEY`. */
|
|
13
|
+
apiKey?: string;
|
|
14
|
+
}
|
|
15
|
+
export interface DFlowKalshiMarket {
|
|
16
|
+
ticker: string;
|
|
17
|
+
event_ticker: string;
|
|
18
|
+
title: string;
|
|
19
|
+
subtitle?: string;
|
|
20
|
+
status: string;
|
|
21
|
+
close_time: string;
|
|
22
|
+
yes_bid: number;
|
|
23
|
+
yes_ask: number;
|
|
24
|
+
no_bid: number;
|
|
25
|
+
no_ask: number;
|
|
26
|
+
last_price: number;
|
|
27
|
+
volume: number;
|
|
28
|
+
volume_24h: number;
|
|
29
|
+
liquidity: number;
|
|
30
|
+
open_interest: number;
|
|
31
|
+
}
|
|
32
|
+
export interface DFlowEventResponse {
|
|
33
|
+
event_ticker: string;
|
|
34
|
+
title?: string;
|
|
35
|
+
markets: DFlowKalshiMarket[];
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Makes a request to the DFlow API.
|
|
39
|
+
*
|
|
40
|
+
* @param endpoint The API endpoint (e.g., '/event/{event_ticker}')
|
|
41
|
+
* @param options Request options including method, headers, params, and apiKey
|
|
42
|
+
* @returns Promise resolving to the parsed JSON response
|
|
43
|
+
*/
|
|
44
|
+
export declare function dflowRequest<T>(endpoint: string, options?: DFlowRequestOptions): Promise<T>;
|
|
45
|
+
/**
|
|
46
|
+
* Gets Kalshi markets by event ticker via DFlow API.
|
|
47
|
+
*
|
|
48
|
+
* @param eventTicker Event ticker identifier
|
|
49
|
+
* @param apiKey Optional DFlow API key (falls back to `DFLOW_API_KEY`)
|
|
50
|
+
* @returns Promise resolving to markets list
|
|
51
|
+
*
|
|
52
|
+
* @example
|
|
53
|
+
* getKalshiMarketsByEvent("KXBTC-25DEC")
|
|
54
|
+
*/
|
|
55
|
+
export declare function getKalshiMarketsByEvent(eventTicker: string, apiKey?: string): Promise<DFlowKalshiMarket[]>;
|
|
56
|
+
/**
|
|
57
|
+
* Builds a Kalshi market URL from a market ticker.
|
|
58
|
+
*
|
|
59
|
+
* @example
|
|
60
|
+
* buildKalshiMarketUrl("KXBTCD-25DEC1217-T89999.99") // "https://kalshi.com/markets/KXBTCD"
|
|
61
|
+
*
|
|
62
|
+
* @param ticker Market ticker string
|
|
63
|
+
* @returns Kalshi market URL
|
|
64
|
+
*/
|
|
65
|
+
export declare function buildKalshiMarketUrl(ticker: string): string;
|
|
66
|
+
//# sourceMappingURL=kalshi.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kalshi.d.ts","sourceRoot":"","sources":["../../../src/predictos/data/kalshi.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,MAAM,WAAW,mBAAmB;IAClC,MAAM,CAAC,EAAE,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,QAAQ,CAAC;IAC3C,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC,CAAC;IAC/D,gEAAgE;IAChE,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAMD,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,kBAAkB;IACjC,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,iBAAiB,EAAE,CAAC;CAC9B;AAeD;;;;;;GAMG;AACH,wBAAsB,YAAY,CAAC,CAAC,EAClC,QAAQ,EAAE,MAAM,EAChB,OAAO,GAAE,mBAAwB,GAChC,OAAO,CAAC,CAAC,CAAC,CAgCZ;AAED;;;;;;;;;GASG;AACH,wBAAsB,uBAAuB,CAC3C,WAAW,EAAE,MAAM,EACnB,MAAM,CAAC,EAAE,MAAM,GACd,OAAO,CAAC,iBAAiB,EAAE,CAAC,CAM9B;AAED;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAG3D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});async function t(t,e={}){const{method:r="GET",headers:o={},params:a={},apiKey:s}=e,n=function(t){const e=t??process.env.DFLOW_API_KEY;if(!e)throw new Error("DFLOW_API_KEY is not configured. Get your API key from DFlow: https://x.com/dflow");return e}(s),i=new URLSearchParams;Object.entries(a).forEach(([t,e])=>{null!=e&&i.append(t,String(e))});const p=i.toString(),c=`https://a.prediction-markets-api.dflow.net/api/v1${t}${p?`?${p}`:""}`,u=await fetch(c,{method:r,headers:{"Content-Type":"application/json","x-api-key":n,...o}});if(!u.ok){const t=await u.text();throw new Error(`DFlow API error: ${u.status} ${u.statusText} - ${t}`)}return await u.json()}exports.buildKalshiMarketUrl=function(t){return`https://kalshi.com/markets/${t.split("-")[0]}`},exports.dflowRequest=t,exports.getKalshiMarketsByEvent=async function(e,r){return(await t(`/event/${e}`,{params:{withNestedMarkets:!0},apiKey:r})).markets};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
async function t(t,e={}){const{method:r="GET",headers:n={},params:a={},apiKey:o}=e,s=function(t){const e=t??process.env.DFLOW_API_KEY;if(!e)throw new Error("DFLOW_API_KEY is not configured. Get your API key from DFlow: https://x.com/dflow");return e}(o),i=new URLSearchParams;Object.entries(a).forEach(([t,e])=>{null!=e&&i.append(t,String(e))});const c=i.toString(),p=`https://a.prediction-markets-api.dflow.net/api/v1${t}${c?`?${c}`:""}`,h=await fetch(p,{method:r,headers:{"Content-Type":"application/json","x-api-key":s,...n}});if(!h.ok){const t=await h.text();throw new Error(`DFlow API error: ${h.status} ${h.statusText} - ${t}`)}return await h.json()}async function e(e,r){return(await t(`/event/${e}`,{params:{withNestedMarkets:!0},apiKey:r})).markets}function r(t){return`https://kalshi.com/markets/${t.split("-")[0]}`}export{r as buildKalshiMarketUrl,t as dflowRequest,e as getKalshiMarketsByEvent};
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Polymarket (and Kalshi) market data client via the Dome API.
|
|
3
|
+
*
|
|
4
|
+
* Ported from the PredictOS `dome` shared client. The API key is read from
|
|
5
|
+
* the `apiKey` option, falling back to `process.env.DOME_API_KEY`.
|
|
6
|
+
*
|
|
7
|
+
* @see https://docs.domeapi.io/
|
|
8
|
+
*/
|
|
9
|
+
export interface DomeRequestOptions {
|
|
10
|
+
method?: "GET" | "POST" | "PUT" | "DELETE";
|
|
11
|
+
headers?: Record<string, string>;
|
|
12
|
+
params?: Record<string, string | number | boolean | undefined>;
|
|
13
|
+
/** Dome API key; falls back to `process.env.DOME_API_KEY`. */
|
|
14
|
+
apiKey?: string;
|
|
15
|
+
}
|
|
16
|
+
export interface PolymarketMarket {
|
|
17
|
+
token_id: string;
|
|
18
|
+
condition_id: string;
|
|
19
|
+
question: string;
|
|
20
|
+
slug: string;
|
|
21
|
+
end_date: string;
|
|
22
|
+
description?: string;
|
|
23
|
+
outcomes: string[];
|
|
24
|
+
outcome_prices: number[];
|
|
25
|
+
volume: number;
|
|
26
|
+
liquidity: number;
|
|
27
|
+
active: boolean;
|
|
28
|
+
closed: boolean;
|
|
29
|
+
image?: string;
|
|
30
|
+
icon?: string;
|
|
31
|
+
}
|
|
32
|
+
export interface PolymarketMarketsResponse {
|
|
33
|
+
markets: PolymarketMarket[];
|
|
34
|
+
next_cursor?: string;
|
|
35
|
+
}
|
|
36
|
+
export interface KalshiMarket {
|
|
37
|
+
ticker: string;
|
|
38
|
+
event_ticker: string;
|
|
39
|
+
title: string;
|
|
40
|
+
subtitle?: string;
|
|
41
|
+
status: string;
|
|
42
|
+
close_time: string;
|
|
43
|
+
yes_bid: number;
|
|
44
|
+
yes_ask: number;
|
|
45
|
+
no_bid: number;
|
|
46
|
+
no_ask: number;
|
|
47
|
+
last_price: number;
|
|
48
|
+
volume: number;
|
|
49
|
+
volume_24h: number;
|
|
50
|
+
liquidity: number;
|
|
51
|
+
open_interest: number;
|
|
52
|
+
}
|
|
53
|
+
export interface KalshiMarketsResponse {
|
|
54
|
+
markets: KalshiMarket[];
|
|
55
|
+
cursor?: string;
|
|
56
|
+
}
|
|
57
|
+
export interface PaginationParams {
|
|
58
|
+
cursor?: string;
|
|
59
|
+
limit?: number;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Makes a request to the Dome API.
|
|
63
|
+
*
|
|
64
|
+
* @param endpoint The API endpoint (e.g., '/polymarket/markets')
|
|
65
|
+
* @param options Request options including method, headers, params, and apiKey
|
|
66
|
+
* @returns Promise resolving to the parsed JSON response
|
|
67
|
+
*/
|
|
68
|
+
export declare function domeRequest<T>(endpoint: string, options?: DomeRequestOptions): Promise<T>;
|
|
69
|
+
/**
|
|
70
|
+
* Gets Polymarket markets.
|
|
71
|
+
*
|
|
72
|
+
* @param params Pagination and filter parameters
|
|
73
|
+
* @param apiKey Optional Dome API key (falls back to `DOME_API_KEY`)
|
|
74
|
+
* @returns Promise resolving to markets list
|
|
75
|
+
*/
|
|
76
|
+
export declare function getPolymarketMarkets(params?: PaginationParams & {
|
|
77
|
+
active?: boolean;
|
|
78
|
+
closed?: boolean;
|
|
79
|
+
market_slug?: string;
|
|
80
|
+
slug?: string;
|
|
81
|
+
}, apiKey?: string): Promise<PolymarketMarketsResponse>;
|
|
82
|
+
/**
|
|
83
|
+
* Gets Kalshi markets by event ticker via Dome.
|
|
84
|
+
*
|
|
85
|
+
* @param eventTicker Event ticker identifier
|
|
86
|
+
* @param status Market status filter
|
|
87
|
+
* @param apiKey Optional Dome API key (falls back to `DOME_API_KEY`)
|
|
88
|
+
* @returns Promise resolving to markets list
|
|
89
|
+
*
|
|
90
|
+
* @example
|
|
91
|
+
* getKalshiMarketsByEvent("KXBTC-25DEC")
|
|
92
|
+
*/
|
|
93
|
+
export declare function getKalshiMarketsByEvent(eventTicker: string, status?: "open" | "closed" | "settled", apiKey?: string): Promise<KalshiMarket[]>;
|
|
94
|
+
/**
|
|
95
|
+
* Builds a Kalshi market URL from a market ticker.
|
|
96
|
+
*
|
|
97
|
+
* @example
|
|
98
|
+
* buildKalshiMarketUrl("KXBTCD-25DEC1217-T89999.99") // "https://kalshi.com/markets/KXBTCD"
|
|
99
|
+
*/
|
|
100
|
+
export declare function buildKalshiMarketUrl(ticker: string): string;
|
|
101
|
+
/**
|
|
102
|
+
* Builds a Polymarket event URL from a market slug.
|
|
103
|
+
*/
|
|
104
|
+
export declare function buildPolymarketUrl(slug: string): string;
|
|
105
|
+
//# sourceMappingURL=polymarket.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"polymarket.d.ts","sourceRoot":"","sources":["../../../src/predictos/data/polymarket.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function t(t){const e=t??process.env.DOME_API_KEY;if(!e)throw new Error("DOME_API_KEY environment variable is not set");return e}async function e(e,r={}){const{method:a="GET",headers:n={},params:s={},apiKey:o}=r,i=new URLSearchParams;Object.entries(s).forEach(([t,e])=>{null!=e&&i.append(t,String(e))});const c=i.toString(),u=`https://api.domeapi.io/v1${e}${c?`?${c}`:""}`,p=await fetch(u,{method:a,headers:{"Content-Type":"application/json",Authorization:`Bearer ${t(o)}`,...n}});if(!p.ok){const t=await p.text();throw new Error(`Dome API error: ${p.status} ${p.statusText} - ${t}`)}return await p.json()}exports.buildKalshiMarketUrl=function(t){return`https://kalshi.com/markets/${t.split("-")[0]}`},exports.buildPolymarketUrl=function(t){return`https://polymarket.com/event/${t}`},exports.domeRequest=e,exports.getKalshiMarketsByEvent=async function(t,r="open",a){return(await async function(t,r){return e("/kalshi/markets",{params:{cursor:t?.cursor,limit:t?.limit,event_ticker:t?.eventTicker,status:t?.status},apiKey:r})}({eventTicker:t,status:r,limit:100},a)).markets},exports.getPolymarketMarkets=async function(t,r){return e("/polymarket/markets",{params:t,apiKey:r})};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function t(t){const e=t??process.env.DOME_API_KEY;if(!e)throw new Error("DOME_API_KEY environment variable is not set");return e}async function e(e,r={}){const{method:n="GET",headers:a={},params:s={},apiKey:o}=r,i=new URLSearchParams;Object.entries(s).forEach(([t,e])=>{null!=e&&i.append(t,String(e))});const c=i.toString(),u=`https://api.domeapi.io/v1${e}${c?`?${c}`:""}`,p=await fetch(u,{method:n,headers:{"Content-Type":"application/json",Authorization:`Bearer ${t(o)}`,...a}});if(!p.ok){const t=await p.text();throw new Error(`Dome API error: ${p.status} ${p.statusText} - ${t}`)}return await p.json()}async function r(t,r){return e("/polymarket/markets",{params:t,apiKey:r})}async function n(t,r="open",n){const a=await async function(t,r){return e("/kalshi/markets",{params:{cursor:t?.cursor,limit:t?.limit,event_ticker:t?.eventTicker,status:t?.status},apiKey:r})}({eventTicker:t,status:r,limit:100},n);return a.markets}function a(t){return`https://kalshi.com/markets/${t.split("-")[0]}`}function s(t){return`https://polymarket.com/event/${t}`}export{a as buildKalshiMarketUrl,s as buildPolymarketUrl,e as domeRequest,n as getKalshiMarketsByEvent,r as getPolymarketMarkets};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { DataConfig, GetEventsRequest, GetEventsResult } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Fetch event markets from a prediction market URL.
|
|
4
|
+
*
|
|
5
|
+
* @throws Error on invalid input, unknown platforms, or when the event/markets
|
|
6
|
+
* cannot be fetched.
|
|
7
|
+
*/
|
|
8
|
+
export declare function getEvents(request: GetEventsRequest, config?: DataConfig): Promise<GetEventsResult>;
|
|
9
|
+
//# sourceMappingURL=events.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/predictos/events.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,eAAe,EAAqB,MAAM,YAAY,CAAC;AA4GnG;;;;;GAKG;AACH,wBAAsB,SAAS,CAC7B,OAAO,EAAE,gBAAgB,EACzB,MAAM,GAAE,UAAe,GACtB,OAAO,CAAC,eAAe,CAAC,CA6F1B"}
|
|
@@ -1,12 +1,27 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* investing/predictos - PredictOS "Super Intelligence" core, refactored for
|
|
3
|
+
* Node/TypeScript ESM and merged into the `investing` package.
|
|
3
4
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
5
|
+
* Adapted from PredictOS by PredictionXBT (https://github.com/PredictionXBT/PredictOS),
|
|
6
|
+
* MIT licensed. The original Deno/Supabase edge functions have been refactored into
|
|
7
|
+
* plain, typed async library functions.
|
|
7
8
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
9
|
+
* This module provides:
|
|
10
|
+
* - AI provider clients (OpenAI, Grok/xAI, BlockRun) and prompt builders
|
|
11
|
+
* - Prediction market data clients (Kalshi via DFlow, Polymarket via Dome/Gamma)
|
|
12
|
+
* - The multi-agent analysis pipeline (event analysis, bookmaker, mapper)
|
|
13
|
+
* - Cross-platform arbitrage detection
|
|
14
|
+
* - Event/market URL fetching
|
|
10
15
|
*/
|
|
11
|
-
export * from '
|
|
16
|
+
export * from './types.js';
|
|
17
|
+
export * from './ai/index.js';
|
|
18
|
+
export * from './data/kalshi.js';
|
|
19
|
+
export { domeRequest, getPolymarketMarkets, buildPolymarketUrl, getKalshiMarketsByEvent as getDomeKalshiMarketsByEvent, buildKalshiMarketUrl as buildDomeKalshiMarketUrl, } from './data/polymarket.js';
|
|
20
|
+
export type { DomeRequestOptions, PolymarketMarket, PolymarketMarketsResponse, KalshiMarket as DomeKalshiMarket, KalshiMarketsResponse as DomeKalshiMarketsResponse, PaginationParams, } from './data/polymarket.js';
|
|
21
|
+
export * from './agents/index.js';
|
|
22
|
+
export { findArbitrage } from './arbitrage.js';
|
|
23
|
+
export { getEvents } from './events.js';
|
|
24
|
+
export * as polyfactual from './clients/polyfactual.js';
|
|
25
|
+
export * as x402 from './clients/x402.js';
|
|
26
|
+
export * as polymarketClob from './clients/polymarket.js';
|
|
12
27
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/predictos/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/predictos/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,cAAc,YAAY,CAAC;AAG3B,cAAc,eAAe,CAAC;AAQ9B,cAAc,kBAAkB,CAAC;AACjC,OAAO,EACL,WAAW,EACX,oBAAoB,EACpB,kBAAkB,EAClB,uBAAuB,IAAI,2BAA2B,EACtD,oBAAoB,IAAI,wBAAwB,GACjD,MAAM,sBAAsB,CAAC;AAC9B,YAAY,EACV,kBAAkB,EAClB,gBAAgB,EAChB,yBAAyB,EACzB,YAAY,IAAI,gBAAgB,EAChC,qBAAqB,IAAI,yBAAyB,EAClD,gBAAgB,GACjB,MAAM,sBAAsB,CAAC;AAG9B,cAAc,mBAAmB,CAAC;AAGlC,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAG/C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAMxC,OAAO,KAAK,WAAW,MAAM,0BAA0B,CAAC;AACxD,OAAO,KAAK,IAAI,MAAM,mBAAmB,CAAC;AAC1C,OAAO,KAAK,cAAc,MAAM,yBAAyB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../callGrok-DWO719mN.cjs"),r=require("../bookmakerAnalysis-CHn1W8uX.cjs"),t=require("../searchQueryGenerator-rCVblXJS.cjs"),o=require("./data/kalshi.js"),s=require("./data/polymarket.js"),a=require("../polymarket-updown-15-limit-order-bot-DCC8HE9Z.cjs"),l=require("./arbitrage.js"),n=require("../events-BJOyGWeU.cjs");exports.callGrokResponses=e.callGrokResponses,exports.callOpenAIResponses=e.callOpenAIResponses,exports.fetchWithTimeout=e.fetchWithTimeout,exports.isRetryableError=e.isRetryableError,exports.sleep=e.sleep,exports.BLOCKRUN_MODELS=r.BLOCKRUN_MODELS,exports.analyzeEventMarketsPrompt=r.analyzeEventMarketsPrompt,exports.bookmakerAnalysisPrompt=r.bookmakerAnalysisPrompt,exports.callBlockRunResponses=r.callBlockRunResponses,exports.isBlockRunModel=r.isBlockRunModel,exports.listBlockRunModels=r.listBlockRunModels,exports.arbitrageAnalysisPrompt=t.arbitrageAnalysisPrompt,exports.searchQueryGeneratorPrompt=t.searchQueryGeneratorPrompt,exports.buildKalshiMarketUrl=o.buildKalshiMarketUrl,exports.dflowRequest=o.dflowRequest,exports.getKalshiMarketsByEvent=o.getKalshiMarketsByEvent,exports.buildDomeKalshiMarketUrl=s.buildKalshiMarketUrl,exports.buildPolymarketUrl=s.buildPolymarketUrl,exports.domeRequest=s.domeRequest,exports.getDomeKalshiMarketsByEvent=s.getKalshiMarketsByEvent,exports.getPolymarketMarkets=s.getPolymarketMarkets,exports.NoTradeError=a.NoTradeError,exports.polyfactual=a.polyfactual,exports.polymarketClob=a.polymarket,exports.runBookmakerAgent=a.runBookmakerAgent,exports.runEventAnalysisAgent=a.runEventAnalysisAgent,exports.runMapperAgent=a.runMapperAgent,exports.runPolyfactualResearch=a.runPolyfactualResearch,exports.runPolymarketPositionTracker=a.runPolymarketPositionTracker,exports.runPolymarketPutOrder=a.runPolymarketPutOrder,exports.runPolymarketUpDown15LimitOrderBot=a.runPolymarketUpDown15LimitOrderBot,exports.runX402Seller=a.runX402Seller,exports.x402=a.x402,exports.findArbitrage=l.findArbitrage,exports.getEvents=n.getEvents;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as a,a as s,f as r,i as e,s as o}from"../callGrok-D0D7zBHK.js";import{B as t,a as l,b as m,c as n,i,l as p}from"../bookmakerAnalysis-Bfo1zUVm.js";import{a as k,s as u}from"../searchQueryGenerator-DIIs9xw5.js";import{buildKalshiMarketUrl as y,dflowRequest as c,getKalshiMarketsByEvent as f}from"./data/kalshi.mjs";import{buildKalshiMarketUrl as d,buildPolymarketUrl as b,domeRequest as h,getKalshiMarketsByEvent as P,getPolymarketMarkets as g}from"./data/polymarket.mjs";import{N as M,p as R,h as j,r as A,a as B,b as E,c as v,d as K,e as O,f as D,g as G,x as U}from"../polymarket-updown-15-limit-order-bot-Dv5oGAF4.js";import{findArbitrage as L}from"./arbitrage.mjs";import{g as T}from"../events-OvBb8rgy.js";export{t as BLOCKRUN_MODELS,M as NoTradeError,l as analyzeEventMarketsPrompt,k as arbitrageAnalysisPrompt,m as bookmakerAnalysisPrompt,d as buildDomeKalshiMarketUrl,y as buildKalshiMarketUrl,b as buildPolymarketUrl,n as callBlockRunResponses,a as callGrokResponses,s as callOpenAIResponses,c as dflowRequest,h as domeRequest,r as fetchWithTimeout,L as findArbitrage,P as getDomeKalshiMarketsByEvent,T as getEvents,f as getKalshiMarketsByEvent,g as getPolymarketMarkets,i as isBlockRunModel,e as isRetryableError,p as listBlockRunModels,R as polyfactual,j as polymarketClob,A as runBookmakerAgent,B as runEventAnalysisAgent,E as runMapperAgent,v as runPolyfactualResearch,K as runPolymarketPositionTracker,O as runPolymarketPutOrder,D as runPolymarketUpDown15LimitOrderBot,G as runX402Seller,u as searchQueryGeneratorPrompt,o as sleep,U as x402};
|