clodds 1.2.9 → 1.4.0

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 (263) hide show
  1. package/dist/skills/bundled/acp/SKILL.md +188 -0
  2. package/dist/skills/bundled/acp/index.d.ts +0 -3
  3. package/dist/skills/bundled/acp/index.js +1 -1
  4. package/dist/skills/bundled/acp/index.js.map +1 -1
  5. package/dist/skills/bundled/agentbets/SKILL.md +19 -0
  6. package/dist/skills/bundled/agentbets/index.js +1 -1
  7. package/dist/skills/bundled/agentbets/index.js.map +1 -1
  8. package/dist/skills/bundled/ai-strategy/SKILL.md +111 -0
  9. package/dist/skills/bundled/ai-strategy/index.js +1 -1
  10. package/dist/skills/bundled/ai-strategy/index.js.map +1 -1
  11. package/dist/skills/bundled/alerts/SKILL.md +87 -0
  12. package/dist/skills/bundled/analytics/SKILL.md +252 -0
  13. package/dist/skills/bundled/analytics/index.js +2 -2
  14. package/dist/skills/bundled/analytics/index.js.map +1 -1
  15. package/dist/skills/bundled/arbitrage/SKILL.md +287 -0
  16. package/dist/skills/bundled/arbitrage/index.js +6 -1
  17. package/dist/skills/bundled/arbitrage/index.js.map +1 -1
  18. package/dist/skills/bundled/auto-reply/SKILL.md +285 -0
  19. package/dist/skills/bundled/auto-reply/index.js +2 -2
  20. package/dist/skills/bundled/auto-reply/index.js.map +1 -1
  21. package/dist/skills/bundled/automation/SKILL.md +242 -0
  22. package/dist/skills/bundled/automation/index.js +2 -2
  23. package/dist/skills/bundled/automation/index.js.map +1 -1
  24. package/dist/skills/bundled/backtest/SKILL.md +225 -0
  25. package/dist/skills/bundled/bags/SKILL.md +131 -0
  26. package/dist/skills/bundled/bankr/SKILL.md +114 -0
  27. package/dist/skills/bundled/betfair/SKILL.md +113 -0
  28. package/dist/skills/bundled/binance-futures/SKILL.md +84 -0
  29. package/dist/skills/bundled/binance-futures/index.d.ts +0 -3
  30. package/dist/skills/bundled/binance-futures/index.js +1 -2
  31. package/dist/skills/bundled/binance-futures/index.js.map +1 -1
  32. package/dist/skills/bundled/botchan/SKILL.md +66 -0
  33. package/dist/skills/bundled/botchan/index.d.ts +0 -3
  34. package/dist/skills/bundled/botchan/index.js +0 -1
  35. package/dist/skills/bundled/botchan/index.js.map +1 -1
  36. package/dist/skills/bundled/bridge/SKILL.md +215 -0
  37. package/dist/skills/bundled/bridge/index.js +6 -0
  38. package/dist/skills/bundled/bridge/index.js.map +1 -1
  39. package/dist/skills/bundled/bybit-futures/SKILL.md +84 -0
  40. package/dist/skills/bundled/bybit-futures/index.d.ts +0 -3
  41. package/dist/skills/bundled/bybit-futures/index.js +0 -1
  42. package/dist/skills/bundled/bybit-futures/index.js.map +1 -1
  43. package/dist/skills/bundled/clanker/SKILL.md +125 -0
  44. package/dist/skills/bundled/clanker/index.d.ts +0 -3
  45. package/dist/skills/bundled/clanker/index.js +0 -1
  46. package/dist/skills/bundled/clanker/index.js.map +1 -1
  47. package/dist/skills/bundled/copy-trading/SKILL.md +285 -0
  48. package/dist/skills/bundled/copy-trading/index.js +15 -8
  49. package/dist/skills/bundled/copy-trading/index.js.map +1 -1
  50. package/dist/skills/bundled/copy-trading-solana/SKILL.md +66 -0
  51. package/dist/skills/bundled/credentials/SKILL.md +261 -0
  52. package/dist/skills/bundled/credentials/index.js +4 -0
  53. package/dist/skills/bundled/credentials/index.js.map +1 -1
  54. package/dist/skills/bundled/crypto-hft/SKILL.md +121 -0
  55. package/dist/skills/bundled/crypto-hft/index.js +18 -3
  56. package/dist/skills/bundled/crypto-hft/index.js.map +1 -1
  57. package/dist/skills/bundled/dca/SKILL.md +27 -0
  58. package/dist/skills/bundled/dex/SKILL.md +92 -0
  59. package/dist/skills/bundled/dex/index.js +77 -29
  60. package/dist/skills/bundled/dex/index.js.map +1 -1
  61. package/dist/skills/bundled/divergence/SKILL.md +83 -0
  62. package/dist/skills/bundled/doctor/SKILL.md +267 -0
  63. package/dist/skills/bundled/doctor/index.js +2 -8
  64. package/dist/skills/bundled/doctor/index.js.map +1 -1
  65. package/dist/skills/bundled/drift/SKILL.md +53 -0
  66. package/dist/skills/bundled/drift-sdk/SKILL.md +103 -0
  67. package/dist/skills/bundled/drift-sdk/index.d.ts +0 -3
  68. package/dist/skills/bundled/drift-sdk/index.js +0 -1
  69. package/dist/skills/bundled/drift-sdk/index.js.map +1 -1
  70. package/dist/skills/bundled/edge/SKILL.md +84 -0
  71. package/dist/skills/bundled/embeddings/SKILL.md +244 -0
  72. package/dist/skills/bundled/endaoment/SKILL.md +65 -0
  73. package/dist/skills/bundled/endaoment/index.d.ts +0 -3
  74. package/dist/skills/bundled/endaoment/index.js +0 -1
  75. package/dist/skills/bundled/endaoment/index.js.map +1 -1
  76. package/dist/skills/bundled/ens/SKILL.md +63 -0
  77. package/dist/skills/bundled/ens/index.d.ts +0 -3
  78. package/dist/skills/bundled/ens/index.js +0 -1
  79. package/dist/skills/bundled/ens/index.js.map +1 -1
  80. package/dist/skills/bundled/erc8004/SKILL.md +79 -0
  81. package/dist/skills/bundled/erc8004/index.d.ts +0 -3
  82. package/dist/skills/bundled/erc8004/index.js +0 -1
  83. package/dist/skills/bundled/erc8004/index.js.map +1 -1
  84. package/dist/skills/bundled/execution/SKILL.md +278 -0
  85. package/dist/skills/bundled/farcaster/SKILL.md +80 -0
  86. package/dist/skills/bundled/farcaster/index.js +12 -0
  87. package/dist/skills/bundled/farcaster/index.js.map +1 -1
  88. package/dist/skills/bundled/features/SKILL.md +20 -0
  89. package/dist/skills/bundled/feeds/SKILL.md +288 -0
  90. package/dist/skills/bundled/harden/SKILL.md +74 -0
  91. package/dist/skills/bundled/history/SKILL.md +257 -0
  92. package/dist/skills/bundled/hyperliquid/SKILL.md +200 -0
  93. package/dist/skills/bundled/hyperliquid/index.d.ts +0 -3
  94. package/dist/skills/bundled/hyperliquid/index.js +0 -1
  95. package/dist/skills/bundled/hyperliquid/index.js.map +1 -1
  96. package/dist/skills/bundled/identity/SKILL.md +228 -0
  97. package/dist/skills/bundled/identity/index.js +2 -2
  98. package/dist/skills/bundled/identity/index.js.map +1 -1
  99. package/dist/skills/bundled/integrations/SKILL.md +321 -0
  100. package/dist/skills/bundled/integrations/index.js +2 -2
  101. package/dist/skills/bundled/integrations/index.js.map +1 -1
  102. package/dist/skills/bundled/jupiter/SKILL.md +163 -0
  103. package/dist/skills/bundled/jupiter/index.js +2 -2
  104. package/dist/skills/bundled/kamino/SKILL.md +69 -0
  105. package/dist/skills/bundled/ledger/SKILL.md +20 -0
  106. package/dist/skills/bundled/lighter/SKILL.md +83 -0
  107. package/dist/skills/bundled/lighter/index.d.ts +0 -3
  108. package/dist/skills/bundled/lighter/index.js +0 -1
  109. package/dist/skills/bundled/lighter/index.js.map +1 -1
  110. package/dist/skills/bundled/marginfi/SKILL.md +62 -0
  111. package/dist/skills/bundled/market-index/SKILL.md +242 -0
  112. package/dist/skills/bundled/market-index/index.js +1 -3
  113. package/dist/skills/bundled/market-index/index.js.map +1 -1
  114. package/dist/skills/bundled/markets/SKILL.md +49 -0
  115. package/dist/skills/bundled/mcp/SKILL.md +235 -0
  116. package/dist/skills/bundled/mcp/index.js +1 -3
  117. package/dist/skills/bundled/mcp/index.js.map +1 -1
  118. package/dist/skills/bundled/memory/SKILL.md +209 -0
  119. package/dist/skills/bundled/metaculus/SKILL.md +62 -0
  120. package/dist/skills/bundled/metaculus/index.js +4 -1
  121. package/dist/skills/bundled/metaculus/index.js.map +1 -1
  122. package/dist/skills/bundled/meteora/SKILL.md +28 -0
  123. package/dist/skills/bundled/meteora-dbc/SKILL.md +25 -0
  124. package/dist/skills/bundled/metrics/SKILL.md +338 -0
  125. package/dist/skills/bundled/mev/SKILL.md +239 -0
  126. package/dist/skills/bundled/mev/index.js +2 -2
  127. package/dist/skills/bundled/mev/index.js.map +1 -1
  128. package/dist/skills/bundled/mexc-futures/SKILL.md +86 -0
  129. package/dist/skills/bundled/mexc-futures/index.d.ts +0 -3
  130. package/dist/skills/bundled/mexc-futures/index.js +0 -1
  131. package/dist/skills/bundled/mexc-futures/index.js.map +1 -1
  132. package/dist/skills/bundled/mm/SKILL.md +142 -0
  133. package/dist/skills/bundled/mm/index.js +28 -27
  134. package/dist/skills/bundled/mm/index.js.map +1 -1
  135. package/dist/skills/bundled/monitoring/SKILL.md +249 -0
  136. package/dist/skills/bundled/news/SKILL.md +95 -0
  137. package/dist/skills/bundled/news/index.js +1 -2
  138. package/dist/skills/bundled/news/index.js.map +1 -1
  139. package/dist/skills/bundled/onchainkit/SKILL.md +83 -0
  140. package/dist/skills/bundled/opinion/SKILL.md +87 -0
  141. package/dist/skills/bundled/opportunity/SKILL.md +308 -0
  142. package/dist/skills/bundled/orca/SKILL.md +28 -0
  143. package/dist/skills/bundled/orca/index.js +11 -7
  144. package/dist/skills/bundled/orca/index.js.map +1 -1
  145. package/dist/skills/bundled/pairing/SKILL.md +275 -0
  146. package/dist/skills/bundled/pancakeswap/SKILL.md +93 -0
  147. package/dist/skills/bundled/pancakeswap/index.d.ts +0 -3
  148. package/dist/skills/bundled/pancakeswap/index.js +0 -1
  149. package/dist/skills/bundled/pancakeswap/index.js.map +1 -1
  150. package/dist/skills/bundled/percolator/SKILL.md +22 -0
  151. package/dist/skills/bundled/permissions/SKILL.md +269 -0
  152. package/dist/skills/bundled/permissions/index.js +2 -2
  153. package/dist/skills/bundled/permissions/index.js.map +1 -1
  154. package/dist/skills/bundled/plugins/SKILL.md +263 -0
  155. package/dist/skills/bundled/plugins/index.js +2 -2
  156. package/dist/skills/bundled/plugins/index.js.map +1 -1
  157. package/dist/skills/bundled/portfolio/SKILL.md +161 -0
  158. package/dist/skills/bundled/portfolio/index.js +1 -1
  159. package/dist/skills/bundled/portfolio/index.js.map +1 -1
  160. package/dist/skills/bundled/portfolio-sync/SKILL.md +466 -0
  161. package/dist/skills/bundled/positions/SKILL.md +262 -0
  162. package/dist/skills/bundled/predictfun/SKILL.md +109 -0
  163. package/dist/skills/bundled/predictfun/index.js +1 -1
  164. package/dist/skills/bundled/predictfun/index.js.map +1 -1
  165. package/dist/skills/bundled/predictit/SKILL.md +66 -0
  166. package/dist/skills/bundled/predictit/index.js +4 -1
  167. package/dist/skills/bundled/predictit/index.js.map +1 -1
  168. package/dist/skills/bundled/presence/SKILL.md +217 -0
  169. package/dist/skills/bundled/presence/index.js +2 -2
  170. package/dist/skills/bundled/presence/index.js.map +1 -1
  171. package/dist/skills/bundled/processes/SKILL.md +254 -0
  172. package/dist/skills/bundled/pump-swarm/SKILL.md +309 -0
  173. package/dist/skills/bundled/pumpfun/SKILL.md +145 -0
  174. package/dist/skills/bundled/pumpfun/index.js +82 -8
  175. package/dist/skills/bundled/pumpfun/index.js.map +1 -1
  176. package/dist/skills/bundled/qmd/SKILL.md +129 -0
  177. package/dist/skills/bundled/qrcoin/SKILL.md +60 -0
  178. package/dist/skills/bundled/qrcoin/index.d.ts +0 -3
  179. package/dist/skills/bundled/qrcoin/index.js +0 -1
  180. package/dist/skills/bundled/qrcoin/index.js.map +1 -1
  181. package/dist/skills/bundled/raydium/SKILL.md +198 -0
  182. package/dist/skills/bundled/remote/SKILL.md +201 -0
  183. package/dist/skills/bundled/research/SKILL.md +83 -0
  184. package/dist/skills/bundled/research/index.js +2 -2
  185. package/dist/skills/bundled/research/index.js.map +1 -1
  186. package/dist/skills/bundled/risk/SKILL.md +323 -0
  187. package/dist/skills/bundled/router/SKILL.md +233 -0
  188. package/dist/skills/bundled/routing/SKILL.md +258 -0
  189. package/dist/skills/bundled/sandbox/SKILL.md +257 -0
  190. package/dist/skills/bundled/search-config/SKILL.md +257 -0
  191. package/dist/skills/bundled/search-config/index.js +2 -2
  192. package/dist/skills/bundled/search-config/index.js.map +1 -1
  193. package/dist/skills/bundled/sessions/SKILL.md +251 -0
  194. package/dist/skills/bundled/sessions/index.js +1 -1
  195. package/dist/skills/bundled/sessions/index.js.map +1 -1
  196. package/dist/skills/bundled/setup/SKILL.md +53 -0
  197. package/dist/skills/bundled/shield/SKILL.md +21 -0
  198. package/dist/skills/bundled/signals/SKILL.md +106 -0
  199. package/dist/skills/bundled/signals/index.d.ts +0 -3
  200. package/dist/skills/bundled/signals/index.js +3 -4
  201. package/dist/skills/bundled/signals/index.js.map +1 -1
  202. package/dist/skills/bundled/sizing/SKILL.md +238 -0
  203. package/dist/skills/bundled/slippage/SKILL.md +306 -0
  204. package/dist/skills/bundled/smarkets/SKILL.md +107 -0
  205. package/dist/skills/bundled/smarkets/index.js +3 -3
  206. package/dist/skills/bundled/smarkets/index.js.map +1 -1
  207. package/dist/skills/bundled/solend/SKILL.md +63 -0
  208. package/dist/skills/bundled/strategy/SKILL.md +266 -0
  209. package/dist/skills/bundled/streaming/SKILL.md +150 -0
  210. package/dist/skills/bundled/streaming/index.js +2 -2
  211. package/dist/skills/bundled/streaming/index.js.map +1 -1
  212. package/dist/skills/bundled/tailscale/SKILL.md +249 -0
  213. package/dist/skills/bundled/tailscale/index.js +2 -2
  214. package/dist/skills/bundled/tailscale/index.js.map +1 -1
  215. package/dist/skills/bundled/ticks/SKILL.md +61 -0
  216. package/dist/skills/bundled/token-security/SKILL.md +18 -0
  217. package/dist/skills/bundled/trading-evm/SKILL.md +329 -0
  218. package/dist/skills/bundled/trading-futures/SKILL.md +865 -0
  219. package/dist/skills/bundled/trading-kalshi/SKILL.md +629 -0
  220. package/dist/skills/bundled/trading-kalshi/index.js +2 -0
  221. package/dist/skills/bundled/trading-kalshi/index.js.map +1 -1
  222. package/dist/skills/bundled/trading-manifold/SKILL.md +387 -0
  223. package/dist/skills/bundled/trading-polymarket/SKILL.md +1080 -0
  224. package/dist/skills/bundled/trading-polymarket/index.js +28 -19
  225. package/dist/skills/bundled/trading-polymarket/index.js.map +1 -1
  226. package/dist/skills/bundled/trading-solana/SKILL.md +418 -0
  227. package/dist/skills/bundled/trading-solana/index.js +1 -1
  228. package/dist/skills/bundled/trading-solana/index.js.map +1 -1
  229. package/dist/skills/bundled/trading-system/SKILL.md +290 -0
  230. package/dist/skills/bundled/triggers/SKILL.md +433 -0
  231. package/dist/skills/bundled/tts/SKILL.md +220 -0
  232. package/dist/skills/bundled/tweet-ideas/SKILL.md +77 -0
  233. package/dist/skills/bundled/usage/SKILL.md +239 -0
  234. package/dist/skills/bundled/usage/index.js +2 -2
  235. package/dist/skills/bundled/usage/index.js.map +1 -1
  236. package/dist/skills/bundled/veil/SKILL.md +76 -0
  237. package/dist/skills/bundled/veil/index.d.ts +0 -3
  238. package/dist/skills/bundled/veil/index.js +0 -1
  239. package/dist/skills/bundled/veil/index.js.map +1 -1
  240. package/dist/skills/bundled/verify/SKILL.md +199 -0
  241. package/dist/skills/bundled/verify/index.d.ts +0 -3
  242. package/dist/skills/bundled/verify/index.js +0 -1
  243. package/dist/skills/bundled/verify/index.js.map +1 -1
  244. package/dist/skills/bundled/virtuals/SKILL.md +82 -0
  245. package/dist/skills/bundled/voice/SKILL.md +217 -0
  246. package/dist/skills/bundled/voice/index.js +2 -2
  247. package/dist/skills/bundled/voice/index.js.map +1 -1
  248. package/dist/skills/bundled/weather/SKILL.md +80 -0
  249. package/dist/skills/bundled/weather/index.js +3 -0
  250. package/dist/skills/bundled/weather/index.js.map +1 -1
  251. package/dist/skills/bundled/webhooks/SKILL.md +297 -0
  252. package/dist/skills/bundled/webhooks/index.js +2 -2
  253. package/dist/skills/bundled/webhooks/index.js.map +1 -1
  254. package/dist/skills/bundled/whale-tracking/SKILL.md +287 -0
  255. package/dist/skills/bundled/whale-tracking/index.js +2 -2
  256. package/dist/skills/bundled/whale-tracking/index.js.map +1 -1
  257. package/dist/skills/bundled/yoink/SKILL.md +54 -0
  258. package/dist/skills/bundled/yoink/index.d.ts +0 -3
  259. package/dist/skills/bundled/yoink/index.js +0 -1
  260. package/dist/skills/bundled/yoink/index.js.map +1 -1
  261. package/dist/skills/executor.js +5 -3
  262. package/dist/skills/executor.js.map +1 -1
  263. package/package.json +2 -2
@@ -0,0 +1,225 @@
1
+ ---
2
+ name: backtest
3
+ description: "Test trading strategies on historical data with Monte Carlo simulation"
4
+ emoji: "📈"
5
+ ---
6
+
7
+ # Backtest - Complete API Reference
8
+
9
+ Validate trading strategies using historical data, walk-forward analysis, and Monte Carlo simulation.
10
+
11
+ ---
12
+
13
+ ## Chat Commands
14
+
15
+ ### Run Backtest
16
+
17
+ ```
18
+ /backtest momentum --from 2024-01-01 --to 2024-12-31
19
+ /backtest mean-reversion --market "Trump 2028" --days 90
20
+ /backtest my-strategy --capital 10000
21
+ ```
22
+
23
+ ### Quick Stats
24
+
25
+ ```
26
+ /backtest stats momentum Show strategy metrics
27
+ /backtest compare momentum arb Compare two strategies
28
+ /backtest monte-carlo momentum Run Monte Carlo simulation
29
+ ```
30
+
31
+ ### Results
32
+
33
+ ```
34
+ /backtest results Show recent results
35
+ /backtest results <id> --detailed Detailed breakdown
36
+ /backtest export <id> Export to CSV
37
+ ```
38
+
39
+ ---
40
+
41
+ ## TypeScript API Reference
42
+
43
+ ### Create Backtest Engine
44
+
45
+ ```typescript
46
+ import { createBacktestEngine } from 'clodds/backtest';
47
+
48
+ const backtest = createBacktestEngine({
49
+ // Data source
50
+ dataSource: 'polymarket', // or custom data provider
51
+
52
+ // Capital
53
+ initialCapital: 10000,
54
+
55
+ // Fees (Polymarket: 0% on most markets; Kalshi: ~1.2% avg)
56
+ fees: {
57
+ maker: 0, // 0% maker fee (Polymarket most markets)
58
+ taker: 0, // 0% taker fee (Polymarket most markets)
59
+ // For 15-min crypto markets or Kalshi, use: taker: 0.012
60
+ },
61
+
62
+ // Slippage model
63
+ slippageModel: 'realistic', // 'none' | 'fixed' | 'realistic'
64
+ slippageBps: 10,
65
+ });
66
+ ```
67
+
68
+ ### Run Basic Backtest
69
+
70
+ ```typescript
71
+ const result = await backtest.run({
72
+ strategy: 'momentum',
73
+ startDate: '2024-01-01',
74
+ endDate: '2024-12-31',
75
+ parameters: {
76
+ lookbackPeriod: 14,
77
+ entryThreshold: 0.02,
78
+ exitThreshold: 0.01,
79
+ },
80
+ });
81
+
82
+ console.log(`Total Return: ${result.totalReturn}%`);
83
+ console.log(`Sharpe Ratio: ${result.sharpeRatio}`);
84
+ console.log(`Max Drawdown: ${result.maxDrawdown}%`);
85
+ console.log(`Win Rate: ${result.winRate}%`);
86
+ console.log(`Profit Factor: ${result.profitFactor}`);
87
+ ```
88
+
89
+ ### Walk-Forward Analysis
90
+
91
+ ```typescript
92
+ // Out-of-sample validation
93
+ const wf = await backtest.walkForward({
94
+ strategy: 'momentum',
95
+ startDate: '2023-01-01',
96
+ endDate: '2024-12-31',
97
+
98
+ // Train/test split
99
+ trainPeriod: '6M',
100
+ testPeriod: '1M',
101
+ step: '1M',
102
+
103
+ // Optimization
104
+ optimize: ['lookbackPeriod', 'entryThreshold'],
105
+ optimizationMetric: 'sharpe',
106
+ });
107
+
108
+ console.log(`In-Sample Sharpe: ${wf.inSampleSharpe}`);
109
+ console.log(`Out-of-Sample Sharpe: ${wf.outOfSampleSharpe}`);
110
+ console.log(`Overfitting Ratio: ${wf.overfitRatio}`);
111
+ ```
112
+
113
+ ### Monte Carlo Simulation
114
+
115
+ ```typescript
116
+ // Stress test with randomization
117
+ const mc = await backtest.monteCarlo({
118
+ strategy: 'momentum',
119
+ trades: historicalTrades,
120
+
121
+ // Simulation settings
122
+ simulations: 10000,
123
+ confidenceLevel: 0.95,
124
+
125
+ // Randomization
126
+ shuffleTrades: true,
127
+ randomizeReturns: true,
128
+ });
129
+
130
+ console.log(`Expected Return: ${mc.expectedReturn}%`);
131
+ console.log(`95% VaR: ${mc.valueAtRisk}%`);
132
+ console.log(`Worst Case: ${mc.worstCase}%`);
133
+ console.log(`Best Case: ${mc.bestCase}%`);
134
+ console.log(`Probability of Profit: ${mc.probProfit}%`);
135
+ ```
136
+
137
+ ### Performance Metrics
138
+
139
+ ```typescript
140
+ const metrics = await backtest.getMetrics(result);
141
+
142
+ console.log('=== Performance ===');
143
+ console.log(`Total Return: ${metrics.totalReturn}%`);
144
+ console.log(`CAGR: ${metrics.cagr}%`);
145
+ console.log(`Volatility: ${metrics.volatility}%`);
146
+
147
+ console.log('=== Risk ===');
148
+ console.log(`Sharpe Ratio: ${metrics.sharpeRatio}`);
149
+ console.log(`Sortino Ratio: ${metrics.sortinoRatio}`);
150
+ console.log(`Max Drawdown: ${metrics.maxDrawdown}%`);
151
+ console.log(`Max Drawdown Duration: ${metrics.maxDrawdownDuration} days`);
152
+
153
+ console.log('=== Trading ===');
154
+ console.log(`Total Trades: ${metrics.totalTrades}`);
155
+ console.log(`Win Rate: ${metrics.winRate}%`);
156
+ console.log(`Profit Factor: ${metrics.profitFactor}`);
157
+ console.log(`Avg Win: ${metrics.avgWin}%`);
158
+ console.log(`Avg Loss: ${metrics.avgLoss}%`);
159
+ console.log(`Expectancy: ${metrics.expectancy}%`);
160
+ ```
161
+
162
+ ### Custom Strategy
163
+
164
+ ```typescript
165
+ // Define custom strategy
166
+ const myStrategy = {
167
+ name: 'my-strategy',
168
+
169
+ onData: async (data, context) => {
170
+ const price = data.price;
171
+ const sma = data.indicators.sma(20);
172
+
173
+ if (price < sma * 0.95 && !context.hasPosition) {
174
+ return { action: 'buy', size: context.availableCapital * 0.1 };
175
+ }
176
+
177
+ if (price > sma * 1.05 && context.hasPosition) {
178
+ return { action: 'sell', size: 'all' };
179
+ }
180
+
181
+ return { action: 'hold' };
182
+ },
183
+ };
184
+
185
+ const result = await backtest.run({
186
+ strategy: myStrategy,
187
+ startDate: '2024-01-01',
188
+ endDate: '2024-12-31',
189
+ });
190
+ ```
191
+
192
+ ---
193
+
194
+ ## Built-in Strategies
195
+
196
+ | Strategy | Description |
197
+ |----------|-------------|
198
+ | `momentum` | Follow price trends |
199
+ | `mean-reversion` | Buy dips, sell rallies |
200
+ | `arbitrage` | Cross-platform price differences |
201
+ | `breakout` | Enter on range breakouts |
202
+ | `pairs` | Correlated market pairs |
203
+
204
+ ---
205
+
206
+ ## Metrics Explained
207
+
208
+ | Metric | Good Value | Description |
209
+ |--------|------------|-------------|
210
+ | **Sharpe Ratio** | > 1.0 | Risk-adjusted return |
211
+ | **Sortino Ratio** | > 1.5 | Downside-adjusted return |
212
+ | **Max Drawdown** | < 20% | Worst peak-to-trough |
213
+ | **Win Rate** | > 50% | Winning trades % |
214
+ | **Profit Factor** | > 1.5 | Gross profit / gross loss |
215
+ | **Expectancy** | > 0 | Expected $ per trade |
216
+
217
+ ---
218
+
219
+ ## Best Practices
220
+
221
+ 1. **Use walk-forward** — Avoid overfitting
222
+ 2. **Include fees** — Realistic cost modeling
223
+ 3. **Test multiple periods** — Don't cherry-pick dates
224
+ 4. **Monte Carlo** — Understand variance
225
+ 5. **Out-of-sample** — Always validate on unseen data
@@ -0,0 +1,131 @@
1
+ ---
2
+ name: bags
3
+ description: "Bags.fm - Complete Solana token launchpad with creator monetization"
4
+ command: bags
5
+ emoji: "💰"
6
+ gates:
7
+ envs:
8
+ - BAGS_API_KEY
9
+ ---
10
+
11
+ # Bags.fm - Complete API Coverage
12
+
13
+ Bags.fm is a Solana token launchpad and trading platform with creator monetization. Creators earn 1% of all trading volume on their tokens.
14
+
15
+ ## Trading
16
+
17
+ ```
18
+ /bags quote <amount> <from> to <to> Get swap quote
19
+ /bags swap <amount> <from> to <to> Execute swap
20
+ ```
21
+
22
+ ## Discovery
23
+
24
+ ```
25
+ /bags pools List all Bags pools
26
+ /bags trending Show trending tokens by volume
27
+ /bags token <mint> Full token info (metadata, creators, fees, market data)
28
+ /bags creators <mint> Get token creators and fee shares
29
+ /bags lifetime-fees <mint> Total fees collected for a token
30
+ ```
31
+
32
+ ## Fee Claiming
33
+
34
+ ```
35
+ /bags fees [wallet] Check claimable fees (all positions)
36
+ /bags claim [wallet] Claim all accumulated fees
37
+ /bags claim-events <mint> [--from X] [--to Y] Get claim history with time filters
38
+ /bags stats <mint> Per-claimer statistics
39
+ ```
40
+
41
+ ## Token Launch
42
+
43
+ ```
44
+ /bags launch <name> <symbol> <desc> [options] Launch new token
45
+ /bags launch-info Show launch requirements and fees
46
+ ```
47
+
48
+ **Launch Options:**
49
+ - `--image <url>` - Token image URL
50
+ - `--twitter <handle>` - Twitter handle
51
+ - `--website <url>` - Website URL
52
+ - `--telegram <url>` - Telegram URL
53
+ - `--initial <SOL>` - Initial buy amount in SOL
54
+
55
+ ## Fee Share Configuration
56
+
57
+ ```
58
+ /bags fee-config <mint> <wallet:bps>... Create fee distribution (bps must sum to 10000)
59
+ ```
60
+
61
+ **Examples:**
62
+ ```
63
+ /bags fee-config <mint> wallet1:5000 wallet2:5000 # 50/50 split
64
+ /bags fee-config <mint> wallet1:7000 wallet2:3000 # 70/30 split
65
+ ```
66
+
67
+ ## Wallet Lookup (Social -> Wallet)
68
+
69
+ ```
70
+ /bags wallet <provider> <username> Lookup wallet by social handle
71
+ /bags wallets <provider> <user1,user2> Bulk wallet lookup
72
+ ```
73
+
74
+ **Providers:** twitter, github, kick, tiktok, instagram, onlyfans, solana, apple, google, email, moltbook
75
+
76
+ ## Partner System
77
+
78
+ ```
79
+ /bags partner-config <mint> Create partner key for referral fees
80
+ /bags partner-claim [wallet] Claim accumulated partner fees
81
+ /bags partner-stats <partner-key> View partner statistics
82
+ ```
83
+
84
+ ## Examples
85
+
86
+ ```
87
+ # Trading
88
+ /bags quote 1 SOL to USDC
89
+ /bags swap 0.5 SOL to BONK
90
+
91
+ # Discovery
92
+ /bags trending
93
+ /bags token ABC123...
94
+
95
+ # Launch a token
96
+ /bags launch "Moon Token" MOON "To the moon!" --twitter moontoken --initial 0.1
97
+
98
+ # Check and claim fees
99
+ /bags fees
100
+ /bags claim
101
+
102
+ # Set up 50/50 fee share
103
+ /bags fee-config <mint> wallet1:5000 wallet2:5000
104
+
105
+ # Lookup wallet by Twitter
106
+ /bags wallet twitter elonmusk
107
+ ```
108
+
109
+ ## Configuration
110
+
111
+ ```bash
112
+ export BAGS_API_KEY="your-api-key" # From dev.bags.fm
113
+ export SOLANA_PRIVATE_KEY="your-private-key" # For signing swaps/launches
114
+ ```
115
+
116
+ ## API Reference
117
+
118
+ - Base URL: `https://public-api-v2.bags.fm/api/v1/`
119
+ - Auth: `x-api-key` header
120
+ - Rate limit: 1000 requests/hour
121
+ - Get your API key at [dev.bags.fm](https://dev.bags.fm)
122
+
123
+ ## Features
124
+
125
+ - Token launching with 1% creator fees
126
+ - Up to 100 fee claimers per token (with automatic lookup tables)
127
+ - Meteora DAMM v2 pool integration
128
+ - Virtual pool and custom vault fee claiming
129
+ - Partner referral system
130
+ - Social wallet lookup (Twitter, GitHub, Kick, TikTok)
131
+ - Jito bundle support for launches
@@ -0,0 +1,114 @@
1
+ ---
2
+ name: bankr
3
+ description: "AI-powered crypto trading via natural language through Bankr API"
4
+ command: bankr
5
+ emoji: "🏦"
6
+ gates:
7
+ envs:
8
+ - BANKR_API_KEY
9
+ ---
10
+
11
+ # Bankr
12
+
13
+ Execute crypto trading and DeFi operations using natural language through Bankr's AI agent API.
14
+
15
+ ## Setup
16
+
17
+ Get your API key from [bankr.bot/api](https://bankr.bot/api) and set:
18
+
19
+ ```bash
20
+ export BANKR_API_KEY=bk_your_key_here
21
+ ```
22
+
23
+ ## Commands
24
+
25
+ ```
26
+ /bankr <prompt> Execute any trading command
27
+ /bankr status <jobId> Check job status
28
+ /bankr cancel <jobId> Cancel pending job
29
+ ```
30
+
31
+ ## Examples
32
+
33
+ ### Trading
34
+ ```
35
+ /bankr Buy $50 of ETH on Base
36
+ /bankr Swap 0.1 ETH for USDC
37
+ /bankr Sell 50% of my PEPE
38
+ /bankr Bridge 100 USDC from Polygon to Base
39
+ ```
40
+
41
+ ### Portfolio
42
+ ```
43
+ /bankr Show my portfolio
44
+ /bankr What's my ETH balance?
45
+ /bankr Holdings on Base
46
+ ```
47
+
48
+ ### Market Research
49
+ ```
50
+ /bankr What's the price of Bitcoin?
51
+ /bankr Analyze ETH price
52
+ /bankr Trending tokens on Base
53
+ ```
54
+
55
+ ### Transfers
56
+ ```
57
+ /bankr Send 0.1 ETH to vitalik.eth
58
+ /bankr Transfer $20 USDC to @friend
59
+ ```
60
+
61
+ ### NFTs
62
+ ```
63
+ /bankr Show Bored Ape floor price
64
+ /bankr Buy cheapest Pudgy Penguin
65
+ /bankr Show my NFTs
66
+ ```
67
+
68
+ ### Polymarket
69
+ ```
70
+ /bankr What are the odds Trump wins?
71
+ /bankr Bet $10 on Yes for [market]
72
+ /bankr Show my Polymarket positions
73
+ ```
74
+
75
+ ### Leverage (Avantis)
76
+ ```
77
+ /bankr Open 5x long on ETH with $100
78
+ /bankr Short BTC 10x with stop loss at $45k
79
+ ```
80
+
81
+ ### Automation
82
+ ```
83
+ /bankr DCA $100 into ETH weekly
84
+ /bankr Set limit order to buy ETH at $3,000
85
+ /bankr Stop loss for all holdings at -20%
86
+ ```
87
+
88
+ ### Token Deployment
89
+ ```
90
+ /bankr Deploy a token called BankrFan with symbol BFAN on Base
91
+ /bankr Launch a token called MOON on Solana
92
+ ```
93
+
94
+ ### Raw Transactions
95
+ ```
96
+ /bankr Submit this transaction: {"to": "0x...", "data": "0x...", "value": "0", "chainId": 8453}
97
+ ```
98
+
99
+ ## Supported Chains
100
+
101
+ | Chain | Native Token | Best For |
102
+ |-------|--------------|----------|
103
+ | Base | ETH | Memecoins, low fees |
104
+ | Polygon | MATIC | Gaming, NFTs |
105
+ | Ethereum | ETH | Blue chips |
106
+ | Solana | SOL | High-speed trading |
107
+ | Unichain | ETH | Newer L2 |
108
+
109
+ ## Tips
110
+
111
+ - Specify chain for lesser-known tokens: "Buy PEPE on Base"
112
+ - Use Base/Polygon for small amounts (lower gas)
113
+ - Check balance before trades
114
+ - Start small, scale up after testing
@@ -0,0 +1,113 @@
1
+ ---
2
+ name: betfair
3
+ description: "Betfair Exchange sports betting and trading"
4
+ emoji: "🏇"
5
+ commands:
6
+ - /bf
7
+ gates:
8
+ envs:
9
+ - BETFAIR_APP_KEY
10
+ ---
11
+
12
+ # Betfair Exchange
13
+
14
+ Full integration with Betfair Exchange, the world's largest sports betting exchange. Trade sports markets using back/lay orders.
15
+
16
+ ## Quick Start
17
+
18
+ ```bash
19
+ # Set credentials
20
+ export BETFAIR_APP_KEY="your-app-key"
21
+ export BETFAIR_SESSION_TOKEN="your-session-token"
22
+
23
+ # Search markets
24
+ /bf markets football
25
+
26
+ # Get market prices
27
+ /bf prices 1.234567890
28
+
29
+ # Place back order (bet FOR outcome)
30
+ /bf back 1.234567890 12345678 2.5 10
31
+
32
+ # Place lay order (bet AGAINST outcome)
33
+ /bf lay 1.234567890 12345678 2.5 10
34
+ ```
35
+
36
+ ## Commands
37
+
38
+ ### Market Data
39
+
40
+ | Command | Description |
41
+ |---------|-------------|
42
+ | `/bf markets [query]` | Search markets |
43
+ | `/bf market <id>` | Get market details |
44
+ | `/bf prices <marketId>` | Current prices and volumes |
45
+ | `/bf book <marketId> <selectionId>` | Show orderbook |
46
+
47
+ ### Trading
48
+
49
+ | Command | Description |
50
+ |---------|-------------|
51
+ | `/bf back <marketId> <selectionId> <odds> <stake>` | Place back order |
52
+ | `/bf lay <marketId> <selectionId> <odds> <stake>` | Place lay order |
53
+ | `/bf cancel <marketId> <betId>` | Cancel order |
54
+ | `/bf cancelall [marketId]` | Cancel all orders |
55
+ | `/bf orders [marketId]` | List open orders |
56
+
57
+ **Examples:**
58
+ ```bash
59
+ /bf back 1.234 5678 2.0 10 # Back at 2.0 odds, £10 stake
60
+ /bf lay 1.234 5678 2.1 10 # Lay at 2.1 odds, £10 liability
61
+ /bf cancel 1.234 abc123 # Cancel specific order
62
+ ```
63
+
64
+ ### Account
65
+
66
+ | Command | Description |
67
+ |---------|-------------|
68
+ | `/bf balance` | Check account balance |
69
+ | `/bf positions` | View open positions |
70
+
71
+ ## Configuration
72
+
73
+ ```bash
74
+ # Required
75
+ export BETFAIR_APP_KEY="your-app-key"
76
+
77
+ # Either session token or username/password
78
+ export BETFAIR_SESSION_TOKEN="your-session-token"
79
+
80
+ # Or login credentials
81
+ export BETFAIR_USERNAME="your-username"
82
+ export BETFAIR_PASSWORD="your-password"
83
+ ```
84
+
85
+ ## Features
86
+
87
+ - **Back/Lay Trading** - Trade both sides of markets
88
+ - **Live Streaming** - Real-time price updates via WebSocket
89
+ - **Sports Coverage** - Football, tennis, horse racing, politics, and more
90
+ - **Low Fees** - Exchange model with 2-5% commission
91
+ - **Deep Liquidity** - World's largest betting exchange
92
+
93
+ ## Event Types
94
+
95
+ | Sport | ID | Example Query |
96
+ |-------|-----|---------------|
97
+ | Soccer | 1 | `/bf markets champions league` |
98
+ | Tennis | 2 | `/bf markets wimbledon` |
99
+ | Horse Racing | 7 | `/bf markets ascot` |
100
+ | Politics | 2378961 | `/bf markets election` |
101
+ | Basketball | 7522 | `/bf markets nba` |
102
+
103
+ ## Trading Notes
104
+
105
+ 1. **Odds Format**: Betfair uses decimal odds (2.0 = evens, 3.0 = 2/1)
106
+ 2. **Minimum Stake**: Usually £2/€2/$2
107
+ 3. **Back vs Lay**: Back = betting FOR, Lay = betting AGAINST
108
+ 4. **Liability**: Lay stake = liability / (odds - 1)
109
+
110
+ ## Resources
111
+
112
+ - [Betfair Exchange](https://www.betfair.com/exchange/)
113
+ - [Betfair API Documentation](https://docs.developer.betfair.com/)
@@ -0,0 +1,84 @@
1
+ ---
2
+ name: binance-futures
3
+ description: Binance Futures trading with DB tracking
4
+ emoji: "🟡"
5
+ commands:
6
+ - /bf
7
+ gates:
8
+ envs:
9
+ - BINANCE_API_KEY
10
+ ---
11
+
12
+ # Binance Futures
13
+
14
+ Trade perpetual futures on Binance with up to 125x leverage and full database tracking.
15
+
16
+ ## Quick Start
17
+
18
+ ```bash
19
+ # Set credentials
20
+ export BINANCE_API_KEY="your-api-key"
21
+ export BINANCE_API_SECRET="your-api-secret"
22
+
23
+ # Check balance
24
+ /bf balance
25
+
26
+ # Open position
27
+ /bf long BTCUSDT 0.01 10x
28
+
29
+ # View stats
30
+ /bf stats
31
+ ```
32
+
33
+ ## Commands
34
+
35
+ ### Account
36
+
37
+ | Command | Description |
38
+ |---------|-------------|
39
+ | `/bf balance` | Check margin balance |
40
+ | `/bf positions` | View open positions |
41
+ | `/bf orders` | List open orders |
42
+
43
+ ### Trading
44
+
45
+ | Command | Description |
46
+ |---------|-------------|
47
+ | `/bf long <symbol> <size> [leverage]x` | Open long position |
48
+ | `/bf short <symbol> <size> [leverage]x` | Open short position |
49
+ | `/bf close <symbol>` | Close position |
50
+ | `/bf closeall` | Close all positions |
51
+ | `/bf tp <symbol> <price>` | Set take-profit |
52
+ | `/bf sl <symbol> <price>` | Set stop-loss |
53
+ | `/bf leverage <symbol> <value>` | Set leverage |
54
+
55
+ ### Market Data
56
+
57
+ | Command | Description |
58
+ |---------|-------------|
59
+ | `/bf price <symbol>` | Get current price |
60
+ | `/bf funding <symbol>` | Check funding rate |
61
+ | `/bf markets [query]` | List markets |
62
+
63
+ ### Database/History
64
+
65
+ | Command | Description |
66
+ |---------|-------------|
67
+ | `/bf trades [symbol] [limit]` | Trade history from database |
68
+ | `/bf dbstats [symbol] [period]` | Win rate, PnL, profit factor |
69
+ | `/bf dbfunding [symbol]` | Funding payments history |
70
+ | `/bf dbpositions [all]` | Position history |
71
+
72
+ **Stats periods:** `day`, `week`, `month`
73
+
74
+ ## Examples
75
+
76
+ ```bash
77
+ /bf long BTCUSDT 0.01 10x # 10x leveraged long
78
+ /bf short ETHUSDT 0.1 20x # 20x leveraged short
79
+ /bf tp BTCUSDT 105000 # Take profit at $105k
80
+ /bf sl BTCUSDT 95000 # Stop loss at $95k
81
+ /bf close BTCUSDT # Close BTC position
82
+ /bf trades BTCUSDT 20 # Last 20 BTC trades
83
+ /bf dbstats ETHUSDT week # ETH stats for past week
84
+ ```
@@ -7,9 +7,6 @@ declare const skill: {
7
7
  name: string;
8
8
  description: string;
9
9
  commands: string[];
10
- requires: {
11
- env: string[];
12
- };
13
10
  handle(args: string): Promise<string>;
14
11
  };
15
12
  export default skill;
@@ -392,8 +392,7 @@ async function handleDbPositions(showAll) {
392
392
  const skill = {
393
393
  name: 'binance-futures',
394
394
  description: 'Binance Futures trading with DB tracking',
395
- commands: ['/bf'],
396
- requires: { env: ['BINANCE_API_KEY', 'BINANCE_API_SECRET'] },
395
+ commands: ['/binance', '/binance-futures'],
397
396
  async handle(args) {
398
397
  const parts = args.trim().split(/\s+/);
399
398
  const cmd = parts[0]?.toLowerCase();