investing 0.1.0 → 0.1.2
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 +88 -60
- package/dist/algo-stategies/tv-scraper.d.ts +2 -0
- package/dist/algo-stategies/tv-scraper.d.ts.map +1 -0
- package/dist/alpaca/alpaca-mcp-client.d.ts +174 -0
- package/dist/alpaca/alpaca-mcp-client.d.ts.map +1 -0
- package/dist/alpaca/client.d.ts +21 -0
- package/dist/alpaca/client.d.ts.map +1 -0
- package/dist/archiver-web.es-BgXzilRH.cjs +1 -0
- package/dist/archiver-web.es-EPYdovFt.js +1 -0
- package/dist/correlate/metrics.d.ts +40 -0
- package/dist/correlate/metrics.d.ts.map +1 -0
- package/dist/correlate/model-persistence.d.ts +26 -0
- package/dist/correlate/model-persistence.d.ts.map +1 -0
- package/dist/correlate/predict-statistics.d.ts +14 -0
- package/dist/correlate/predict-statistics.d.ts.map +1 -0
- package/dist/correlate/rolling-stats.d.ts +27 -0
- package/dist/correlate/rolling-stats.d.ts.map +1 -0
- package/dist/correlate/types.d.ts +78 -0
- package/dist/correlate/types.d.ts.map +1 -0
- package/dist/correlate/xgboost-predictor.d.ts +19 -0
- package/dist/correlate/xgboost-predictor.d.ts.map +1 -0
- package/dist/correlate/xgboost-trainer.d.ts +112 -0
- package/dist/correlate/xgboost-trainer.d.ts.map +1 -0
- package/dist/db/client.d.ts +10 -0
- package/dist/db/client.d.ts.map +1 -0
- package/dist/db/d1-http.d.ts +38 -0
- package/dist/db/d1-http.d.ts.map +1 -0
- package/dist/db/index.d.ts +8870 -0
- package/dist/db/index.d.ts.map +1 -0
- package/dist/db/relations.d.ts +21 -0
- package/dist/db/relations.d.ts.map +1 -0
- package/dist/db/schema.d.ts +8845 -0
- package/dist/db/schema.d.ts.map +1 -0
- package/dist/debate-research/stock-agents-api.d.ts +129 -0
- package/dist/debate-research/stock-agents-api.d.ts.map +1 -0
- package/dist/index-C9OpAHBe.js +15 -0
- package/dist/index-CLlAnStL-B7EBGdAY.cjs +1 -0
- package/dist/index-CLlAnStL-C554ZmGF.js +1 -0
- package/dist/index-CcyBsxYm.cjs +13 -0
- package/dist/index.d.ts +26 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1 -0
- package/dist/index.mjs +1 -0
- package/dist/leaders/nvsty-leaders.d.ts +63 -0
- package/dist/leaders/nvsty-leaders.d.ts.map +1 -0
- package/dist/leaders/zulu.d.ts +167 -0
- package/dist/leaders/zulu.d.ts.map +1 -0
- package/dist/live-data/dukascopy-client.d.ts +102 -0
- package/dist/live-data/dukascopy-client.d.ts.map +1 -0
- package/dist/llm/debate-generator.d.ts +32 -0
- package/dist/llm/debate-generator.d.ts.map +1 -0
- package/dist/prediction/analysis/categories.d.ts +37 -0
- package/dist/prediction/analysis/categories.d.ts.map +1 -0
- package/dist/prediction/analysis/detector.d.ts +15 -0
- package/dist/prediction/analysis/detector.d.ts.map +1 -0
- package/dist/prediction/analysis/greeks.d.ts +11 -0
- package/dist/prediction/analysis/greeks.d.ts.map +1 -0
- package/dist/prediction/analysis/price-changes.d.ts +12 -0
- package/dist/prediction/analysis/price-changes.d.ts.map +1 -0
- package/dist/prediction/api/analytics.d.ts +46 -0
- package/dist/prediction/api/analytics.d.ts.map +1 -0
- package/dist/prediction/api/gamma.d.ts +30 -0
- package/dist/prediction/api/gamma.d.ts.map +1 -0
- package/dist/prediction/api/leaderboard.d.ts +113 -0
- package/dist/prediction/api/leaderboard.d.ts.map +1 -0
- package/dist/prediction/api/markets.d.ts +62 -0
- package/dist/prediction/api/markets.d.ts.map +1 -0
- package/dist/prediction/api/prices.d.ts +32 -0
- package/dist/prediction/api/prices.d.ts.map +1 -0
- package/dist/prediction/constants.d.ts +7 -0
- package/dist/prediction/constants.d.ts.map +1 -0
- package/dist/prediction/db/debates.d.ts +41 -0
- package/dist/prediction/db/debates.d.ts.map +1 -0
- package/dist/prediction/db/leaderboard.d.ts +37 -0
- package/dist/prediction/db/leaderboard.d.ts.map +1 -0
- package/dist/prediction/db/markets.d.ts +91 -0
- package/dist/prediction/db/markets.d.ts.map +1 -0
- package/dist/prediction/db/positions.d.ts +73 -0
- package/dist/prediction/db/positions.d.ts.map +1 -0
- package/dist/prediction/db/prices.d.ts +37 -0
- package/dist/prediction/db/prices.d.ts.map +1 -0
- package/dist/prediction/db/trade-history.d.ts +108 -0
- package/dist/prediction/db/trade-history.d.ts.map +1 -0
- package/dist/prediction/index.d.ts +26 -0
- package/dist/prediction/index.d.ts.map +1 -0
- package/dist/prediction/sync/holders.d.ts +10 -0
- package/dist/prediction/sync/holders.d.ts.map +1 -0
- package/dist/prediction/sync/incremental-markets.d.ts +18 -0
- package/dist/prediction/sync/incremental-markets.d.ts.map +1 -0
- package/dist/prediction/sync/leaderboard.d.ts +25 -0
- package/dist/prediction/sync/leaderboard.d.ts.map +1 -0
- package/dist/prediction/sync/markets.d.ts +25 -0
- package/dist/prediction/sync/markets.d.ts.map +1 -0
- package/dist/prediction/sync/orchestration.d.ts +12 -0
- package/dist/prediction/sync/orchestration.d.ts.map +1 -0
- package/dist/prediction/sync/prices.d.ts +25 -0
- package/dist/prediction/sync/prices.d.ts.map +1 -0
- package/dist/prediction/sync/trade-history.d.ts +96 -0
- package/dist/prediction/sync/trade-history.d.ts.map +1 -0
- package/dist/prediction/sync.d.ts +4 -0
- package/dist/prediction/sync.d.ts.map +1 -0
- package/dist/prediction/types.d.ts +131 -0
- package/dist/prediction/types.d.ts.map +1 -0
- package/dist/prediction/utils/categorizer.d.ts +37 -0
- package/dist/prediction/utils/categorizer.d.ts.map +1 -0
- package/dist/predictos/index.d.ts +12 -0
- package/dist/predictos/index.d.ts.map +1 -0
- package/dist/stock-names-data/stock-names.json.d.ts +4 -0
- package/dist/stocks/find-wikipedia-urls.d.ts +6 -0
- package/dist/stocks/find-wikipedia-urls.d.ts.map +1 -0
- package/dist/stocks/finnhub-utils.d.ts +42 -0
- package/dist/stocks/finnhub-utils.d.ts.map +1 -0
- package/dist/stocks/finnhub-wrapper.d.ts +49 -0
- package/dist/stocks/finnhub-wrapper.d.ts.map +1 -0
- package/dist/stocks/import-stock-names.d.ts +2 -0
- package/dist/stocks/import-stock-names.d.ts.map +1 -0
- package/dist/stocks/index.d.ts +12 -0
- package/dist/stocks/index.d.ts.map +1 -0
- package/dist/stocks/quote-cache-service.d.ts +94 -0
- package/dist/stocks/quote-cache-service.d.ts.map +1 -0
- package/dist/stocks/sec-filing-api.d.ts +35 -0
- package/dist/stocks/sec-filing-api.d.ts.map +1 -0
- package/dist/stocks/stock-names-client.d.ts +10 -0
- package/dist/stocks/stock-names-client.d.ts.map +1 -0
- package/dist/stocks/stock-names.d.ts +26 -0
- package/dist/stocks/stock-names.d.ts.map +1 -0
- package/dist/stocks/types.d.ts +547 -0
- package/dist/stocks/types.d.ts.map +1 -0
- package/dist/stocks/unified-quote-example.d.ts +30 -0
- package/dist/stocks/unified-quote-example.d.ts.map +1 -0
- package/dist/stocks/unified-quote-service.d.ts +111 -0
- package/dist/stocks/unified-quote-service.d.ts.map +1 -0
- package/dist/stocks/yahoo-finance-wrapper.d.ts +344 -0
- package/dist/stocks/yahoo-finance-wrapper.d.ts.map +1 -0
- package/dist/stocks/yfinance-wrapper.d.ts +10 -0
- package/dist/stocks/yfinance-wrapper.d.ts.map +1 -0
- package/dist/trading-agents/agents/debate-facilitator.d.ts +26 -0
- package/dist/trading-agents/agents/debate-facilitator.d.ts.map +1 -0
- package/dist/trading-agents/agents/fund-manager.d.ts +11 -0
- package/dist/trading-agents/agents/fund-manager.d.ts.map +1 -0
- package/dist/trading-agents/agents/improved-researchers.d.ts +16 -0
- package/dist/trading-agents/agents/improved-researchers.d.ts.map +1 -0
- package/dist/trading-agents/agents/market-analyst.d.ts +8 -0
- package/dist/trading-agents/agents/market-analyst.d.ts.map +1 -0
- package/dist/trading-agents/agents/news-analyst.d.ts +8 -0
- package/dist/trading-agents/agents/news-analyst.d.ts.map +1 -0
- package/dist/trading-agents/agents/researchers.d.ts +22 -0
- package/dist/trading-agents/agents/researchers.d.ts.map +1 -0
- package/dist/trading-agents/agents/risk-team.d.ts +22 -0
- package/dist/trading-agents/agents/risk-team.d.ts.map +1 -0
- package/dist/trading-agents/agents/trader.d.ts +10 -0
- package/dist/trading-agents/agents/trader.d.ts.map +1 -0
- package/dist/trading-agents/example.d.ts +7 -0
- package/dist/trading-agents/example.d.ts.map +1 -0
- package/dist/trading-agents/graph/trading-graph.d.ts +59 -0
- package/dist/trading-agents/graph/trading-graph.d.ts.map +1 -0
- package/dist/trading-agents/index.d.ts +13 -0
- package/dist/trading-agents/index.d.ts.map +1 -0
- package/dist/trading-agents/tools/alpaca-mcp-tools.d.ts +46 -0
- package/dist/trading-agents/tools/alpaca-mcp-tools.d.ts.map +1 -0
- package/dist/trading-agents/tools/data-tools.d.ts +18 -0
- package/dist/trading-agents/tools/data-tools.d.ts.map +1 -0
- package/dist/trading-agents/tools/langchain-tools.d.ts +78 -0
- package/dist/trading-agents/tools/langchain-tools.d.ts.map +1 -0
- package/dist/trading-agents/types/index.d.ts +171 -0
- package/dist/trading-agents/types/index.d.ts.map +1 -0
- package/dist/trading-agents/utils/llm-client.d.ts +45 -0
- package/dist/trading-agents/utils/llm-client.d.ts.map +1 -0
- package/dist/trading-agents/utils/memory.d.ts +38 -0
- package/dist/trading-agents/utils/memory.d.ts.map +1 -0
- package/dist/trending-topics/wiki-page-views.d.ts +133 -0
- package/dist/trending-topics/wiki-page-views.d.ts.map +1 -0
- package/dist/utils/logger.d.ts +7 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/package.json +47 -17
- package/data/globe.json +0 -182
- package/data/sector-info.json +0 -1540
- package/data/sectors-industries.json +0 -327
- package/data/stock-indexes.json +0 -106
- package/data/stock-names.json +0 -1
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export { POLYMARKET_CATEGORIES, type PolymarketCategory } from './constants';
|
|
2
|
+
export * from './types';
|
|
3
|
+
export * from './sync';
|
|
4
|
+
export * from './api/markets';
|
|
5
|
+
export * from './api/leaderboard';
|
|
6
|
+
export * from './api/analytics';
|
|
7
|
+
export * from './api/prices';
|
|
8
|
+
export * from './api/gamma';
|
|
9
|
+
export * from './db/markets';
|
|
10
|
+
export * from './db/leaderboard';
|
|
11
|
+
export * from './db/positions';
|
|
12
|
+
export * from './db/debates';
|
|
13
|
+
export * from './db/prices';
|
|
14
|
+
export * from './db/trade-history';
|
|
15
|
+
export * from './analysis/price-changes';
|
|
16
|
+
export * from './analysis/categories';
|
|
17
|
+
export * from './analysis/greeks';
|
|
18
|
+
export * from './analysis/detector';
|
|
19
|
+
export * from './sync/markets';
|
|
20
|
+
export * from './sync/incremental-markets';
|
|
21
|
+
export * from './sync/leaderboard';
|
|
22
|
+
export * from './sync/prices';
|
|
23
|
+
export * from './sync/holders';
|
|
24
|
+
export * from './sync/orchestration';
|
|
25
|
+
export * from './sync/trade-history';
|
|
26
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/prediction/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,KAAK,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAC7E,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AAGvB,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAG5B,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,oBAAoB,CAAC;AAGnC,cAAc,0BAA0B,CAAC;AACzC,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AAGpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,4BAA4B,CAAC;AAC3C,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Syncs top holders for a specific market.
|
|
3
|
+
* Fetches dashboard data which includes holder information.
|
|
4
|
+
* @param marketId - The unique identifier of the market
|
|
5
|
+
* @param eventId - The event ID required for the dashboard API (optional, can be derived if not provided, but better if provided)
|
|
6
|
+
*/
|
|
7
|
+
export declare function syncMarketHolders(marketId: string, eventId?: string): Promise<{
|
|
8
|
+
holders: any;
|
|
9
|
+
}>;
|
|
10
|
+
//# sourceMappingURL=holders.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"holders.d.ts","sourceRoot":"","sources":["../../../src/prediction/sync/holders.ts"],"names":[],"mappings":"AAGA;;;;;GAKG;AACH,wBAAsB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM;;GAgCzE"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Incrementally syncs markets from Polymarket API to the database.
|
|
3
|
+
* Updates existing markets and adds new ones without deleting the entire table.
|
|
4
|
+
* This is ideal for cron jobs that run frequently.
|
|
5
|
+
*
|
|
6
|
+
* @param maxMarkets - Maximum number of markets to sync (default: 1000)
|
|
7
|
+
* @param syncPriceHistoryFlag - Whether to also fetch price history (default: true)
|
|
8
|
+
* @param syncHoldersFlag - Whether to also fetch top holders (default: true)
|
|
9
|
+
* @returns Object with count of synced markets, price points, and holders
|
|
10
|
+
*/
|
|
11
|
+
export declare function syncMarketsIncremental(maxMarkets?: number, syncPriceHistoryFlag?: boolean, syncHoldersFlag?: boolean): Promise<{
|
|
12
|
+
markets: any;
|
|
13
|
+
pricePoints: number;
|
|
14
|
+
priceHistoryUpdates: number;
|
|
15
|
+
holders: number;
|
|
16
|
+
holderUpdates: number;
|
|
17
|
+
}>;
|
|
18
|
+
//# sourceMappingURL=incremental-markets.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"incremental-markets.d.ts","sourceRoot":"","sources":["../../../src/prediction/sync/incremental-markets.ts"],"names":[],"mappings":"AAMA;;;;;;;;;GASG;AACH,wBAAsB,sBAAsB,CAC1C,UAAU,SAAO,EACjB,oBAAoB,UAAO,EAC3B,eAAe,UAAO;;;;;;GAyJvB"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Syncs leaderboard data from Polymarket API to the database.
|
|
3
|
+
* @param options - Sync configuration options
|
|
4
|
+
* @param options.timePeriod - Time period filter: "all", "1d", "7d", or "30d"
|
|
5
|
+
* @param options.orderBy - Sort order: "VOL" for volume or "PNL" for profit/loss
|
|
6
|
+
* @param options.limit - Maximum number of entries to sync
|
|
7
|
+
* @returns Object with count of synced leaderboard entries
|
|
8
|
+
*/
|
|
9
|
+
export declare function syncLeaderboard(options?: {
|
|
10
|
+
timePeriod?: "all" | "1d" | "7d" | "30d";
|
|
11
|
+
orderBy?: "VOL" | "PNL";
|
|
12
|
+
limit?: number;
|
|
13
|
+
}): Promise<{
|
|
14
|
+
leaders: any;
|
|
15
|
+
}>;
|
|
16
|
+
/**
|
|
17
|
+
* Syncs top traders, their positions, and category analytics from Polymarket.
|
|
18
|
+
* Fetches top 50 traders, retrieves all their positions, and calculates category performance.
|
|
19
|
+
* @returns Object with counts of synced leaders and positions
|
|
20
|
+
*/
|
|
21
|
+
export declare function syncLeadersAndCategories(): Promise<{
|
|
22
|
+
leaders: number;
|
|
23
|
+
positions: number;
|
|
24
|
+
}>;
|
|
25
|
+
//# sourceMappingURL=leaderboard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"leaderboard.d.ts","sourceRoot":"","sources":["../../../src/prediction/sync/leaderboard.ts"],"names":[],"mappings":"AA0BA;;;;;;;GAOG;AACH,wBAAsB,eAAe,CACnC,OAAO,GAAE;IACP,UAAU,CAAC,EAAE,KAAK,GAAG,IAAI,GAAG,IAAI,GAAG,KAAK,CAAC;IACzC,OAAO,CAAC,EAAE,KAAK,GAAG,KAAK,CAAC;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;CACX;;GASP;AAED;;;;GAIG;AACH,wBAAsB,wBAAwB;;;GAuB7C"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Syncs markets from Polymarket API to the database.
|
|
3
|
+
* Clears existing markets and fetches fresh data sorted by 24h volume.
|
|
4
|
+
* Also fetches and stores price history for markets with token IDs.
|
|
5
|
+
* @param limit - Maximum number of markets to sync (default: 200)
|
|
6
|
+
* @param syncPriceHistoryFlag - Whether to also fetch price history (default: true)
|
|
7
|
+
* @returns Object with count of synced markets and price history data points
|
|
8
|
+
*/
|
|
9
|
+
export declare function syncMarkets(limit?: number, syncPriceHistoryFlag?: boolean): Promise<{
|
|
10
|
+
markets: any;
|
|
11
|
+
pricePoints: number;
|
|
12
|
+
}>;
|
|
13
|
+
/**
|
|
14
|
+
* Syncs all active markets from Polymarket API to the database.
|
|
15
|
+
* Clears existing markets and fetches all available data sorted by 24h volume.
|
|
16
|
+
* Also fetches and stores price history for markets with token IDs.
|
|
17
|
+
* @param maxMarkets - Maximum total number of markets to sync (default: 0 for unlimited, fetches ALL active markets)
|
|
18
|
+
* @param syncPriceHistoryFlag - Whether to also fetch price history (default: true)
|
|
19
|
+
* @returns Object with count of synced markets and price history data points
|
|
20
|
+
*/
|
|
21
|
+
export declare function syncAllMarkets(maxMarkets?: number, syncPriceHistoryFlag?: boolean): Promise<{
|
|
22
|
+
markets: any;
|
|
23
|
+
pricePoints: number;
|
|
24
|
+
}>;
|
|
25
|
+
//# sourceMappingURL=markets.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"markets.d.ts","sourceRoot":"","sources":["../../../src/prediction/sync/markets.ts"],"names":[],"mappings":"AAMA;;;;;;;GAOG;AACH,wBAAsB,WAAW,CAAC,KAAK,SAAM,EAAE,oBAAoB,UAAO;;;GAoEzE;AAED;;;;;;;GAOG;AACH,wBAAsB,cAAc,CAClC,UAAU,SAAI,EACd,oBAAoB,UAAO;;;GAqE5B"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Performs a full synchronization of all Polymarket data.
|
|
3
|
+
* Syncs markets, leaderboard, leaders, positions, and categories.
|
|
4
|
+
* @returns Object with counts of all synced data types
|
|
5
|
+
*/
|
|
6
|
+
export declare function syncAll(): Promise<{
|
|
7
|
+
markets: any;
|
|
8
|
+
leaderboard: any;
|
|
9
|
+
leaders: number;
|
|
10
|
+
positions: number;
|
|
11
|
+
}>;
|
|
12
|
+
//# sourceMappingURL=orchestration.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"orchestration.d.ts","sourceRoot":"","sources":["../../../src/prediction/sync/orchestration.ts"],"names":[],"mappings":"AAGA;;;;GAIG;AACH,wBAAsB,OAAO;;;;;GAgB5B"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Fetches and saves historical price data for a specific token.
|
|
3
|
+
* Convenience function that combines fetchPriceHistory and savePriceHistory.
|
|
4
|
+
* @param tokenId - The unique identifier of the market token
|
|
5
|
+
* @param options - Configuration options for the price history query
|
|
6
|
+
* @param options.interval - Time interval for data points (default: "1h")
|
|
7
|
+
* @param options.startTs - Optional start timestamp (Unix timestamp in seconds)
|
|
8
|
+
* @param options.endTs - Optional end timestamp (Unix timestamp in seconds)
|
|
9
|
+
* @param options.abs - Optional flag to return absolute prices instead of 0-1 probability scale
|
|
10
|
+
* @returns Object with count of saved price points
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* // Fetch and save 1-hour interval history for a token
|
|
14
|
+
* const result = await syncPriceHistory("token_id");
|
|
15
|
+
* console.log(`Saved ${result.pricePoints} price points`);
|
|
16
|
+
*/
|
|
17
|
+
export declare function syncPriceHistory(tokenId: string, options?: {
|
|
18
|
+
interval?: string;
|
|
19
|
+
startTs?: number;
|
|
20
|
+
endTs?: number;
|
|
21
|
+
abs?: boolean;
|
|
22
|
+
}): Promise<{
|
|
23
|
+
pricePoints: any;
|
|
24
|
+
}>;
|
|
25
|
+
//# sourceMappingURL=prices.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prices.d.ts","sourceRoot":"","sources":["../../../src/prediction/sync/prices.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;GAeG;AACH,wBAAsB,gBAAgB,CACpC,OAAO,EAAE,MAAM,EACf,OAAO,GAAE;IACP,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,OAAO,CAAC;CACV;;GAkBP"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Options for syncing trade history
|
|
3
|
+
*/
|
|
4
|
+
export interface SyncTradeHistoryOptions {
|
|
5
|
+
/** Number of top traders to sync (default: 1000) */
|
|
6
|
+
limit?: number;
|
|
7
|
+
/** Time period for leaderboard ranking: "all", "1d", "7d", "30d" */
|
|
8
|
+
timePeriod?: "all" | "1d" | "7d" | "30d";
|
|
9
|
+
/** Sort order for leaderboard: "VOL" or "PNL" */
|
|
10
|
+
orderBy?: "VOL" | "PNL";
|
|
11
|
+
/** Batch size for processing traders (default: 10) */
|
|
12
|
+
batchSize?: number;
|
|
13
|
+
/** Delay between batches in ms (default: 1000) */
|
|
14
|
+
batchDelay?: number;
|
|
15
|
+
/** Delay between individual traders in ms (default: 200) */
|
|
16
|
+
traderDelay?: number;
|
|
17
|
+
/** Only sync trades newer than this timestamp */
|
|
18
|
+
sinceTimestamp?: number;
|
|
19
|
+
/** Skip traders that have been synced within this many hours (default: 24) */
|
|
20
|
+
skipRecentlysynced?: number;
|
|
21
|
+
/** Progress callback */
|
|
22
|
+
onProgress?: (progress: SyncProgress) => void;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Progress information for sync operations
|
|
26
|
+
*/
|
|
27
|
+
export interface SyncProgress {
|
|
28
|
+
currentTrader: number;
|
|
29
|
+
totalTraders: number;
|
|
30
|
+
currentTraderAddress: string;
|
|
31
|
+
tradesFetched: number;
|
|
32
|
+
traderName?: string;
|
|
33
|
+
status: "fetching_leaderboard" | "syncing_trader" | "completed" | "error";
|
|
34
|
+
error?: string;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Result of a sync operation
|
|
38
|
+
*/
|
|
39
|
+
export interface SyncResult {
|
|
40
|
+
tradersProcessed: number;
|
|
41
|
+
tradersSkipped: number;
|
|
42
|
+
tradersFailed: number;
|
|
43
|
+
totalTradesSynced: number;
|
|
44
|
+
duration: number;
|
|
45
|
+
errors: Array<{
|
|
46
|
+
traderId: string;
|
|
47
|
+
error: string;
|
|
48
|
+
}>;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Fetches and stores the top N traders from the leaderboard.
|
|
52
|
+
* @param limit - Number of traders to fetch
|
|
53
|
+
* @param options - Leaderboard options
|
|
54
|
+
* @returns Array of trader addresses
|
|
55
|
+
*/
|
|
56
|
+
export declare function fetchAndStoreTopTraders(limit: number, options?: {
|
|
57
|
+
timePeriod?: "all" | "1d" | "7d" | "30d";
|
|
58
|
+
orderBy?: "VOL" | "PNL";
|
|
59
|
+
}): Promise<string[]>;
|
|
60
|
+
/**
|
|
61
|
+
* Syncs trade history for a single trader.
|
|
62
|
+
* @param traderId - The trader wallet address
|
|
63
|
+
* @param options - Sync options
|
|
64
|
+
* @returns Number of trades synced
|
|
65
|
+
*/
|
|
66
|
+
export declare function syncTraderTradeHistory(traderId: string, options?: {
|
|
67
|
+
sinceTimestamp?: number;
|
|
68
|
+
onProgress?: (fetched: number) => void;
|
|
69
|
+
}): Promise<number>;
|
|
70
|
+
/**
|
|
71
|
+
* Syncs trade history for the top N leaderboard traders.
|
|
72
|
+
* This is the main entry point for the trade history scraper.
|
|
73
|
+
* @param options - Sync options
|
|
74
|
+
* @returns Sync result with statistics
|
|
75
|
+
*/
|
|
76
|
+
export declare function syncTopTradersTradeHistory(options?: SyncTradeHistoryOptions): Promise<SyncResult>;
|
|
77
|
+
/**
|
|
78
|
+
* Resumes syncing for traders that failed or are pending.
|
|
79
|
+
* @param options - Sync options
|
|
80
|
+
* @returns Sync result
|
|
81
|
+
*/
|
|
82
|
+
export declare function resumeTradeHistorySync(options?: Omit<SyncTradeHistoryOptions, "limit"> & {
|
|
83
|
+
limit?: number;
|
|
84
|
+
}): Promise<SyncResult>;
|
|
85
|
+
/**
|
|
86
|
+
* Quick utility to get sync progress.
|
|
87
|
+
* @returns Sync status statistics
|
|
88
|
+
*/
|
|
89
|
+
export declare function getTradeHistorySyncProgress(): Promise<{
|
|
90
|
+
pending: number;
|
|
91
|
+
in_progress: number;
|
|
92
|
+
completed: number;
|
|
93
|
+
error: number;
|
|
94
|
+
total: number;
|
|
95
|
+
}>;
|
|
96
|
+
//# sourceMappingURL=trade-history.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trade-history.d.ts","sourceRoot":"","sources":["../../../src/prediction/sync/trade-history.ts"],"names":[],"mappings":"AAcA;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC,oDAAoD;IACpD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,oEAAoE;IACpE,UAAU,CAAC,EAAE,KAAK,GAAG,IAAI,GAAG,IAAI,GAAG,KAAK,CAAC;IACzC,iDAAiD;IACjD,OAAO,CAAC,EAAE,KAAK,GAAG,KAAK,CAAC;IACxB,sDAAsD;IACtD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kD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AAE;IACP,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CACnC,GACL,OAAO,CAAC,MAAM,CAAC,CAqDjB;AAED;;;;;GAKG;AACH,wBAAsB,0BAA0B,CAC9C,OAAO,GAAE,uBAA4B,GACpC,OAAO,CAAC,UAAU,CAAC,CAsJrB;AAED;;;;GAIG;AACH,wBAAsB,sBAAsB,CAC1C,OAAO,GAAE,IAAI,CAAC,uBAAuB,EAAE,OAAO,CAAC,GAAG;IAAE,KAAK,CAAC,EAAE,MAAM,CAAA;CAAO,GACxE,OAAO,CAAC,UAAU,CAAC,CAerB;AAED;;;GAGG;AACH,wBAAsB,2BAA2B;;;;;;GAEhD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sync.d.ts","sourceRoot":"","sources":["../../src/prediction/sync.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAEjC,wBAAgB,gBAAgB,IAAI,MAAM,EAAE,CAE3C;AAED,wBAAgB,aAAa,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAE5D"}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Core TypeScript interfaces for the Polymarket Signal Detection System
|
|
3
|
+
*/
|
|
4
|
+
export interface Trigger {
|
|
5
|
+
cents: number;
|
|
6
|
+
minutes: number;
|
|
7
|
+
}
|
|
8
|
+
export interface DetectionConfig {
|
|
9
|
+
minVolumeUsd: number;
|
|
10
|
+
minDaysToResolution: number;
|
|
11
|
+
cooldownMinutes: number;
|
|
12
|
+
alertsPaused: boolean;
|
|
13
|
+
triggers: Trigger[];
|
|
14
|
+
blocklistCategories: string[];
|
|
15
|
+
blocklistKeywords: string[];
|
|
16
|
+
}
|
|
17
|
+
export interface Market {
|
|
18
|
+
id: string;
|
|
19
|
+
conditionId: string;
|
|
20
|
+
question: string;
|
|
21
|
+
slug: string;
|
|
22
|
+
eventSlug: string;
|
|
23
|
+
category: string;
|
|
24
|
+
endDate: Date | null;
|
|
25
|
+
active: boolean;
|
|
26
|
+
volumeNum: number;
|
|
27
|
+
tokenYes: string;
|
|
28
|
+
tokenNo: string;
|
|
29
|
+
}
|
|
30
|
+
export interface PriceSnapshot {
|
|
31
|
+
marketId: string;
|
|
32
|
+
tokenId: string;
|
|
33
|
+
price: number;
|
|
34
|
+
timestamp: Date;
|
|
35
|
+
}
|
|
36
|
+
export interface PriceWindow {
|
|
37
|
+
oldest: number | null;
|
|
38
|
+
latest: number | null;
|
|
39
|
+
oldestTime: Date | null;
|
|
40
|
+
}
|
|
41
|
+
export type Side = "YES" | "NO";
|
|
42
|
+
export interface PriceMovement {
|
|
43
|
+
marketId: string;
|
|
44
|
+
market: Market;
|
|
45
|
+
tokenId: string;
|
|
46
|
+
side: Side;
|
|
47
|
+
priceBefore: number;
|
|
48
|
+
priceAfter: number;
|
|
49
|
+
changePercent: number;
|
|
50
|
+
timeWindowMinutes: number;
|
|
51
|
+
detectedAt: Date;
|
|
52
|
+
}
|
|
53
|
+
export interface Signal {
|
|
54
|
+
movement: PriceMovement;
|
|
55
|
+
enrichments: SignalEnrichments;
|
|
56
|
+
}
|
|
57
|
+
export interface SignalEnrichments {
|
|
58
|
+
trades?: TradeInfo[];
|
|
59
|
+
totalVolumeInWindow?: number;
|
|
60
|
+
topTraders?: TraderInfo[];
|
|
61
|
+
avgTraderScore?: number;
|
|
62
|
+
clusterAnalysis?: ClusterInfo;
|
|
63
|
+
confidenceScore?: number;
|
|
64
|
+
scoreBreakdown?: ScoreBreakdown;
|
|
65
|
+
greeks?: GreeksMetrics;
|
|
66
|
+
}
|
|
67
|
+
export interface GreeksMetrics {
|
|
68
|
+
theta: number;
|
|
69
|
+
vega: number;
|
|
70
|
+
impliedVol: number;
|
|
71
|
+
uncertainty: number;
|
|
72
|
+
daysToExpiry: number;
|
|
73
|
+
}
|
|
74
|
+
export interface TradeInfo {
|
|
75
|
+
txHash: string;
|
|
76
|
+
trader: string;
|
|
77
|
+
side: "BUY" | "SELL";
|
|
78
|
+
size: number;
|
|
79
|
+
price: number;
|
|
80
|
+
timestamp: Date;
|
|
81
|
+
}
|
|
82
|
+
export interface TraderInfo {
|
|
83
|
+
address: string;
|
|
84
|
+
categoryScore: number;
|
|
85
|
+
winRate: number;
|
|
86
|
+
totalPnl: number;
|
|
87
|
+
tradeInSignal: number;
|
|
88
|
+
}
|
|
89
|
+
export interface ClusterInfo {
|
|
90
|
+
totalWallets: number;
|
|
91
|
+
uniqueFundingSources: number;
|
|
92
|
+
largestClusterSize: number;
|
|
93
|
+
coordinationLikelihood: number;
|
|
94
|
+
}
|
|
95
|
+
export interface ScoreBreakdown {
|
|
96
|
+
traderQuality: number;
|
|
97
|
+
independence: number;
|
|
98
|
+
conviction: number;
|
|
99
|
+
context: number;
|
|
100
|
+
}
|
|
101
|
+
export interface Enricher {
|
|
102
|
+
name: string;
|
|
103
|
+
enrich(signal: Signal): Promise<Signal>;
|
|
104
|
+
}
|
|
105
|
+
export interface GammaMarketToken {
|
|
106
|
+
token_id: string;
|
|
107
|
+
outcome: string;
|
|
108
|
+
}
|
|
109
|
+
export interface GammaMarketResponse {
|
|
110
|
+
id: string;
|
|
111
|
+
condition_id?: string;
|
|
112
|
+
question: string;
|
|
113
|
+
slug?: string;
|
|
114
|
+
category?: string;
|
|
115
|
+
end_date_iso?: string;
|
|
116
|
+
active?: boolean;
|
|
117
|
+
volume_num_24hr?: string;
|
|
118
|
+
tokens?: GammaMarketToken[];
|
|
119
|
+
}
|
|
120
|
+
export type ClobPricesResponse = Record<string, string>;
|
|
121
|
+
export interface AlertRecord {
|
|
122
|
+
id: number;
|
|
123
|
+
marketId: string;
|
|
124
|
+
triggerType: string;
|
|
125
|
+
priceBefore: number;
|
|
126
|
+
priceAfter: number;
|
|
127
|
+
changePercent: number;
|
|
128
|
+
timeWindowMinutes: number;
|
|
129
|
+
sentAt: Date;
|
|
130
|
+
}
|
|
131
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/prediction/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAMH,MAAM,WAAW,OAAO;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,eAAe;IAC9B,YAAY,EAAE,MAAM,CAAC;IACrB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,eAAe,EAAE,MAAM,CAAC;IACxB,YAAY,EAAE,OAAO,CAAC;IACtB,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,mBAAmB,EAAE,MAAM,EAAE,CAAC;IAC9B,iBAAiB,EAAE,MAAM,EAAE,CAAC;CAC7B;AAMD,MAAM,WAAW,MAAM;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,IAAI,GAAG,IAAI,CAAC;IACrB,MAAM,EAAE,OAAO,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,IAAI,CAAC;CACjB;AAED,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,UAAU,EAAE,IAAI,GAAG,IAAI,CAAC;CACzB;AAMD,MA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MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IACtB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,MAAM,EAAE,IAAI,CAAC;CACd"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Market Categorization Utility
|
|
3
|
+
* Assigns a primary category to Polymarket markets based on tags and question text
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Categorizes a market based on its tags and question text
|
|
7
|
+
* @param tags - Array of tag strings from the market
|
|
8
|
+
* @param question - The market question text
|
|
9
|
+
* @returns Category string or null if no match found
|
|
10
|
+
*/
|
|
11
|
+
export declare function categorizeMarket(tags: string[], question: string): string | null;
|
|
12
|
+
/**
|
|
13
|
+
* Categorizes a market into a subcategory based on its question text
|
|
14
|
+
* @param category - The primary category (e.g., "Politics", "Sports")
|
|
15
|
+
* @param question - The market question text
|
|
16
|
+
* @param tags - Array of tag strings from the market
|
|
17
|
+
* @returns Subcategory string or null if no match found
|
|
18
|
+
*/
|
|
19
|
+
export declare function categorizeMarketSubcategory(category: string, question: string, tags?: string[]): string | null;
|
|
20
|
+
/**
|
|
21
|
+
* Gets all available subcategories for a given category
|
|
22
|
+
* @param category - The primary category
|
|
23
|
+
* @returns Array of subcategory names
|
|
24
|
+
*/
|
|
25
|
+
export declare function getSubcategoriesForCategory(category: string): string[];
|
|
26
|
+
/**
|
|
27
|
+
* Gets all categories and their subcategories
|
|
28
|
+
* @returns Record of category names to their subcategory arrays
|
|
29
|
+
*/
|
|
30
|
+
export declare function getAllCategoriesWithSubcategories(): Record<string, string[]>;
|
|
31
|
+
/**
|
|
32
|
+
* Parses tags from various formats (string or array)
|
|
33
|
+
* @param tagsData - Tags data that might be a string, array, or already JSON
|
|
34
|
+
* @returns Array of tag strings
|
|
35
|
+
*/
|
|
36
|
+
export declare function parseTags(tagsData: any): string[];
|
|
37
|
+
//# sourceMappingURL=categorizer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"categorizer.d.ts","sourceRoot":"","sources":["../../../src/prediction/utils/categorizer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAkYH;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,MAAM,EAAE,EACd,QAAQ,EAAE,MAAM,GACf,MAAM,GAAG,IAAI,CAmCf;AAED;;;;;;GAMG;AACH,wBAAgB,2BAA2B,CACzC,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,IAAI,GAAE,MAAM,EAAO,GAClB,MAAM,GAAG,IAAI,CAyCf;AAED;;;;GAIG;AACH,wBAAgB,2BAA2B,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,EAAE,CAItE;AAED;;;GAGG;AACH,wBAAgB,iCAAiC,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAM5E;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,QAAQ,EAAE,GAAG,GAAG,MAAM,EAAE,CAejD"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Re-export of the `predictos` package public API.
|
|
3
|
+
*
|
|
4
|
+
* `predictos` is the PredictOS "Super Intelligence" core (prediction-market
|
|
5
|
+
* multi-agent analysis, data clients, and cross-platform arbitrage), adapted
|
|
6
|
+
* from PredictionXBT/PredictOS. See `packages/predictos`.
|
|
7
|
+
*
|
|
8
|
+
* Usage:
|
|
9
|
+
* import { runEventAnalysisAgent, findArbitrage, getEvents } from "investing/predictos";
|
|
10
|
+
*/
|
|
11
|
+
export * from 'predictos';
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/predictos/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,cAAc,WAAW,CAAC"}
|