investing 0.1.310 → 0.1.312

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.
Files changed (286) hide show
  1. package/README.md +123 -167
  2. package/dist/{archiver-web.es-C5dgnXMM.js → archiver-web.es-B69gABHP.js} +1 -1
  3. package/dist/{archiver-web.es-DLoy_R54.cjs → archiver-web.es-fg4bLLZa.cjs} +1 -1
  4. package/dist/bookmakerAnalysis-Bfo1zUVm.js +1 -0
  5. package/dist/bookmakerAnalysis-CHn1W8uX.cjs +1 -0
  6. package/dist/callGrok-D0D7zBHK.js +1 -0
  7. package/dist/callGrok-DWO719mN.cjs +1 -0
  8. package/dist/db/index.d.ts +0 -189
  9. package/dist/db/index.d.ts.map +1 -1
  10. package/dist/db/schema.d.ts +0 -200
  11. package/dist/db/schema.d.ts.map +1 -1
  12. package/dist/events-BJOyGWeU.cjs +1 -0
  13. package/dist/events-OvBb8rgy.js +1 -0
  14. package/dist/index-D7fsk2gy.js +15 -0
  15. package/dist/index-_V1Ql5Es.cjs +13 -0
  16. package/dist/index.d.ts +1 -2
  17. package/dist/index.d.ts.map +1 -1
  18. package/dist/index.js +1 -1
  19. package/dist/index.mjs +1 -1
  20. package/dist/leaders/zulu.d.ts +5 -35
  21. package/dist/leaders/zulu.d.ts.map +1 -1
  22. package/dist/live-data/dukascopy-client.d.ts +2 -19
  23. package/dist/live-data/dukascopy-client.d.ts.map +1 -1
  24. package/dist/llm/debate-generator.d.ts +0 -7
  25. package/dist/llm/debate-generator.d.ts.map +1 -1
  26. package/dist/polymarket-updown-15-limit-order-bot-DCC8HE9Z.cjs +1 -0
  27. package/dist/polymarket-updown-15-limit-order-bot-Dv5oGAF4.js +1 -0
  28. package/dist/prediction/api/analytics.d.ts.map +1 -1
  29. package/dist/prediction/api/leaderboard.d.ts +11 -29
  30. package/dist/prediction/api/leaderboard.d.ts.map +1 -1
  31. package/dist/prediction/api/markets.d.ts.map +1 -1
  32. package/dist/prediction/api/prices.d.ts.map +1 -1
  33. package/dist/prediction/db/markets.d.ts +0 -13
  34. package/dist/prediction/db/markets.d.ts.map +1 -1
  35. package/dist/prediction/db/trade-history.d.ts +0 -35
  36. package/dist/prediction/db/trade-history.d.ts.map +1 -1
  37. package/dist/prediction/index.d.ts +0 -7
  38. package/dist/prediction/index.d.ts.map +1 -1
  39. package/dist/prediction/sync/incremental-markets.d.ts.map +1 -1
  40. package/dist/prediction/sync/leaderboard.d.ts +1 -1
  41. package/dist/prediction/sync/leaderboard.d.ts.map +1 -1
  42. package/dist/prediction/sync/markets.d.ts +2 -2
  43. package/dist/prediction/sync/markets.d.ts.map +1 -1
  44. package/dist/prediction/sync/orchestration.d.ts +1 -1
  45. package/dist/prediction/sync/trade-history.d.ts.map +1 -1
  46. package/dist/predictos/agents/bookmaker-agent.d.ts.map +1 -0
  47. package/dist/predictos/agents/event-analysis-agent.d.ts.map +1 -0
  48. package/dist/{prediction-markets → predictos}/agents/index.d.ts +1 -5
  49. package/dist/predictos/agents/index.d.ts.map +1 -0
  50. package/dist/predictos/agents/index.js +1 -0
  51. package/dist/predictos/agents/index.mjs +1 -0
  52. package/dist/predictos/agents/mapper-agent.d.ts.map +1 -0
  53. package/dist/{prediction-markets → predictos}/agents/polyfactual-research.d.ts +1 -1
  54. package/dist/predictos/agents/polyfactual-research.d.ts.map +1 -0
  55. package/dist/predictos/agents/polymarket-position-tracker.d.ts.map +1 -0
  56. package/dist/{prediction-markets → predictos}/agents/polymarket-put-order.d.ts +1 -1
  57. package/dist/predictos/agents/polymarket-put-order.d.ts.map +1 -0
  58. package/dist/predictos/agents/polymarket-updown-15-limit-order-bot.d.ts.map +1 -0
  59. package/dist/predictos/agents/x402-seller.d.ts.map +1 -0
  60. package/dist/predictos/ai/callBlockRun.d.ts.map +1 -0
  61. package/dist/predictos/ai/callGrok.d.ts.map +1 -0
  62. package/dist/predictos/ai/callOpenAI.d.ts.map +1 -0
  63. package/dist/predictos/ai/http.d.ts.map +1 -0
  64. package/dist/{prediction-markets → predictos}/ai/index.d.ts +1 -1
  65. package/dist/predictos/ai/index.d.ts.map +1 -0
  66. package/dist/predictos/ai/index.js +1 -0
  67. package/dist/predictos/ai/index.mjs +1 -0
  68. package/dist/predictos/ai/prompts/analyzeEventMarkets.d.ts.map +1 -0
  69. package/dist/predictos/ai/prompts/arbitrageAnalysis.d.ts.map +1 -0
  70. package/dist/predictos/ai/prompts/bookmakerAnalysis.d.ts.map +1 -0
  71. package/dist/predictos/ai/prompts/searchQueryGenerator.d.ts.map +1 -0
  72. package/dist/predictos/ai/types.d.ts.map +1 -0
  73. package/dist/predictos/arbitrage.d.ts.map +1 -0
  74. package/dist/predictos/arbitrage.js +1 -0
  75. package/dist/predictos/arbitrage.mjs +1 -0
  76. package/dist/{prediction-markets → predictos}/clients/polyfactual.d.ts +1 -1
  77. package/dist/predictos/clients/polyfactual.d.ts.map +1 -0
  78. package/dist/{prediction-markets → predictos}/clients/polymarket.d.ts +1 -1
  79. package/dist/predictos/clients/polymarket.d.ts.map +1 -0
  80. package/dist/{prediction-markets → predictos}/clients/x402.d.ts +1 -1
  81. package/dist/predictos/clients/x402.d.ts.map +1 -0
  82. package/dist/{prediction-markets → predictos}/data/kalshi.d.ts +1 -1
  83. package/dist/predictos/data/kalshi.d.ts.map +1 -0
  84. package/dist/predictos/data/kalshi.js +1 -0
  85. package/dist/predictos/data/kalshi.mjs +1 -0
  86. package/dist/{prediction-markets → predictos}/data/polymarket.d.ts +1 -1
  87. package/dist/predictos/data/polymarket.d.ts.map +1 -0
  88. package/dist/predictos/data/polymarket.js +1 -0
  89. package/dist/predictos/data/polymarket.mjs +1 -0
  90. package/dist/predictos/events.d.ts.map +1 -0
  91. package/dist/{prediction-markets → predictos}/index.d.ts +5 -8
  92. package/dist/predictos/index.d.ts.map +1 -0
  93. package/dist/predictos/index.js +1 -0
  94. package/dist/predictos/index.mjs +1 -0
  95. package/dist/{prediction-markets → predictos}/types.d.ts +6 -121
  96. package/dist/predictos/types.d.ts.map +1 -0
  97. package/dist/searchQueryGenerator-DIIs9xw5.js +1 -0
  98. package/dist/searchQueryGenerator-rCVblXJS.cjs +1 -0
  99. package/dist/stocks/index.d.ts +1 -2
  100. package/dist/stocks/index.d.ts.map +1 -1
  101. package/dist/stocks/quote-cache-service.d.ts +2 -11
  102. package/dist/stocks/quote-cache-service.d.ts.map +1 -1
  103. package/dist/stocks/unified-quote-service.d.ts +6 -15
  104. package/dist/stocks/unified-quote-service.d.ts.map +1 -1
  105. package/dist/stocks/yahoo-finance-wrapper.d.ts +6 -75
  106. package/dist/stocks/yahoo-finance-wrapper.d.ts.map +1 -1
  107. package/dist/trading-agents/agents/debate-facilitator.d.ts +3 -3
  108. package/dist/trading-agents/agents/debate-facilitator.d.ts.map +1 -1
  109. package/dist/trading-agents/agents/fund-manager.d.ts +2 -4
  110. package/dist/trading-agents/agents/fund-manager.d.ts.map +1 -1
  111. package/dist/trading-agents/agents/improved-researchers.d.ts +3 -3
  112. package/dist/trading-agents/agents/improved-researchers.d.ts.map +1 -1
  113. package/dist/trading-agents/agents/market-analyst.d.ts +2 -2
  114. package/dist/trading-agents/agents/market-analyst.d.ts.map +1 -1
  115. package/dist/trading-agents/agents/news-analyst.d.ts +2 -2
  116. package/dist/trading-agents/agents/news-analyst.d.ts.map +1 -1
  117. package/dist/trading-agents/agents/researchers.d.ts +4 -4
  118. package/dist/trading-agents/agents/researchers.d.ts.map +1 -1
  119. package/dist/trading-agents/agents/risk-team.d.ts +4 -4
  120. package/dist/trading-agents/agents/risk-team.d.ts.map +1 -1
  121. package/dist/trading-agents/agents/trader.d.ts +2 -2
  122. package/dist/trading-agents/agents/trader.d.ts.map +1 -1
  123. package/dist/trading-agents/graph/trading-graph.d.ts +2 -28
  124. package/dist/trading-agents/graph/trading-graph.d.ts.map +1 -1
  125. package/dist/trading-agents/index.d.ts +0 -4
  126. package/dist/trading-agents/index.d.ts.map +1 -1
  127. package/dist/trading-agents/types/index.d.ts +4 -27
  128. package/dist/trading-agents/types/index.d.ts.map +1 -1
  129. package/dist/trading-agents/utils/llm-client.d.ts +1 -4
  130. package/dist/trading-agents/utils/llm-client.d.ts.map +1 -1
  131. package/package.json +50 -21
  132. package/THIRD_PARTY_NOTICES.md +0 -144
  133. package/dist/index-6F5HGB0V.js +0 -15
  134. package/dist/index-kfghRBr2.cjs +0 -13
  135. package/dist/prediction/analysis/polymarket-wallet-trust.d.ts +0 -60
  136. package/dist/prediction/analysis/polymarket-wallet-trust.d.ts.map +0 -1
  137. package/dist/prediction/analysis/position-reconstruction.d.ts +0 -130
  138. package/dist/prediction/analysis/position-reconstruction.d.ts.map +0 -1
  139. package/dist/prediction/analysis/position-settlement.d.ts +0 -99
  140. package/dist/prediction/analysis/position-settlement.d.ts.map +0 -1
  141. package/dist/prediction/analysis/r-multiple.d.ts +0 -159
  142. package/dist/prediction/analysis/r-multiple.d.ts.map +0 -1
  143. package/dist/prediction/analysis/trust-score.d.ts +0 -158
  144. package/dist/prediction/analysis/trust-score.d.ts.map +0 -1
  145. package/dist/prediction/sync/refill-limits.d.ts +0 -9
  146. package/dist/prediction/sync/refill-limits.d.ts.map +0 -1
  147. package/dist/prediction/sync/refill.d.ts +0 -34
  148. package/dist/prediction/sync/refill.d.ts.map +0 -1
  149. package/dist/prediction/utils/token-ids.d.ts +0 -17
  150. package/dist/prediction/utils/token-ids.d.ts.map +0 -1
  151. package/dist/prediction-markets/adapters/trading-agents.d.ts +0 -21
  152. package/dist/prediction-markets/adapters/trading-agents.d.ts.map +0 -1
  153. package/dist/prediction-markets/agents/bookmaker-agent.d.ts.map +0 -1
  154. package/dist/prediction-markets/agents/event-analysis-agent.d.ts.map +0 -1
  155. package/dist/prediction-markets/agents/index.d.ts.map +0 -1
  156. package/dist/prediction-markets/agents/kalshi-momentum-agent.d.ts +0 -7
  157. package/dist/prediction-markets/agents/kalshi-momentum-agent.d.ts.map +0 -1
  158. package/dist/prediction-markets/agents/mapper-agent.d.ts.map +0 -1
  159. package/dist/prediction-markets/agents/polyfactual-research.d.ts.map +0 -1
  160. package/dist/prediction-markets/agents/polymarket-position-tracker.d.ts.map +0 -1
  161. package/dist/prediction-markets/agents/polymarket-put-order.d.ts.map +0 -1
  162. package/dist/prediction-markets/agents/polymarket-updown-15-limit-order-bot.d.ts.map +0 -1
  163. package/dist/prediction-markets/agents/x402-seller.d.ts.map +0 -1
  164. package/dist/prediction-markets/ai/callBlockRun.d.ts.map +0 -1
  165. package/dist/prediction-markets/ai/callGrok.d.ts.map +0 -1
  166. package/dist/prediction-markets/ai/callOpenAI.d.ts.map +0 -1
  167. package/dist/prediction-markets/ai/http.d.ts.map +0 -1
  168. package/dist/prediction-markets/ai/index.d.ts.map +0 -1
  169. package/dist/prediction-markets/ai/prompts/analyzeEventMarkets.d.ts.map +0 -1
  170. package/dist/prediction-markets/ai/prompts/arbitrageAnalysis.d.ts.map +0 -1
  171. package/dist/prediction-markets/ai/prompts/bookmakerAnalysis.d.ts.map +0 -1
  172. package/dist/prediction-markets/ai/prompts/searchQueryGenerator.d.ts.map +0 -1
  173. package/dist/prediction-markets/ai/types.d.ts.map +0 -1
  174. package/dist/prediction-markets/arbitrage.d.ts.map +0 -1
  175. package/dist/prediction-markets/clients/polyfactual.d.ts.map +0 -1
  176. package/dist/prediction-markets/clients/polymarket.d.ts.map +0 -1
  177. package/dist/prediction-markets/clients/x402.d.ts.map +0 -1
  178. package/dist/prediction-markets/data/kalshi.d.ts.map +0 -1
  179. package/dist/prediction-markets/data/polymarket.d.ts.map +0 -1
  180. package/dist/prediction-markets/events.d.ts.map +0 -1
  181. package/dist/prediction-markets/execution/paper.d.ts +0 -19
  182. package/dist/prediction-markets/execution/paper.d.ts.map +0 -1
  183. package/dist/prediction-markets/index.cjs +0 -1
  184. package/dist/prediction-markets/index.d.ts.map +0 -1
  185. package/dist/prediction-markets/index.mjs +0 -1
  186. package/dist/prediction-markets/kalshi-momentum.LICENSE +0 -21
  187. package/dist/prediction-markets/strategies/btc15m-fusion.d.ts +0 -27
  188. package/dist/prediction-markets/strategies/btc15m-fusion.d.ts.map +0 -1
  189. package/dist/prediction-markets/strategies/copy-trade-sizing.d.ts +0 -27
  190. package/dist/prediction-markets/strategies/copy-trade-sizing.d.ts.map +0 -1
  191. package/dist/prediction-markets/strategies/gabagool.d.ts +0 -26
  192. package/dist/prediction-markets/strategies/gabagool.d.ts.map +0 -1
  193. package/dist/prediction-markets/strategies/kalshi-momentum.d.ts +0 -13
  194. package/dist/prediction-markets/strategies/kalshi-momentum.d.ts.map +0 -1
  195. package/dist/prediction-markets/types.d.ts.map +0 -1
  196. package/dist/prediction-markets/validation.d.ts +0 -5
  197. package/dist/prediction-markets/validation.d.ts.map +0 -1
  198. package/dist/scripted-llm-B-UTs08L.js +0 -1
  199. package/dist/scripted-llm-CmDVkhyH.cjs +0 -1
  200. package/dist/stocks/strategies/bb-rsi-breakout.d.ts +0 -63
  201. package/dist/stocks/strategies/bb-rsi-breakout.d.ts.map +0 -1
  202. package/dist/stocks/strategies/ema-crossover.d.ts +0 -51
  203. package/dist/stocks/strategies/ema-crossover.d.ts.map +0 -1
  204. package/dist/strategy-signals/data/fixture-data-provider.d.ts +0 -8
  205. package/dist/strategy-signals/data/fixture-data-provider.d.ts.map +0 -1
  206. package/dist/strategy-signals/data/openbb-mapping.d.ts +0 -7
  207. package/dist/strategy-signals/data/openbb-mapping.d.ts.map +0 -1
  208. package/dist/strategy-signals/demo.d.ts +0 -446
  209. package/dist/strategy-signals/demo.d.ts.map +0 -1
  210. package/dist/strategy-signals/execution.d.ts +0 -18
  211. package/dist/strategy-signals/execution.d.ts.map +0 -1
  212. package/dist/strategy-signals/fixtures/openbb-data/bars.d.ts +0 -10
  213. package/dist/strategy-signals/fixtures/openbb-data/bars.d.ts.map +0 -1
  214. package/dist/strategy-signals/index.d.ts +0 -36
  215. package/dist/strategy-signals/index.d.ts.map +0 -1
  216. package/dist/strategy-signals/indicators/spread-aware-momentum.d.ts +0 -31
  217. package/dist/strategy-signals/indicators/spread-aware-momentum.d.ts.map +0 -1
  218. package/dist/strategy-signals/proposal.d.ts +0 -10
  219. package/dist/strategy-signals/proposal.d.ts.map +0 -1
  220. package/dist/strategy-signals/report.d.ts +0 -6
  221. package/dist/strategy-signals/report.d.ts.map +0 -1
  222. package/dist/strategy-signals/risk-gate.d.ts +0 -3
  223. package/dist/strategy-signals/risk-gate.d.ts.map +0 -1
  224. package/dist/strategy-signals/sources/btc15m-fusion.d.ts +0 -16
  225. package/dist/strategy-signals/sources/btc15m-fusion.d.ts.map +0 -1
  226. package/dist/strategy-signals/sources/copy-trade-sizing.d.ts +0 -15
  227. package/dist/strategy-signals/sources/copy-trade-sizing.d.ts.map +0 -1
  228. package/dist/strategy-signals/sources/gabagool.d.ts +0 -12
  229. package/dist/strategy-signals/sources/gabagool.d.ts.map +0 -1
  230. package/dist/strategy-signals/sources/hedge-fund-technicals.d.ts +0 -42
  231. package/dist/strategy-signals/sources/hedge-fund-technicals.d.ts.map +0 -1
  232. package/dist/strategy-signals/sources/kalshi-momentum.d.ts +0 -10
  233. package/dist/strategy-signals/sources/kalshi-momentum.d.ts.map +0 -1
  234. package/dist/strategy-signals/sources/kalshi-vibe-guards.d.ts +0 -15
  235. package/dist/strategy-signals/sources/kalshi-vibe-guards.d.ts.map +0 -1
  236. package/dist/strategy-signals/sources/kalshi-vibe.d.ts +0 -11
  237. package/dist/strategy-signals/sources/kalshi-vibe.d.ts.map +0 -1
  238. package/dist/strategy-signals/sources/red-flags.d.ts +0 -13
  239. package/dist/strategy-signals/sources/red-flags.d.ts.map +0 -1
  240. package/dist/strategy-signals/sources/spread-aware-momentum.d.ts +0 -11
  241. package/dist/strategy-signals/sources/spread-aware-momentum.d.ts.map +0 -1
  242. package/dist/strategy-signals/survival-posture.d.ts +0 -13
  243. package/dist/strategy-signals/survival-posture.d.ts.map +0 -1
  244. package/dist/strategy-signals/types.d.ts +0 -138
  245. package/dist/strategy-signals/types.d.ts.map +0 -1
  246. package/dist/strategy-signals/validate.d.ts +0 -15
  247. package/dist/strategy-signals/validate.d.ts.map +0 -1
  248. package/dist/strategy-signals/venues/kalshi-venue-mapping.d.ts +0 -3
  249. package/dist/strategy-signals/venues/kalshi-venue-mapping.d.ts.map +0 -1
  250. package/dist/strategy-signals/venues/mock-equity-broker.d.ts +0 -16
  251. package/dist/strategy-signals/venues/mock-equity-broker.d.ts.map +0 -1
  252. package/dist/strategy-signals/venues/mock-venue.d.ts +0 -14
  253. package/dist/strategy-signals/venues/mock-venue.d.ts.map +0 -1
  254. package/dist/strategy-signals/venues/pmxt-venue-mapping.d.ts +0 -7
  255. package/dist/strategy-signals/venues/pmxt-venue-mapping.d.ts.map +0 -1
  256. package/dist/trading-agents/agents/risk-judge.d.ts +0 -13
  257. package/dist/trading-agents/agents/risk-judge.d.ts.map +0 -1
  258. package/dist/trading-agents/index.cjs +0 -1
  259. package/dist/trading-agents/index.mjs +0 -1
  260. package/dist/trading-agents/utils/parse-final-line.d.ts +0 -7
  261. package/dist/trading-agents/utils/parse-final-line.d.ts.map +0 -1
  262. package/dist/trading-agents/utils/scripted-llm.d.ts +0 -17
  263. package/dist/trading-agents/utils/scripted-llm.d.ts.map +0 -1
  264. package/dist/trading-agents/utils/strategy-prompt.d.ts +0 -6
  265. package/dist/trading-agents/utils/strategy-prompt.d.ts.map +0 -1
  266. package/dist/trading-agents-Bh9OORHe.js +0 -1
  267. package/dist/trading-agents-C8M7tbB0.cjs +0 -1
  268. package/dist/validate-C1MS8RhG.js +0 -1
  269. package/dist/validate-DBxPUXqH.cjs +0 -1
  270. /package/dist/{prediction-markets → predictos}/agents/bookmaker-agent.d.ts +0 -0
  271. /package/dist/{prediction-markets → predictos}/agents/event-analysis-agent.d.ts +0 -0
  272. /package/dist/{prediction-markets → predictos}/agents/mapper-agent.d.ts +0 -0
  273. /package/dist/{prediction-markets → predictos}/agents/polymarket-position-tracker.d.ts +0 -0
  274. /package/dist/{prediction-markets → predictos}/agents/polymarket-updown-15-limit-order-bot.d.ts +0 -0
  275. /package/dist/{prediction-markets → predictos}/agents/x402-seller.d.ts +0 -0
  276. /package/dist/{prediction-markets → predictos}/ai/callBlockRun.d.ts +0 -0
  277. /package/dist/{prediction-markets → predictos}/ai/callGrok.d.ts +0 -0
  278. /package/dist/{prediction-markets → predictos}/ai/callOpenAI.d.ts +0 -0
  279. /package/dist/{prediction-markets → predictos}/ai/http.d.ts +0 -0
  280. /package/dist/{prediction-markets → predictos}/ai/prompts/analyzeEventMarkets.d.ts +0 -0
  281. /package/dist/{prediction-markets → predictos}/ai/prompts/arbitrageAnalysis.d.ts +0 -0
  282. /package/dist/{prediction-markets → predictos}/ai/prompts/bookmakerAnalysis.d.ts +0 -0
  283. /package/dist/{prediction-markets → predictos}/ai/prompts/searchQueryGenerator.d.ts +0 -0
  284. /package/dist/{prediction-markets → predictos}/ai/types.d.ts +0 -0
  285. /package/dist/{prediction-markets → predictos}/arbitrage.d.ts +0 -0
  286. /package/dist/{prediction-markets → predictos}/events.d.ts +0 -0
package/README.md CHANGED
@@ -4,26 +4,30 @@
4
4
 
5
5
  <!-- template-git-repo:badges:start -->
6
6
  <p align="center">
7
- <a href="https://docs.autoinvestment.broker/"><img src="https://img.shields.io/badge/Docs-blue?logo=ReadTheDocs&logoColor=white" alt="Documentation" /></a>
7
+ <a href="https://qwksearch.com/api"><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/ai-broker-investing-agent/stargazers"><img src="https://img.shields.io/github/stars/OpenSourceAGI/ai-broker-investing-agent" alt="GitHub Stars" /></a>
9
+ <a href="https://github.com/OpenSourceAGI/qwksearch-research-agent/stargazers"><img src="https://img.shields.io/github/stars/OpenSourceAGI/qwksearch-research-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/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>
16
+ <a href="https://github.com/OpenSourceAGI/qwksearch-research-agent/issues"><img src="https://img.shields.io/github/issues/OpenSourceAGI/qwksearch-research-agent?logo=github" alt="GitHub Issues" /></a>
17
+ <a href="https://github.com/OpenSourceAGI/qwksearch-research-agent/pulls"><img src="https://img.shields.io/github/issues-pr/OpenSourceAGI/qwksearch-research-agent?logo=github&label=PRs" alt="Open Pull Requests" /></a>
18
+ <a href="https://github.com/OpenSourceAGI/qwksearch-research-agent/pulls?q=is%3Apr+is%3Aclosed"><img src="https://img.shields.io/github/issues-pr-closed/OpenSourceAGI/qwksearch-research-agent?logo=github&label=PRs%20merged&color=8957e5" alt="Merged Pull Requests" /></a>
19
+ <a href="https://github.com/OpenSourceAGI/qwksearch-research-agent/discussions"><img src="https://img.shields.io/github/discussions/OpenSourceAGI/qwksearch-research-agent" alt="GitHub Discussions" /></a>
20
+ <a href="https://github.com/OpenSourceAGI/qwksearch-research-agent/commits/master/"><img src="https://img.shields.io/github/last-commit/OpenSourceAGI/qwksearch-research-agent.svg" alt="GitHub last commit" /></a>
21
21
  <br />
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>
22
+ <a href="https://stackblitz.com/github/OpenSourceAGI/qwksearch-research-agent/tree/master/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 -->
26
26
 
27
+ <!-- skills:install:start -->
28
+ **🤖 Agent skill** — `npx skills@latest add https://github.com/OpenSourceAGI/qwksearch-research-agent --skill investing` ([what it covers](../../skills/investing/SKILL.md))
29
+ <!-- skills:install:end -->
30
+
27
31
  # Investing Library
28
32
 
29
33
  A comprehensive TypeScript/JavaScript library for investment analysis, trading automation, and financial data processing. This package provides reusable utilities for building investment applications, trading bots, and financial analysis tools.
@@ -33,98 +37,14 @@ A comprehensive TypeScript/JavaScript library for investment analysis, trading a
33
37
  - 🤖 **Trading Agents** - Multi-agent framework for automated trading strategies
34
38
  - 📊 **Stock Data** - Fetch and analyze stock data from Yahoo Finance, SEC filings, and more
35
39
  - 💹 **Prediction Markets** - Polymarket integration for prediction market data
40
+ - 🔮 **PredictOS Core** - Multi-agent prediction-market analysis, Kalshi/Polymarket
41
+ data clients, and cross-platform arbitrage (merged in from the `predictos` package)
36
42
  - 🔌 **Alpaca Trading API** - Easy-to-use wrapper for Alpaca trading platform
37
43
  - 📈 **Technical Analysis** - Algorithmic trading strategies and indicators
38
44
  - 🎯 **Social Trading** - Track and analyze top traders and strategies
39
45
  - 🧠 **AI-Powered Analysis** - LLM-based investment research and debate generation
40
46
  - 📦 **Data Files** - Pre-packaged stock indexes, sector information, and market data
41
47
 
42
- ## Third-party strategy signals
43
-
44
- The source integration connects all ten vendored project folders to the agent
45
- pipeline through pure sources, venue/data mappings and a survival risk posture.
46
- The [integration overview](../../devdocs/third-party-trading-bots-overview.md)
47
- records each project's runtime, license, native assessment and operational scope.
48
- Full notices ship in [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md).
49
-
50
- From the repository root, run the credential-free paper demo in Docker:
51
-
52
- ```bash
53
- bash devdocs/third-party-integration/harness/run.sh install
54
- bash devdocs/third-party-integration/harness/run.sh demo
55
- ```
56
-
57
- The image uses pinned Bun 1.3.11 with Node/native build prerequisites. Dependencies
58
- live in container-only volumes; the staged repository excludes credentials and
59
- host node_modules. Tests and the demo run with `--network=none`.
60
-
61
- The demo first prints a readable summary: six numbered stages per run (strategy,
62
- normalized signal, research input, Trader, Portfolio Manager, execution). It then
63
- prints the full JSON trace: signals → report → proposal → Trader → risk debate → judge →
64
- verdict → Fund Manager → approval → fill → account snapshots. It includes momentum
65
- BUY/SELL, Vibe YES/NO, BTC bullish/bearish, copy sizing, sequential Gabagool targets,
66
- PyKalshi and pmxt mappings, OpenBB-backed stock BUY/SELL and Defensive sizing.
67
- The pmxt fixture opts into explicitly synthetic quotes; a point price is not a
68
- live executable quote. Models are scripted and all prices/forecasts are fixtures.
69
-
70
- Source consumers can opt into the new stage with the fourth graph argument and
71
- the third `propagate` argument:
72
-
73
- ```typescript
74
- // Source-level example inside packages/investing. Avoid src/index.ts: it loads
75
- // native dependencies and dotenv. Built package/subpath imports remain broken.
76
- import { TradingAgentsGraph } from './src/trading-agents/graph/trading-graph'
77
- import { kalshiMomentumSource } from './src/strategy-signals/sources/kalshi-momentum'
78
-
79
- const graph = new TradingAgentsGraph([], false, undefined, {
80
- llm: { deep: suppliedLLM, quick: suppliedLLM },
81
- riskReview: true,
82
- riskLimits: { maxPositionPerMarket: 50, maxOpenPositions: 5 },
83
- })
84
- const context = { account: venue.snapshot(), evaluationTime }
85
- const strategySignals = kalshiMomentumSource.run({ ticks }, context)
86
- const result = await graph.propagate(market.title, evaluationTime.slice(0, 10), {
87
- instrument: { type: 'event', venue: venue.venue, marketId: market.marketId },
88
- strategySignals,
89
- account: context.account,
90
- evaluationTime,
91
- event: market,
92
- sources: { [kalshiMomentumSource.id]: kalshiMomentumSource },
93
- })
94
- if (result.state.approval) await venue.execute(result.state.approval)
95
- ```
96
-
97
- The caller supplies the LLM, current venue/account, market and evaluation time. With `riskReview: true`, an `account` snapshot is required for stocks too: without one the gate cannot check cash or holdings, so the run ends at HOLD.
98
- Register each executable source so its freshness and guards can run; unregistered
99
- third-party proposals fail closed. Event runs skip stock analysts. Fixture stock
100
- runs select no external analysts and execute an Alpaca-shaped order against
101
- `MockEquityBroker` after a cash/share preflight. Existing callers without `run`
102
- retain byte-identical prompts; risk review is opt-in.
103
-
104
- Every executable result binds to one selected `proposalId`. BLOCK means HOLD;
105
- REDUCE supplies a whole-number cap. Final quantity is the minimum of the proposal,
106
- common/source risk caps, judge cap and Fund Manager quantity. Invalid model output
107
- or model errors cannot grant approval. Red flags remain advisory input. Forecast
108
- guards/Kelly apply only to genuine forecasts, never a substituted market price.
109
-
110
- Gabagool portfolio targets execute one leg per call, recomputed from actual
111
- holdings and fill costs. A rejected leg does not create a holding. Strategy prices
112
- retain decimal-cent precision; the paper execution bridge rejects unsupported
113
- sub-cent prices. Fractional weighted average costs are valid account values.
114
- Survival multipliers (1 / 1 / 0.75 / 0.5 / 0) are new demo policy, not upstream rules.
115
-
116
- Verification commands are `run.sh test`, `test-root`, `tsc`, `build`, `coverage`
117
- and `pack`. The type gate permits only reproduced pre-existing diagnostic
118
- identities/occurrences; it does not claim a clean TypeScript build. Coverage is
119
- reported for the new module and changed graph/risk-judge files.
120
-
121
- **Scope:** source-level fixture/paper execution only. Built exports, the web app
122
- and Workers runtime are not validated by this demo. Live broker/venue execution,
123
- an execution ledger, portfolio versioning and concurrency control are outside
124
- this integration. Current snapshots must be refreshed and callers must serialize
125
- execution. See the [workflow](../../devdocs/third-party-integration/skills/integrate-trading-bot/SKILL.md)
126
- to add a source, mapping or posture.
127
-
128
48
  ## Installation
129
49
 
130
50
  ```bash
@@ -197,68 +117,36 @@ const leaders = await fetchLeaderboard({
197
117
  });
198
118
  ```
199
119
 
200
- ### Kalshi Momentum Paper Agent
120
+ ### PredictOS — Prediction-Market Analysis & Arbitrage
201
121
 
202
- The prediction-markets package includes a deterministic TypeScript port of the
203
- momentum rules from PyKalshi's MIT-licensed
204
- `kalshi-bot-api/examples/momentum_bot.py`. It consumes recorded ticks and uses
205
- an in-memory paper executor, so it never connects to Kalshi, submits orders, or
206
- requires credentials.
122
+ ```typescript
123
+ import {
124
+ runEventAnalysisAgent,
125
+ findArbitrage,
126
+ getEvents,
127
+ } from "investing/predictos";
207
128
 
208
- Run the included replay from `packages/investing`:
129
+ const url = "https://polymarket.com/event/will-x-happen-by-2026";
209
130
 
210
- ```bash
211
- bun run demo:kalshi-momentum
212
- ```
131
+ // Resolve a Polymarket / Kalshi / Jupiter event URL into its raw markets
132
+ const event = await getEvents({ url });
213
133
 
214
- ```typescript
215
- import { runKalshiMomentumPaperAgent } from "investing/prediction-markets";
216
-
217
- const result = runKalshiMomentumPaperAgent({
218
- initialCashCents: 10_000,
219
- ticks: [50, 51, 52, 53, 58].map((yesPriceCents, index) => ({
220
- ticker: "DEMO-KALSHI-MARKET",
221
- timestamp: new Date(Date.UTC(2026, 0, 1, 0, index)).toISOString(),
222
- yesPriceCents,
223
- })),
134
+ // Analyze those markets for alpha and a predicted winner
135
+ const { analysis } = await runEventAnalysisAgent({
136
+ markets: event.markets,
137
+ eventIdentifier: event.eventIdentifier,
138
+ pmType: event.pmType,
139
+ model: "grok-4-fast",
140
+ tools: ["x_search"], // Grok models only
224
141
  });
225
142
 
226
- console.log(result.report);
143
+ // Look for the same event mispriced on the other venue
144
+ const arb = await findArbitrage({ url, model: "grok-4-fast" });
227
145
  ```
228
146
 
229
- Prices are integer cents per contract. A YES tick of `53` implies a NO price
230
- of `47`. Trade `action` (`BUY`, `SELL`, `HOLD`) is separate from the binary
231
- `outcome` (`YES`, `NO`): selling YES closes YES contracts and does not mean
232
- buying NO.
233
-
234
- Configuration controls `lookback`, `momentumThreshold`, `positionSize`,
235
- `profitTargetCents`, `stopLossCents`, and `maxPosition`. The defaults preserve
236
- the upstream example: three consecutive moves, 10 contracts, a 5-cent target,
237
- a 3-cent stop, and a 50-contract limit. The paper executor fills immediately at
238
- the recorded outcome price with no fees or slippage and reports cash, open
239
- positions, and realized/unrealized P&L.
240
-
241
- This replay is a strategy demonstration, not a backtest or live execution
242
- system. It assumes complementary YES/NO prices, does not model an order book,
243
- partial fills, fees, latency, settlement, or market resolution, and does not
244
- enable the existing unimplemented Kalshi live mapper.
245
-
246
- The recorded demo also runs actionable intents through the existing
247
- strategy-signal graph, research judge, Trader, risk review and proposal-bound
248
- FundManager before this same paper executor. It requires no keys or services.
249
- The original synchronous API remains direct strategy/paper replay.
250
-
251
- For graph review, use `runKalshiMomentumPaperAgentWithResearch` and
252
- `reviewPredictionMarketIntent`. Configure the existing graph with
253
- `riskReview: true`, and pass `{ fundManagerReview: true }` to the review
254
- adapter to require unchanged explicit approval. MODIFY, missing approval or
255
- a changed quantity becomes HOLD for this replay; the executor retains its
256
- own cash, inventory and combined market-position checks.
257
-
258
- After building, run `node scripts/verify-prediction-market-build.mjs` to check
259
- actual ESM/CommonJS subpaths and the packaged MIT notice. See the
260
- [walkthrough](../../devdocs/prediction-markets-agent-system-walkthrough.md) for
261
- the full flow and the recorded result of $100.50 cash and $0.50 realized P&L.
147
+ Every entry point takes a typed `request` object and an optional second
148
+ `config` (`AIConfig` / `DataConfig`) that falls back to `process.env`. Missing
149
+ required fields **throw** rather than returning an error result.
262
150
 
263
151
  ### Trading Agents Framework
264
152
 
@@ -364,7 +252,7 @@ Get Polymarket leaderboard of top traders.
364
252
  - `limit` - Number of results (default: 20)
365
253
  - `category` - Market category (default: 'overall')
366
254
 
367
- ### Prediction-Market Agents & Arbitrage
255
+ ### PredictOS Core
368
256
 
369
257
  ```typescript
370
258
  import {
@@ -373,26 +261,80 @@ import {
373
261
  runMapperAgent,
374
262
  findArbitrage,
375
263
  getEvents,
376
- } from "investing/prediction-markets";
264
+ } from "investing/predictos";
377
265
  ```
378
266
 
379
- Multi-agent analysis over Polymarket and Kalshi, refactored from Deno/Supabase
380
- edge functions into plain typed async functions (MIT, see
381
- `src/prediction-markets/LICENSE`):
382
-
383
- - **AI clients** — OpenAI, Grok/xAI and BlockRun (x402 micropayments), plus the
384
- analysis prompt builders.
385
- - **Market data** — Kalshi via DFlow and Polymarket via Dome/Gamma.
386
- - `runEventAnalysisAgent` — analyzes an event's markets for alpha and a
387
- predicted winner.
388
- - `runBookmakerAgent` — aggregates several agent analyses into one assessment.
389
- - `runMapperAgent` — turns an analysis into Polymarket order parameters.
390
- - `findArbitrage` — finds the same event on the other venue and checks whether
391
- it is mispriced across venues.
392
- - `getEvents` — resolves a Polymarket/Kalshi URL into its raw markets.
393
-
394
- Keys are read from options, falling back to `OPENAI_API_KEY`, `XAI_API_KEY`,
395
- `BLOCKRUN_WALLET_KEY`, `DOME_API_KEY` and `DFLOW_API_KEY`.
267
+ > Adapted from [PredictOS](https://github.com/PredictionXBT/PredictOS) by
268
+ > **PredictionXBT** (MIT licensed, © 2025). The original code shipped as
269
+ > Deno/Supabase edge functions; here it is refactored into plain, typed,
270
+ > dependency-light library functions with no HTTP/CORS layer. It lived in a
271
+ > sibling `predictos` package until that package was merged into `investing`.
272
+ > See [`NOTICE`](./NOTICE) and
273
+ > [`LICENSE-PredictOS-MIT`](./LICENSE-PredictOS-MIT).
274
+
275
+ #### What it covers
276
+
277
+ - **AI provider clients** — OpenAI (Responses API), Grok/xAI (Responses API,
278
+ with optional `x_search` / `web_search` tools), and BlockRun (x402
279
+ wallet-based micropayments across 20+ models), plus the analysis prompt
280
+ builders (`analyzeEventMarkets`, `bookmakerAnalysis`, `arbitrageAnalysis`,
281
+ `searchQueryGenerator`).
282
+ - **Market data clients** — Kalshi via the DFlow API
283
+ (`investing/predictos/data/kalshi`) and Polymarket via the Dome API
284
+ (`investing/predictos/data/polymarket`).
285
+ - **Multi-agent pipeline** (`investing/predictos/agents`):
286
+ - `runEventAnalysisAgent` — analyzes an event's markets for alpha and a
287
+ predicted winner.
288
+ - `runBookmakerAgent` — aggregates multiple agent analyses (and optional
289
+ external data sources) into a single consolidated assessment.
290
+ - `runMapperAgent` — turns an analysis into Polymarket order parameters
291
+ (pure logic; Kalshi mapping not yet implemented).
292
+ - **Cross-platform arbitrage** (`investing/predictos/arbitrage`) —
293
+ `findArbitrage` parses a Polymarket/Kalshi URL, generates a search query with
294
+ AI, searches the other platform, and evaluates whether the same event is
295
+ mispriced across venues.
296
+ - **Event fetching** (`getEvents`) — resolves a Polymarket/Kalshi/Jupiter URL
297
+ into its raw markets (Kalshi via DFlow, Polymarket via the Gamma API).
298
+
299
+ #### Subpath exports
300
+
301
+ | Import | Contents |
302
+ | --- | --- |
303
+ | `investing/predictos` | Everything (barrel) |
304
+ | `investing/predictos/ai` | AI clients + prompt builders |
305
+ | `investing/predictos/data/kalshi` | Kalshi (DFlow) data client |
306
+ | `investing/predictos/data/polymarket` | Polymarket (Dome) data client |
307
+ | `investing/predictos/agents` | `runEventAnalysisAgent`, `runBookmakerAgent`, `runMapperAgent` |
308
+ | `investing/predictos/arbitrage` | `findArbitrage` |
309
+
310
+ The barrel re-exports the Kalshi (DFlow) client at the top level. The Polymarket
311
+ (Dome) client exposes Kalshi helpers under the same names, so the barrel renames
312
+ those two to `getDomeKalshiMarketsByEvent` / `buildDomeKalshiMarketUrl` — import
313
+ from `investing/predictos/data/polymarket` for their original names. The
314
+ Gamma/CLOB trading client, Polyfactual and x402 are namespaced on the barrel as
315
+ `polymarketClob`, `polyfactual` and `x402` for the same reason.
316
+
317
+ #### Refactor notes (Deno → Node)
318
+
319
+ - Deno HTTP handlers (`Deno.serve`, `new Response(...)`, CORS headers) were
320
+ removed. Each endpoint is now a plain exported async function taking typed
321
+ parameters and returning a typed result; validation failures `throw`.
322
+ - `Deno.env.get("X")` was replaced with config/options objects
323
+ (`AIConfig`, `DataConfig`, per-call `apiKey`/`walletKey`) that fall back to
324
+ `process.env` (`OPENAI_API_KEY`, `XAI_API_KEY`, `BLOCKRUN_WALLET_KEY`,
325
+ `DOME_API_KEY`, `DFLOW_API_KEY`). No secrets are hardcoded.
326
+ - Remote (`https://...`) and `npm:` import specifiers were replaced with normal
327
+ package imports (`ethers`). The global `fetch` (Node 18+) is used throughout.
328
+ - Prompt text and analysis logic are preserved verbatim.
329
+
330
+ #### Not ported (yet)
331
+
332
+ Intentionally left out of the core port — noted for future work: the Next.js
333
+ `terminal/` frontend, the Python alpha-hunter examples, the **pay.sh** payment
334
+ serving flows, **Irys** verifiable-agent storage, wallet-tracking websockets, and
335
+ on-chain order execution (the mapper produces order parameters, but placing
336
+ orders is out of scope). The BlockRun client *is* ported (it only needs `ethers`
337
+ + `fetch`), but its on-chain micropayment flow is untested in this environment.
396
338
 
397
339
  ### Trading Agents
398
340
 
@@ -473,6 +415,12 @@ ALPACA_SECRET=your_secret_here
473
415
  # OpenAI for AI-powered analysis
474
416
  OPENAI_API_KEY=your_openai_key
475
417
 
418
+ # PredictOS: prediction-market analysis and data
419
+ XAI_API_KEY=your_xai_key # Grok/xAI
420
+ BLOCKRUN_WALLET_KEY=your_wallet_key # BlockRun x402 micropayments
421
+ DOME_API_KEY=your_dome_key # Polymarket market data
422
+ DFLOW_API_KEY=your_dflow_key # Kalshi market data
423
+
476
424
  # Optional: Alternative LLM providers
477
425
  ANTHROPIC_API_KEY=your_anthropic_key
478
426
  GOOGLE_API_KEY=your_google_key
@@ -585,7 +533,15 @@ See the `/examples` directory for complete working examples:
585
533
 
586
534
  - [GitHub Repository](https://github.com/vtempest/ai-broker-investment-agent)
587
535
  - [Documentation](https://invest.vtempest.com/docs)
536
+ - [Agent skill](../../skills/investing/SKILL.md)
588
537
  - [Examples](./examples)
589
538
 
539
+ ## Credits
540
+
541
+ The `predictos` module is a derivative work of
542
+ [PredictOS](https://github.com/PredictionXBT/PredictOS) — all original design and
543
+ logic © 2025 PredictionXBT, MIT licensed. See [`NOTICE`](./NOTICE) and
544
+ [`LICENSE-PredictOS-MIT`](./LICENSE-PredictOS-MIT).
545
+
590
546
  - [GitHub Issues](https://github.com/vtempest/ai-broker-investment-agent/issues)
591
547
  - [Documentation](https://invest.vtempest.com/docs)