clodds 1.2.9 → 1.3.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 (226) 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/ai-strategy/SKILL.md +111 -0
  7. package/dist/skills/bundled/ai-strategy/index.js +1 -1
  8. package/dist/skills/bundled/ai-strategy/index.js.map +1 -1
  9. package/dist/skills/bundled/alerts/SKILL.md +87 -0
  10. package/dist/skills/bundled/analytics/SKILL.md +252 -0
  11. package/dist/skills/bundled/analytics/index.js +2 -2
  12. package/dist/skills/bundled/analytics/index.js.map +1 -1
  13. package/dist/skills/bundled/arbitrage/SKILL.md +287 -0
  14. package/dist/skills/bundled/auto-reply/SKILL.md +285 -0
  15. package/dist/skills/bundled/auto-reply/index.js +2 -2
  16. package/dist/skills/bundled/auto-reply/index.js.map +1 -1
  17. package/dist/skills/bundled/automation/SKILL.md +242 -0
  18. package/dist/skills/bundled/automation/index.js +2 -2
  19. package/dist/skills/bundled/automation/index.js.map +1 -1
  20. package/dist/skills/bundled/backtest/SKILL.md +225 -0
  21. package/dist/skills/bundled/bags/SKILL.md +131 -0
  22. package/dist/skills/bundled/bankr/SKILL.md +114 -0
  23. package/dist/skills/bundled/betfair/SKILL.md +113 -0
  24. package/dist/skills/bundled/binance-futures/SKILL.md +84 -0
  25. package/dist/skills/bundled/binance-futures/index.d.ts +0 -3
  26. package/dist/skills/bundled/binance-futures/index.js +1 -2
  27. package/dist/skills/bundled/binance-futures/index.js.map +1 -1
  28. package/dist/skills/bundled/botchan/SKILL.md +66 -0
  29. package/dist/skills/bundled/botchan/index.d.ts +0 -3
  30. package/dist/skills/bundled/botchan/index.js +0 -1
  31. package/dist/skills/bundled/botchan/index.js.map +1 -1
  32. package/dist/skills/bundled/bridge/SKILL.md +215 -0
  33. package/dist/skills/bundled/bybit-futures/SKILL.md +84 -0
  34. package/dist/skills/bundled/bybit-futures/index.d.ts +0 -3
  35. package/dist/skills/bundled/bybit-futures/index.js +0 -1
  36. package/dist/skills/bundled/bybit-futures/index.js.map +1 -1
  37. package/dist/skills/bundled/clanker/SKILL.md +125 -0
  38. package/dist/skills/bundled/clanker/index.d.ts +0 -3
  39. package/dist/skills/bundled/clanker/index.js +0 -1
  40. package/dist/skills/bundled/clanker/index.js.map +1 -1
  41. package/dist/skills/bundled/copy-trading/SKILL.md +285 -0
  42. package/dist/skills/bundled/copy-trading/index.js +2 -2
  43. package/dist/skills/bundled/copy-trading/index.js.map +1 -1
  44. package/dist/skills/bundled/copy-trading-solana/SKILL.md +66 -0
  45. package/dist/skills/bundled/credentials/SKILL.md +261 -0
  46. package/dist/skills/bundled/crypto-hft/SKILL.md +121 -0
  47. package/dist/skills/bundled/dca/SKILL.md +27 -0
  48. package/dist/skills/bundled/dex/SKILL.md +87 -0
  49. package/dist/skills/bundled/divergence/SKILL.md +83 -0
  50. package/dist/skills/bundled/doctor/SKILL.md +267 -0
  51. package/dist/skills/bundled/doctor/index.js +2 -8
  52. package/dist/skills/bundled/doctor/index.js.map +1 -1
  53. package/dist/skills/bundled/drift/SKILL.md +53 -0
  54. package/dist/skills/bundled/drift-sdk/SKILL.md +103 -0
  55. package/dist/skills/bundled/drift-sdk/index.d.ts +0 -3
  56. package/dist/skills/bundled/drift-sdk/index.js +0 -1
  57. package/dist/skills/bundled/drift-sdk/index.js.map +1 -1
  58. package/dist/skills/bundled/edge/SKILL.md +84 -0
  59. package/dist/skills/bundled/embeddings/SKILL.md +244 -0
  60. package/dist/skills/bundled/endaoment/SKILL.md +65 -0
  61. package/dist/skills/bundled/endaoment/index.d.ts +0 -3
  62. package/dist/skills/bundled/endaoment/index.js +0 -1
  63. package/dist/skills/bundled/endaoment/index.js.map +1 -1
  64. package/dist/skills/bundled/ens/SKILL.md +63 -0
  65. package/dist/skills/bundled/ens/index.d.ts +0 -3
  66. package/dist/skills/bundled/ens/index.js +0 -1
  67. package/dist/skills/bundled/ens/index.js.map +1 -1
  68. package/dist/skills/bundled/erc8004/SKILL.md +79 -0
  69. package/dist/skills/bundled/erc8004/index.d.ts +0 -3
  70. package/dist/skills/bundled/erc8004/index.js +0 -1
  71. package/dist/skills/bundled/erc8004/index.js.map +1 -1
  72. package/dist/skills/bundled/execution/SKILL.md +278 -0
  73. package/dist/skills/bundled/farcaster/SKILL.md +80 -0
  74. package/dist/skills/bundled/features/SKILL.md +20 -0
  75. package/dist/skills/bundled/feeds/SKILL.md +288 -0
  76. package/dist/skills/bundled/harden/SKILL.md +74 -0
  77. package/dist/skills/bundled/history/SKILL.md +257 -0
  78. package/dist/skills/bundled/hyperliquid/SKILL.md +200 -0
  79. package/dist/skills/bundled/hyperliquid/index.d.ts +0 -3
  80. package/dist/skills/bundled/hyperliquid/index.js +0 -1
  81. package/dist/skills/bundled/hyperliquid/index.js.map +1 -1
  82. package/dist/skills/bundled/identity/SKILL.md +228 -0
  83. package/dist/skills/bundled/identity/index.js +2 -2
  84. package/dist/skills/bundled/identity/index.js.map +1 -1
  85. package/dist/skills/bundled/integrations/SKILL.md +321 -0
  86. package/dist/skills/bundled/integrations/index.js +2 -2
  87. package/dist/skills/bundled/integrations/index.js.map +1 -1
  88. package/dist/skills/bundled/jupiter/SKILL.md +163 -0
  89. package/dist/skills/bundled/kamino/SKILL.md +69 -0
  90. package/dist/skills/bundled/ledger/SKILL.md +20 -0
  91. package/dist/skills/bundled/lighter/SKILL.md +83 -0
  92. package/dist/skills/bundled/lighter/index.d.ts +0 -3
  93. package/dist/skills/bundled/lighter/index.js +0 -1
  94. package/dist/skills/bundled/lighter/index.js.map +1 -1
  95. package/dist/skills/bundled/marginfi/SKILL.md +62 -0
  96. package/dist/skills/bundled/market-index/SKILL.md +242 -0
  97. package/dist/skills/bundled/market-index/index.js +1 -3
  98. package/dist/skills/bundled/market-index/index.js.map +1 -1
  99. package/dist/skills/bundled/markets/SKILL.md +49 -0
  100. package/dist/skills/bundled/mcp/SKILL.md +235 -0
  101. package/dist/skills/bundled/mcp/index.js +1 -3
  102. package/dist/skills/bundled/mcp/index.js.map +1 -1
  103. package/dist/skills/bundled/memory/SKILL.md +209 -0
  104. package/dist/skills/bundled/metaculus/SKILL.md +62 -0
  105. package/dist/skills/bundled/meteora/SKILL.md +28 -0
  106. package/dist/skills/bundled/meteora-dbc/SKILL.md +25 -0
  107. package/dist/skills/bundled/metrics/SKILL.md +338 -0
  108. package/dist/skills/bundled/mev/SKILL.md +239 -0
  109. package/dist/skills/bundled/mev/index.js +2 -2
  110. package/dist/skills/bundled/mev/index.js.map +1 -1
  111. package/dist/skills/bundled/mexc-futures/SKILL.md +86 -0
  112. package/dist/skills/bundled/mexc-futures/index.d.ts +0 -3
  113. package/dist/skills/bundled/mexc-futures/index.js +0 -1
  114. package/dist/skills/bundled/mexc-futures/index.js.map +1 -1
  115. package/dist/skills/bundled/mm/SKILL.md +142 -0
  116. package/dist/skills/bundled/monitoring/SKILL.md +249 -0
  117. package/dist/skills/bundled/news/SKILL.md +95 -0
  118. package/dist/skills/bundled/onchainkit/SKILL.md +83 -0
  119. package/dist/skills/bundled/opinion/SKILL.md +87 -0
  120. package/dist/skills/bundled/opportunity/SKILL.md +308 -0
  121. package/dist/skills/bundled/orca/SKILL.md +28 -0
  122. package/dist/skills/bundled/pairing/SKILL.md +275 -0
  123. package/dist/skills/bundled/pancakeswap/SKILL.md +93 -0
  124. package/dist/skills/bundled/pancakeswap/index.d.ts +0 -3
  125. package/dist/skills/bundled/pancakeswap/index.js +0 -1
  126. package/dist/skills/bundled/pancakeswap/index.js.map +1 -1
  127. package/dist/skills/bundled/percolator/SKILL.md +22 -0
  128. package/dist/skills/bundled/permissions/SKILL.md +269 -0
  129. package/dist/skills/bundled/permissions/index.js +2 -2
  130. package/dist/skills/bundled/permissions/index.js.map +1 -1
  131. package/dist/skills/bundled/plugins/SKILL.md +263 -0
  132. package/dist/skills/bundled/plugins/index.js +2 -2
  133. package/dist/skills/bundled/plugins/index.js.map +1 -1
  134. package/dist/skills/bundled/portfolio/SKILL.md +161 -0
  135. package/dist/skills/bundled/portfolio/index.js +1 -1
  136. package/dist/skills/bundled/portfolio/index.js.map +1 -1
  137. package/dist/skills/bundled/portfolio-sync/SKILL.md +466 -0
  138. package/dist/skills/bundled/positions/SKILL.md +262 -0
  139. package/dist/skills/bundled/predictfun/SKILL.md +109 -0
  140. package/dist/skills/bundled/predictfun/index.js +1 -1
  141. package/dist/skills/bundled/predictfun/index.js.map +1 -1
  142. package/dist/skills/bundled/predictit/SKILL.md +66 -0
  143. package/dist/skills/bundled/presence/SKILL.md +217 -0
  144. package/dist/skills/bundled/presence/index.js +2 -2
  145. package/dist/skills/bundled/presence/index.js.map +1 -1
  146. package/dist/skills/bundled/processes/SKILL.md +254 -0
  147. package/dist/skills/bundled/pump-swarm/SKILL.md +309 -0
  148. package/dist/skills/bundled/pumpfun/SKILL.md +145 -0
  149. package/dist/skills/bundled/qmd/SKILL.md +129 -0
  150. package/dist/skills/bundled/qrcoin/SKILL.md +60 -0
  151. package/dist/skills/bundled/qrcoin/index.d.ts +0 -3
  152. package/dist/skills/bundled/qrcoin/index.js +0 -1
  153. package/dist/skills/bundled/qrcoin/index.js.map +1 -1
  154. package/dist/skills/bundled/raydium/SKILL.md +198 -0
  155. package/dist/skills/bundled/remote/SKILL.md +201 -0
  156. package/dist/skills/bundled/research/SKILL.md +83 -0
  157. package/dist/skills/bundled/research/index.js +2 -2
  158. package/dist/skills/bundled/research/index.js.map +1 -1
  159. package/dist/skills/bundled/risk/SKILL.md +323 -0
  160. package/dist/skills/bundled/router/SKILL.md +233 -0
  161. package/dist/skills/bundled/routing/SKILL.md +258 -0
  162. package/dist/skills/bundled/sandbox/SKILL.md +257 -0
  163. package/dist/skills/bundled/search-config/SKILL.md +257 -0
  164. package/dist/skills/bundled/search-config/index.js +2 -2
  165. package/dist/skills/bundled/search-config/index.js.map +1 -1
  166. package/dist/skills/bundled/sessions/SKILL.md +251 -0
  167. package/dist/skills/bundled/sessions/index.js +1 -1
  168. package/dist/skills/bundled/sessions/index.js.map +1 -1
  169. package/dist/skills/bundled/setup/SKILL.md +53 -0
  170. package/dist/skills/bundled/shield/SKILL.md +21 -0
  171. package/dist/skills/bundled/signals/SKILL.md +106 -0
  172. package/dist/skills/bundled/signals/index.d.ts +0 -3
  173. package/dist/skills/bundled/signals/index.js +3 -4
  174. package/dist/skills/bundled/signals/index.js.map +1 -1
  175. package/dist/skills/bundled/sizing/SKILL.md +238 -0
  176. package/dist/skills/bundled/slippage/SKILL.md +306 -0
  177. package/dist/skills/bundled/smarkets/SKILL.md +107 -0
  178. package/dist/skills/bundled/solend/SKILL.md +63 -0
  179. package/dist/skills/bundled/strategy/SKILL.md +266 -0
  180. package/dist/skills/bundled/streaming/SKILL.md +150 -0
  181. package/dist/skills/bundled/streaming/index.js +2 -2
  182. package/dist/skills/bundled/streaming/index.js.map +1 -1
  183. package/dist/skills/bundled/tailscale/SKILL.md +249 -0
  184. package/dist/skills/bundled/tailscale/index.js +2 -2
  185. package/dist/skills/bundled/tailscale/index.js.map +1 -1
  186. package/dist/skills/bundled/ticks/SKILL.md +61 -0
  187. package/dist/skills/bundled/token-security/SKILL.md +18 -0
  188. package/dist/skills/bundled/trading-evm/SKILL.md +329 -0
  189. package/dist/skills/bundled/trading-futures/SKILL.md +865 -0
  190. package/dist/skills/bundled/trading-kalshi/SKILL.md +629 -0
  191. package/dist/skills/bundled/trading-manifold/SKILL.md +387 -0
  192. package/dist/skills/bundled/trading-polymarket/SKILL.md +1080 -0
  193. package/dist/skills/bundled/trading-solana/SKILL.md +418 -0
  194. package/dist/skills/bundled/trading-system/SKILL.md +290 -0
  195. package/dist/skills/bundled/triggers/SKILL.md +433 -0
  196. package/dist/skills/bundled/tts/SKILL.md +220 -0
  197. package/dist/skills/bundled/tweet-ideas/SKILL.md +77 -0
  198. package/dist/skills/bundled/usage/SKILL.md +239 -0
  199. package/dist/skills/bundled/usage/index.js +2 -2
  200. package/dist/skills/bundled/usage/index.js.map +1 -1
  201. package/dist/skills/bundled/veil/SKILL.md +76 -0
  202. package/dist/skills/bundled/veil/index.d.ts +0 -3
  203. package/dist/skills/bundled/veil/index.js +0 -1
  204. package/dist/skills/bundled/veil/index.js.map +1 -1
  205. package/dist/skills/bundled/verify/SKILL.md +199 -0
  206. package/dist/skills/bundled/verify/index.d.ts +0 -3
  207. package/dist/skills/bundled/verify/index.js +0 -1
  208. package/dist/skills/bundled/verify/index.js.map +1 -1
  209. package/dist/skills/bundled/virtuals/SKILL.md +82 -0
  210. package/dist/skills/bundled/voice/SKILL.md +217 -0
  211. package/dist/skills/bundled/voice/index.js +2 -2
  212. package/dist/skills/bundled/voice/index.js.map +1 -1
  213. package/dist/skills/bundled/weather/SKILL.md +80 -0
  214. package/dist/skills/bundled/webhooks/SKILL.md +297 -0
  215. package/dist/skills/bundled/webhooks/index.js +2 -2
  216. package/dist/skills/bundled/webhooks/index.js.map +1 -1
  217. package/dist/skills/bundled/whale-tracking/SKILL.md +287 -0
  218. package/dist/skills/bundled/whale-tracking/index.js +2 -2
  219. package/dist/skills/bundled/whale-tracking/index.js.map +1 -1
  220. package/dist/skills/bundled/yoink/SKILL.md +54 -0
  221. package/dist/skills/bundled/yoink/index.d.ts +0 -3
  222. package/dist/skills/bundled/yoink/index.js +0 -1
  223. package/dist/skills/bundled/yoink/index.js.map +1 -1
  224. package/dist/skills/executor.js +5 -3
  225. package/dist/skills/executor.js.map +1 -1
  226. package/package.json +2 -2
@@ -0,0 +1,306 @@
1
+ ---
2
+ name: slippage
3
+ description: "Slippage estimation, optimization, and protection for trade execution"
4
+ emoji: "📉"
5
+ ---
6
+
7
+ # Slippage - Complete API Reference
8
+
9
+ Estimate, minimize, and protect against slippage across all trading platforms.
10
+
11
+ ---
12
+
13
+ ## Chat Commands
14
+
15
+ ### Estimate Slippage
16
+
17
+ ```
18
+ /slippage estimate "Trump" YES 5000 Estimate for $5000 order
19
+ /slippage BTCUSDT 1.5 BTC Estimate for futures
20
+ /slippage ETH 50 --dex uniswap Estimate DEX slippage
21
+ ```
22
+
23
+ ### Analyze Orderbook
24
+
25
+ ```
26
+ /slippage depth "Trump" Show orderbook depth
27
+ /slippage impact 10000 Price impact for size
28
+ /slippage levels "Trump" Show slippage at sizes
29
+ ```
30
+
31
+ ### Optimize Execution
32
+
33
+ ```
34
+ /slippage optimize "Trump" YES 10000 Find best execution
35
+ /slippage split 50000 Optimal order splitting
36
+ /slippage timing "Trump" Best times for low slippage
37
+ ```
38
+
39
+ ### Protection Settings
40
+
41
+ ```
42
+ /slippage max 1% Set max slippage tolerance
43
+ /slippage protect on Enable slippage protection
44
+ /slippage revert-threshold 2% Cancel if slippage exceeds
45
+ ```
46
+
47
+ ---
48
+
49
+ ## TypeScript API Reference
50
+
51
+ ### Create Slippage Manager
52
+
53
+ ```typescript
54
+ import { createSlippageManager } from 'clodds/slippage';
55
+
56
+ const slippage = createSlippageManager({
57
+ // Default tolerance
58
+ defaultMaxSlippage: 0.01, // 1%
59
+
60
+ // Protection
61
+ enableProtection: true,
62
+ revertThreshold: 0.02, // Cancel if > 2%
63
+
64
+ // Data sources
65
+ orderbookDepth: 20, // Levels to analyze
66
+ refreshInterval: 1000, // ms
67
+ });
68
+ ```
69
+
70
+ ### Estimate Slippage
71
+
72
+ ```typescript
73
+ const estimate = await slippage.estimate({
74
+ platform: 'polymarket',
75
+ market: 'trump-win-2028',
76
+ side: 'YES',
77
+ size: 5000,
78
+ });
79
+
80
+ console.log(`Expected slippage: ${estimate.slippage}%`);
81
+ console.log(`Price impact: ${estimate.priceImpact}%`);
82
+ console.log(`Effective price: ${estimate.effectivePrice}`);
83
+ console.log(`Best price: ${estimate.bestPrice}`);
84
+ console.log(`Worst price: ${estimate.worstPrice}`);
85
+ console.log(`Confidence: ${estimate.confidence}%`);
86
+ ```
87
+
88
+ ### Analyze Orderbook Depth
89
+
90
+ ```typescript
91
+ const depth = await slippage.analyzeDepth({
92
+ platform: 'polymarket',
93
+ market: 'trump-win-2028',
94
+ side: 'YES',
95
+ });
96
+
97
+ console.log('Orderbook Depth:');
98
+ console.log(` Liquidity at 0.5%: $${depth.liquidityAt05Pct}`);
99
+ console.log(` Liquidity at 1%: $${depth.liquidityAt1Pct}`);
100
+ console.log(` Liquidity at 2%: $${depth.liquidityAt2Pct}`);
101
+ console.log(` Total depth: $${depth.totalDepth}`);
102
+
103
+ console.log('\nSlippage by Size:');
104
+ for (const level of depth.slippageLevels) {
105
+ console.log(` $${level.size}: ${level.slippage}% slippage`);
106
+ }
107
+ ```
108
+
109
+ ### Price Impact Analysis
110
+
111
+ ```typescript
112
+ const impact = await slippage.priceImpact({
113
+ platform: 'polymarket',
114
+ market: 'trump-win-2028',
115
+ side: 'YES',
116
+ sizes: [1000, 5000, 10000, 25000, 50000],
117
+ });
118
+
119
+ console.log('Price Impact Analysis:');
120
+ for (const level of impact.levels) {
121
+ console.log(` $${level.size}:`);
122
+ console.log(` Slippage: ${level.slippage}%`);
123
+ console.log(` Impact: ${level.impact}%`);
124
+ console.log(` Effective: ${level.effectivePrice}`);
125
+ }
126
+ ```
127
+
128
+ ### Optimize Execution
129
+
130
+ ```typescript
131
+ const optimized = await slippage.optimize({
132
+ platform: 'polymarket',
133
+ market: 'trump-win-2028',
134
+ side: 'YES',
135
+ size: 25000,
136
+ maxSlippage: 0.01,
137
+ });
138
+
139
+ console.log('Optimized Execution:');
140
+ console.log(` Strategy: ${optimized.strategy}`); // 'single' | 'split' | 'twap'
141
+ console.log(` Expected slippage: ${optimized.expectedSlippage}%`);
142
+ console.log(` vs naive: ${optimized.naiveSlippage}%`);
143
+ console.log(` Savings: $${optimized.savings}`);
144
+
145
+ if (optimized.strategy === 'split') {
146
+ console.log('\nOrder Split:');
147
+ for (const order of optimized.orders) {
148
+ console.log(` ${order.size} @ ${order.limitPrice} (${order.delay}s delay)`);
149
+ }
150
+ }
151
+ ```
152
+
153
+ ### Order Splitting
154
+
155
+ ```typescript
156
+ const split = await slippage.splitOrder({
157
+ platform: 'polymarket',
158
+ market: 'trump-win-2028',
159
+ side: 'YES',
160
+ totalSize: 50000,
161
+ maxSlippagePerOrder: 0.005, // 0.5% max per order
162
+ minOrderSize: 1000,
163
+ });
164
+
165
+ console.log(`Split into ${split.orders.length} orders:`);
166
+ for (const order of split.orders) {
167
+ console.log(` $${order.size} - expected ${order.expectedSlippage}%`);
168
+ }
169
+ console.log(`Total expected slippage: ${split.totalSlippage}%`);
170
+ console.log(`Execution time: ${split.estimatedTime}s`);
171
+ ```
172
+
173
+ ### TWAP Execution
174
+
175
+ ```typescript
176
+ const twap = await slippage.twapSchedule({
177
+ platform: 'polymarket',
178
+ market: 'trump-win-2028',
179
+ side: 'YES',
180
+ totalSize: 100000,
181
+ duration: 3600, // 1 hour
182
+ intervals: 12, // 12 orders
183
+ });
184
+
185
+ console.log('TWAP Schedule:');
186
+ for (const order of twap.orders) {
187
+ console.log(` ${order.time}: $${order.size}`);
188
+ }
189
+ console.log(`Expected avg slippage: ${twap.expectedSlippage}%`);
190
+ ```
191
+
192
+ ### Best Timing Analysis
193
+
194
+ ```typescript
195
+ const timing = await slippage.analyzeTiming({
196
+ platform: 'polymarket',
197
+ market: 'trump-win-2028',
198
+ side: 'YES',
199
+ size: 10000,
200
+ });
201
+
202
+ console.log('Best Times for Low Slippage:');
203
+ for (const window of timing.bestWindows) {
204
+ console.log(` ${window.time}: avg ${window.avgSlippage}% slippage`);
205
+ console.log(` Liquidity: $${window.avgLiquidity}`);
206
+ }
207
+
208
+ console.log('\nWorst Times:');
209
+ for (const window of timing.worstWindows) {
210
+ console.log(` ${window.time}: avg ${window.avgSlippage}% slippage`);
211
+ }
212
+ ```
213
+
214
+ ### Slippage Protection
215
+
216
+ ```typescript
217
+ // Set protection parameters
218
+ slippage.setProtection({
219
+ maxSlippage: 0.01, // 1% max
220
+ revertThreshold: 0.02, // Cancel if > 2%
221
+ notifyThreshold: 0.005, // Alert at 0.5%
222
+ retryOnRevert: true, // Retry with lower size
223
+ retryReductionPct: 50, // Reduce size by 50%
224
+ });
225
+
226
+ // Execute with protection
227
+ const result = await slippage.executeProtected({
228
+ platform: 'polymarket',
229
+ market: 'trump-win-2028',
230
+ side: 'YES',
231
+ size: 10000,
232
+ });
233
+
234
+ console.log(`Executed: ${result.executed}`);
235
+ console.log(`Actual slippage: ${result.actualSlippage}%`);
236
+ console.log(`Protected: ${result.protected}`);
237
+ if (result.reverted) {
238
+ console.log(`Reverted: ${result.revertReason}`);
239
+ }
240
+ ```
241
+
242
+ ### DEX Slippage (Crypto)
243
+
244
+ ```typescript
245
+ const dexSlippage = await slippage.estimateDex({
246
+ chain: 'ethereum',
247
+ dex: 'uniswap',
248
+ tokenIn: 'USDC',
249
+ tokenOut: 'ETH',
250
+ amountIn: 50000,
251
+ });
252
+
253
+ console.log('DEX Slippage Estimate:');
254
+ console.log(` Expected out: ${dexSlippage.expectedOut}`);
255
+ console.log(` Min out (1% slip): ${dexSlippage.minOut1Pct}`);
256
+ console.log(` Price impact: ${dexSlippage.priceImpact}%`);
257
+ console.log(` Route: ${dexSlippage.route.join(' → ')}`);
258
+ ```
259
+
260
+ ### Historical Slippage
261
+
262
+ ```typescript
263
+ const history = await slippage.getHistory({
264
+ platform: 'polymarket',
265
+ period: '30d',
266
+ });
267
+
268
+ console.log('Historical Slippage:');
269
+ console.log(` Avg slippage: ${history.avgSlippage}%`);
270
+ console.log(` Max slippage: ${history.maxSlippage}%`);
271
+ console.log(` Trades with > 1%: ${history.tradesOver1Pct}`);
272
+ console.log(` Total slippage cost: $${history.totalCost}`);
273
+ ```
274
+
275
+ ---
276
+
277
+ ## Slippage Factors
278
+
279
+ | Factor | Impact | Mitigation |
280
+ |--------|--------|------------|
281
+ | **Order size** | Larger = more slip | Split orders |
282
+ | **Liquidity** | Thin = more slip | Check depth first |
283
+ | **Volatility** | High = more slip | Use limit orders |
284
+ | **Time of day** | Off-hours = more slip | Trade peak hours |
285
+ | **Market type** | New = more slip | Avoid illiquid markets |
286
+
287
+ ---
288
+
289
+ ## Protection Modes
290
+
291
+ | Mode | Behavior |
292
+ |------|----------|
293
+ | `warn` | Alert but execute |
294
+ | `confirm` | Require confirmation |
295
+ | `block` | Cancel if exceeds |
296
+ | `retry` | Retry with smaller size |
297
+
298
+ ---
299
+
300
+ ## Best Practices
301
+
302
+ 1. **Always estimate first** — Check slippage before trading
303
+ 2. **Split large orders** — Reduce impact on thin orderbooks
304
+ 3. **Use limit orders** — Protect against unexpected slippage
305
+ 4. **Trade liquid markets** — Higher volume = lower slippage
306
+ 5. **Monitor execution** — Track actual vs expected slippage
@@ -0,0 +1,107 @@
1
+ ---
2
+ name: smarkets
3
+ description: "Smarkets Exchange betting with 2% commission"
4
+ emoji: "🎰"
5
+ commands:
6
+ - /sm
7
+ gates:
8
+ envs:
9
+ - SMARKETS_SESSION_TOKEN
10
+ ---
11
+
12
+ # Smarkets Exchange
13
+
14
+ Full integration with Smarkets, a betting exchange with lower fees than Betfair (2% vs 5%). Politics, sports, and entertainment markets.
15
+
16
+ ## Quick Start
17
+
18
+ ```bash
19
+ # Set credentials
20
+ export SMARKETS_SESSION_TOKEN="your-session-token"
21
+
22
+ # Search markets
23
+ /sm markets election
24
+
25
+ # Get market prices
26
+ /sm prices 12345
27
+
28
+ # Place buy order
29
+ /sm buy 12345 67890 0.55 10
30
+
31
+ # Place sell order
32
+ /sm sell 12345 67890 0.60 10
33
+ ```
34
+
35
+ ## Commands
36
+
37
+ ### Market Data
38
+
39
+ | Command | Description |
40
+ |---------|-------------|
41
+ | `/sm markets [query]` | Search markets |
42
+ | `/sm market <id>` | Get market details |
43
+ | `/sm prices <marketId>` | Current prices |
44
+ | `/sm book <marketId> <contractId>` | Show orderbook |
45
+
46
+ ### Trading
47
+
48
+ | Command | Description |
49
+ |---------|-------------|
50
+ | `/sm buy <marketId> <contractId> <price> <quantity>` | Place buy order |
51
+ | `/sm sell <marketId> <contractId> <price> <quantity>` | Place sell order |
52
+ | `/sm cancel <orderId>` | Cancel order |
53
+ | `/sm cancelall [marketId]` | Cancel all orders |
54
+ | `/sm orders [marketId]` | List open orders |
55
+
56
+ **Examples:**
57
+ ```bash
58
+ /sm buy 123 456 0.55 10 # Buy at 55% price, £10
59
+ /sm sell 123 456 0.60 10 # Sell at 60% price, £10
60
+ /sm cancel abc123 # Cancel specific order
61
+ ```
62
+
63
+ ### Account
64
+
65
+ | Command | Description |
66
+ |---------|-------------|
67
+ | `/sm balance` | Check account balance |
68
+
69
+ ## Configuration
70
+
71
+ ```bash
72
+ # Required for trading
73
+ export SMARKETS_SESSION_TOKEN="your-session-token"
74
+
75
+ # Optional - API token for market data only
76
+ export SMARKETS_API_TOKEN="your-api-token"
77
+ ```
78
+
79
+ ## Features
80
+
81
+ - **Low Fees** - 2% commission vs Betfair's 5%
82
+ - **Politics Markets** - UK, US, EU elections
83
+ - **Sports** - Football, tennis, horse racing
84
+ - **Entertainment** - TV, music, awards
85
+ - **Real-time Streaming** - WebSocket price updates
86
+
87
+ ## Market Types
88
+
89
+ | Domain | Examples |
90
+ |--------|----------|
91
+ | politics | Elections, referendums |
92
+ | sport | Football, tennis, cricket |
93
+ | entertainment | Oscars, Eurovision, reality TV |
94
+ | current_affairs | Economic events, news |
95
+ | esports | CS:GO, League of Legends |
96
+
97
+ ## Trading Notes
98
+
99
+ 1. **Prices**: Expressed as percentages (0.55 = 55%)
100
+ 2. **Quantities**: In GBP
101
+ 3. **Buy**: Betting FOR an outcome
102
+ 4. **Sell**: Betting AGAINST an outcome
103
+
104
+ ## Resources
105
+
106
+ - [Smarkets Exchange](https://smarkets.com/)
107
+ - [Smarkets API Docs](https://docs.smarkets.com/)
@@ -0,0 +1,63 @@
1
+ ---
2
+ name: solend
3
+ description: "Solend — Solana lending and borrowing"
4
+ emoji: "💰"
5
+ commands:
6
+ - /solend
7
+ gates:
8
+ envs:
9
+ - SOLANA_PRIVATE_KEY
10
+ ---
11
+
12
+ # Solend
13
+
14
+ Solend is a decentralized lending and borrowing protocol on Solana. Supply assets to earn interest, borrow against collateral, and monitor health to avoid liquidation.
15
+
16
+ ## Commands
17
+
18
+ ### Lending
19
+ ```
20
+ /solend deposit <amount> <token> Deposit collateral
21
+ /solend withdraw <amount|all> <token> Withdraw collateral
22
+ /solend borrow <amount> <token> Borrow assets
23
+ /solend repay <amount|all> <token> Repay borrowed assets
24
+ ```
25
+
26
+ ### Account
27
+ ```
28
+ /solend obligation View your positions (deposits & borrows)
29
+ /solend health Check health factor & liquidation risk
30
+ ```
31
+
32
+ ### Markets
33
+ ```
34
+ /solend reserves List reserves with APY & utilization
35
+ /solend rates View supply/borrow interest rates table
36
+ /solend markets List available lending markets
37
+ ```
38
+
39
+ ## Examples
40
+
41
+ ```
42
+ /solend deposit 100 USDC
43
+ /solend borrow 1 SOL
44
+ /solend health
45
+ /solend repay all SOL
46
+ /solend withdraw all USDC
47
+ /solend reserves
48
+ /solend rates
49
+ ```
50
+
51
+ ## Configuration
52
+
53
+ ```bash
54
+ export SOLANA_PRIVATE_KEY="your-base58-private-key"
55
+ export SOLANA_RPC_URL="https://api.mainnet-beta.solana.com" # Optional
56
+ ```
57
+
58
+ ## See Also
59
+
60
+ - `/kamino` — Kamino Finance lending + liquidity vaults
61
+ - `/marginfi` — MarginFi lending protocol
62
+ - `/jup` — Jupiter DEX aggregator
63
+ - `/bags` — Portfolio overview