outsmart 2.0.0-alpha.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 (235) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +568 -0
  3. package/dist/cli.d.ts +44 -0
  4. package/dist/cli.d.ts.map +1 -0
  5. package/dist/cli.js +1251 -0
  6. package/dist/cli.js.map +1 -0
  7. package/dist/dex/byreal-clmm.d.ts +16 -0
  8. package/dist/dex/byreal-clmm.d.ts.map +1 -0
  9. package/dist/dex/byreal-clmm.js +39 -0
  10. package/dist/dex/byreal-clmm.js.map +1 -0
  11. package/dist/dex/dflow.d.ts +27 -0
  12. package/dist/dex/dflow.d.ts.map +1 -0
  13. package/dist/dex/dflow.js +200 -0
  14. package/dist/dex/dflow.js.map +1 -0
  15. package/dist/dex/fusion-amm.d.ts +44 -0
  16. package/dist/dex/fusion-amm.d.ts.map +1 -0
  17. package/dist/dex/fusion-amm.js +546 -0
  18. package/dist/dex/fusion-amm.js.map +1 -0
  19. package/dist/dex/futarchy-amm.d.ts +32 -0
  20. package/dist/dex/futarchy-amm.d.ts.map +1 -0
  21. package/dist/dex/futarchy-amm.js +443 -0
  22. package/dist/dex/futarchy-amm.js.map +1 -0
  23. package/dist/dex/futarchy-idl.d.ts +2568 -0
  24. package/dist/dex/futarchy-idl.d.ts.map +1 -0
  25. package/dist/dex/futarchy-idl.js +2570 -0
  26. package/dist/dex/futarchy-idl.js.map +1 -0
  27. package/dist/dex/futarchy-launchpad.d.ts +68 -0
  28. package/dist/dex/futarchy-launchpad.d.ts.map +1 -0
  29. package/dist/dex/futarchy-launchpad.js +377 -0
  30. package/dist/dex/futarchy-launchpad.js.map +1 -0
  31. package/dist/dex/index.d.ts +88 -0
  32. package/dist/dex/index.d.ts.map +1 -0
  33. package/dist/dex/index.js +159 -0
  34. package/dist/dex/index.js.map +1 -0
  35. package/dist/dex/jupiter-ultra.d.ts +27 -0
  36. package/dist/dex/jupiter-ultra.d.ts.map +1 -0
  37. package/dist/dex/jupiter-ultra.js +369 -0
  38. package/dist/dex/jupiter-ultra.js.map +1 -0
  39. package/dist/dex/meteora-damm-v1.d.ts +36 -0
  40. package/dist/dex/meteora-damm-v1.d.ts.map +1 -0
  41. package/dist/dex/meteora-damm-v1.js +314 -0
  42. package/dist/dex/meteora-damm-v1.js.map +1 -0
  43. package/dist/dex/meteora-damm-v2.d.ts +103 -0
  44. package/dist/dex/meteora-damm-v2.d.ts.map +1 -0
  45. package/dist/dex/meteora-damm-v2.js +1146 -0
  46. package/dist/dex/meteora-damm-v2.js.map +1 -0
  47. package/dist/dex/meteora-dbc.d.ts +38 -0
  48. package/dist/dex/meteora-dbc.d.ts.map +1 -0
  49. package/dist/dex/meteora-dbc.js +374 -0
  50. package/dist/dex/meteora-dbc.js.map +1 -0
  51. package/dist/dex/meteora-dlmm.d.ts +79 -0
  52. package/dist/dex/meteora-dlmm.d.ts.map +1 -0
  53. package/dist/dex/meteora-dlmm.js +735 -0
  54. package/dist/dex/meteora-dlmm.js.map +1 -0
  55. package/dist/dex/orca.d.ts +31 -0
  56. package/dist/dex/orca.d.ts.map +1 -0
  57. package/dist/dex/orca.js +536 -0
  58. package/dist/dex/orca.js.map +1 -0
  59. package/dist/dex/pancakeswap-clmm.d.ts +16 -0
  60. package/dist/dex/pancakeswap-clmm.d.ts.map +1 -0
  61. package/dist/dex/pancakeswap-clmm.js +39 -0
  62. package/dist/dex/pancakeswap-clmm.js.map +1 -0
  63. package/dist/dex/pumpfun-amm.d.ts +46 -0
  64. package/dist/dex/pumpfun-amm.d.ts.map +1 -0
  65. package/dist/dex/pumpfun-amm.js +692 -0
  66. package/dist/dex/pumpfun-amm.js.map +1 -0
  67. package/dist/dex/pumpfun.d.ts +41 -0
  68. package/dist/dex/pumpfun.d.ts.map +1 -0
  69. package/dist/dex/pumpfun.js +555 -0
  70. package/dist/dex/pumpfun.js.map +1 -0
  71. package/dist/dex/raydium-amm-v4.d.ts +11 -0
  72. package/dist/dex/raydium-amm-v4.d.ts.map +1 -0
  73. package/dist/dex/raydium-amm-v4.js +649 -0
  74. package/dist/dex/raydium-amm-v4.js.map +1 -0
  75. package/dist/dex/raydium-clmm.d.ts +12 -0
  76. package/dist/dex/raydium-clmm.d.ts.map +1 -0
  77. package/dist/dex/raydium-clmm.js +675 -0
  78. package/dist/dex/raydium-clmm.js.map +1 -0
  79. package/dist/dex/raydium-cpmm.d.ts +10 -0
  80. package/dist/dex/raydium-cpmm.d.ts.map +1 -0
  81. package/dist/dex/raydium-cpmm.js +613 -0
  82. package/dist/dex/raydium-cpmm.js.map +1 -0
  83. package/dist/dex/raydium-launchlab.d.ts +12 -0
  84. package/dist/dex/raydium-launchlab.d.ts.map +1 -0
  85. package/dist/dex/raydium-launchlab.js +530 -0
  86. package/dist/dex/raydium-launchlab.js.map +1 -0
  87. package/dist/dex/shared/clmm-base.d.ts +58 -0
  88. package/dist/dex/shared/clmm-base.d.ts.map +1 -0
  89. package/dist/dex/shared/clmm-base.js +891 -0
  90. package/dist/dex/shared/clmm-base.js.map +1 -0
  91. package/dist/dex/types.d.ts +601 -0
  92. package/dist/dex/types.d.ts.map +1 -0
  93. package/dist/dex/types.js +137 -0
  94. package/dist/dex/types.js.map +1 -0
  95. package/dist/dexscreener/index.d.ts +2 -0
  96. package/dist/dexscreener/index.d.ts.map +1 -0
  97. package/dist/dexscreener/index.js +18 -0
  98. package/dist/dexscreener/index.js.map +1 -0
  99. package/dist/dexscreener/info.d.ts +22 -0
  100. package/dist/dexscreener/info.d.ts.map +1 -0
  101. package/dist/dexscreener/info.js +104 -0
  102. package/dist/dexscreener/info.js.map +1 -0
  103. package/dist/helpers/check_balance.d.ts +10 -0
  104. package/dist/helpers/check_balance.d.ts.map +1 -0
  105. package/dist/helpers/check_balance.js +34 -0
  106. package/dist/helpers/check_balance.js.map +1 -0
  107. package/dist/helpers/config.d.ts +51 -0
  108. package/dist/helpers/config.d.ts.map +1 -0
  109. package/dist/helpers/config.js +118 -0
  110. package/dist/helpers/config.js.map +1 -0
  111. package/dist/helpers/index.d.ts +8 -0
  112. package/dist/helpers/index.d.ts.map +1 -0
  113. package/dist/helpers/index.js +29 -0
  114. package/dist/helpers/index.js.map +1 -0
  115. package/dist/helpers/logger.d.ts +27 -0
  116. package/dist/helpers/logger.d.ts.map +1 -0
  117. package/dist/helpers/logger.js +39 -0
  118. package/dist/helpers/logger.js.map +1 -0
  119. package/dist/helpers/token-2022.d.ts +32 -0
  120. package/dist/helpers/token-2022.d.ts.map +1 -0
  121. package/dist/helpers/token-2022.js +48 -0
  122. package/dist/helpers/token-2022.js.map +1 -0
  123. package/dist/helpers/unwrap_sol.d.ts +2 -0
  124. package/dist/helpers/unwrap_sol.d.ts.map +1 -0
  125. package/dist/helpers/unwrap_sol.js +67 -0
  126. package/dist/helpers/unwrap_sol.js.map +1 -0
  127. package/dist/helpers/util.d.ts +698 -0
  128. package/dist/helpers/util.d.ts.map +1 -0
  129. package/dist/helpers/util.js +181 -0
  130. package/dist/helpers/util.js.map +1 -0
  131. package/dist/helpers/utils.d.ts +10 -0
  132. package/dist/helpers/utils.d.ts.map +1 -0
  133. package/dist/helpers/utils.js +97 -0
  134. package/dist/helpers/utils.js.map +1 -0
  135. package/dist/helpers/wrap_sol.d.ts +3 -0
  136. package/dist/helpers/wrap_sol.d.ts.map +1 -0
  137. package/dist/helpers/wrap_sol.js +88 -0
  138. package/dist/helpers/wrap_sol.js.map +1 -0
  139. package/dist/index.d.ts +14 -0
  140. package/dist/index.d.ts.map +1 -0
  141. package/dist/index.js +32 -0
  142. package/dist/index.js.map +1 -0
  143. package/dist/transactions/bloXroute_tips_tx_executor.d.ts +4 -0
  144. package/dist/transactions/bloXroute_tips_tx_executor.d.ts.map +1 -0
  145. package/dist/transactions/bloXroute_tips_tx_executor.js +70 -0
  146. package/dist/transactions/bloXroute_tips_tx_executor.js.map +1 -0
  147. package/dist/transactions/index.d.ts +6 -0
  148. package/dist/transactions/index.d.ts.map +1 -0
  149. package/dist/transactions/index.js +30 -0
  150. package/dist/transactions/index.js.map +1 -0
  151. package/dist/transactions/jito_tips_tx_executor.d.ts +15 -0
  152. package/dist/transactions/jito_tips_tx_executor.d.ts.map +1 -0
  153. package/dist/transactions/jito_tips_tx_executor.js +99 -0
  154. package/dist/transactions/jito_tips_tx_executor.js.map +1 -0
  155. package/dist/transactions/landing/index.d.ts +30 -0
  156. package/dist/transactions/landing/index.d.ts.map +1 -0
  157. package/dist/transactions/landing/index.js +60 -0
  158. package/dist/transactions/landing/index.js.map +1 -0
  159. package/dist/transactions/landing/nonce-manager.d.ts +116 -0
  160. package/dist/transactions/landing/nonce-manager.d.ts.map +1 -0
  161. package/dist/transactions/landing/nonce-manager.js +393 -0
  162. package/dist/transactions/landing/nonce-manager.js.map +1 -0
  163. package/dist/transactions/landing/orchestrator.d.ts +104 -0
  164. package/dist/transactions/landing/orchestrator.d.ts.map +1 -0
  165. package/dist/transactions/landing/orchestrator.js +329 -0
  166. package/dist/transactions/landing/orchestrator.js.map +1 -0
  167. package/dist/transactions/landing/providers/astralane.d.ts +12 -0
  168. package/dist/transactions/landing/providers/astralane.d.ts.map +1 -0
  169. package/dist/transactions/landing/providers/astralane.js +132 -0
  170. package/dist/transactions/landing/providers/astralane.js.map +1 -0
  171. package/dist/transactions/landing/providers/blockrazor.d.ts +11 -0
  172. package/dist/transactions/landing/providers/blockrazor.d.ts.map +1 -0
  173. package/dist/transactions/landing/providers/blockrazor.js +134 -0
  174. package/dist/transactions/landing/providers/blockrazor.js.map +1 -0
  175. package/dist/transactions/landing/providers/bloxroute.d.ts +12 -0
  176. package/dist/transactions/landing/providers/bloxroute.d.ts.map +1 -0
  177. package/dist/transactions/landing/providers/bloxroute.js +102 -0
  178. package/dist/transactions/landing/providers/bloxroute.js.map +1 -0
  179. package/dist/transactions/landing/providers/flashblock.d.ts +10 -0
  180. package/dist/transactions/landing/providers/flashblock.d.ts.map +1 -0
  181. package/dist/transactions/landing/providers/flashblock.js +102 -0
  182. package/dist/transactions/landing/providers/flashblock.js.map +1 -0
  183. package/dist/transactions/landing/providers/helius-sender.d.ts +11 -0
  184. package/dist/transactions/landing/providers/helius-sender.d.ts.map +1 -0
  185. package/dist/transactions/landing/providers/helius-sender.js +101 -0
  186. package/dist/transactions/landing/providers/helius-sender.js.map +1 -0
  187. package/dist/transactions/landing/providers/jito.d.ts +16 -0
  188. package/dist/transactions/landing/providers/jito.d.ts.map +1 -0
  189. package/dist/transactions/landing/providers/jito.js +110 -0
  190. package/dist/transactions/landing/providers/jito.js.map +1 -0
  191. package/dist/transactions/landing/providers/nextblock.d.ts +11 -0
  192. package/dist/transactions/landing/providers/nextblock.d.ts.map +1 -0
  193. package/dist/transactions/landing/providers/nextblock.js +109 -0
  194. package/dist/transactions/landing/providers/nextblock.js.map +1 -0
  195. package/dist/transactions/landing/providers/node1.d.ts +11 -0
  196. package/dist/transactions/landing/providers/node1.d.ts.map +1 -0
  197. package/dist/transactions/landing/providers/node1.js +101 -0
  198. package/dist/transactions/landing/providers/node1.js.map +1 -0
  199. package/dist/transactions/landing/providers/nozomi.d.ts +11 -0
  200. package/dist/transactions/landing/providers/nozomi.d.ts.map +1 -0
  201. package/dist/transactions/landing/providers/nozomi.js +124 -0
  202. package/dist/transactions/landing/providers/nozomi.js.map +1 -0
  203. package/dist/transactions/landing/providers/soyas.d.ts +16 -0
  204. package/dist/transactions/landing/providers/soyas.d.ts.map +1 -0
  205. package/dist/transactions/landing/providers/soyas.js +192 -0
  206. package/dist/transactions/landing/providers/soyas.js.map +1 -0
  207. package/dist/transactions/landing/providers/stellium.d.ts +11 -0
  208. package/dist/transactions/landing/providers/stellium.d.ts.map +1 -0
  209. package/dist/transactions/landing/providers/stellium.js +102 -0
  210. package/dist/transactions/landing/providers/stellium.js.map +1 -0
  211. package/dist/transactions/landing/providers/zero-slot.d.ts +10 -0
  212. package/dist/transactions/landing/providers/zero-slot.d.ts.map +1 -0
  213. package/dist/transactions/landing/providers/zero-slot.js +92 -0
  214. package/dist/transactions/landing/providers/zero-slot.js.map +1 -0
  215. package/dist/transactions/landing/tip-accounts.d.ts +22 -0
  216. package/dist/transactions/landing/tip-accounts.d.ts.map +1 -0
  217. package/dist/transactions/landing/tip-accounts.js +140 -0
  218. package/dist/transactions/landing/tip-accounts.js.map +1 -0
  219. package/dist/transactions/landing/types.d.ts +98 -0
  220. package/dist/transactions/landing/types.d.ts.map +1 -0
  221. package/dist/transactions/landing/types.js +30 -0
  222. package/dist/transactions/landing/types.js.map +1 -0
  223. package/dist/transactions/nozomi/tx-submission.d.ts +14 -0
  224. package/dist/transactions/nozomi/tx-submission.d.ts.map +1 -0
  225. package/dist/transactions/nozomi/tx-submission.js +107 -0
  226. package/dist/transactions/nozomi/tx-submission.js.map +1 -0
  227. package/dist/transactions/send-rpc.d.ts +54 -0
  228. package/dist/transactions/send-rpc.d.ts.map +1 -0
  229. package/dist/transactions/send-rpc.js +126 -0
  230. package/dist/transactions/send-rpc.js.map +1 -0
  231. package/dist/transactions/simple_tx_executor.d.ts +10 -0
  232. package/dist/transactions/simple_tx_executor.d.ts.map +1 -0
  233. package/dist/transactions/simple_tx_executor.js +33 -0
  234. package/dist/transactions/simple_tx_executor.js.map +1 -0
  235. package/package.json +112 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Vincent So
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,568 @@
1
+ # outsmart
2
+
3
+ **Solana trading CLI — buy, sell, and LP across 18 DEXes with 12 TX landing providers.**
4
+
5
+ ```bash
6
+ npm install -g outsmart
7
+ outsmart buy --dex raydium-cpmm --pool <POOL> --amount 0.1
8
+ ```
9
+
10
+ > **This branch (`agent-trading-infra`) is under active development.** For the stable version, use [`typescript-main`](https://github.com/outsmartchad/outsmart-cli/tree/typescript-main).
11
+
12
+ ---
13
+
14
+ ## Quick Start
15
+
16
+ ### 1. Install
17
+
18
+ ```bash
19
+ # From source
20
+ git clone https://github.com/outsmartchad/outsmart-cli.git
21
+ cd outsmart-cli
22
+ nvm install && nvm use
23
+ npm install --legacy-peer-deps
24
+ npm run build
25
+
26
+ # Or globally (when published to npm)
27
+ npm install -g outsmart
28
+ ```
29
+
30
+ ### 2. Configure
31
+
32
+ Run the interactive setup — it prompts for your wallet key and RPC endpoint:
33
+
34
+ ```bash
35
+ outsmart init
36
+ ```
37
+
38
+ This writes your config to `~/.outsmart/config.env` (and `.env` in the project root if you cloned from source). You only need to do this once.
39
+
40
+ **Or configure manually:** copy `.env.example` to `.env` and fill in your values:
41
+
42
+ ```bash
43
+ cp .env.example .env
44
+ ```
45
+
46
+ ```bash
47
+ # Required
48
+ PRIVATE_KEY=your_base58_private_key_here
49
+ MAINNET_ENDPOINT=https://mainnet.helius-rpc.com/?api-key=YOUR_HELIUS_KEY
50
+ ```
51
+
52
+ See `.env.example` for all available options (TX landing provider keys, trading defaults, etc.).
53
+
54
+ ### 3. Trade
55
+
56
+ ```bash
57
+ # Buy 0.1 SOL worth of a token (token auto-detected from pool)
58
+ outsmart buy --dex raydium-cpmm --pool <POOL> --amount 0.1
59
+
60
+ # Sell 100% of held balance
61
+ outsmart sell --dex raydium-cpmm --pool <POOL> --pct 100
62
+
63
+ # Stablecoin-quoted pool — auto-swaps SOL → USD1, then buys token
64
+ outsmart buy --dex raydium-launchlab --pool <POOL> --amount 0.1
65
+
66
+ # Sell on a stablecoin pool — sells token → USD1, then auto-swaps USD1 → SOL
67
+ outsmart sell --dex raydium-launchlab --pool <POOL> --pct 100
68
+
69
+ # Swap aggregator (no pool needed, just token)
70
+ outsmart buy --dex jupiter-ultra --token <MINT> --amount 0.1
71
+
72
+ # Check token info
73
+ outsmart info --token <MINT>
74
+ ```
75
+
76
+ ---
77
+
78
+ ## Commands
79
+
80
+ ### buy
81
+
82
+ Buy tokens with SOL (or a quote token).
83
+
84
+ ```bash
85
+ outsmart buy --dex <name> --pool <POOL> --amount <SOL>
86
+ outsmart buy --dex raydium-cpmm --pool <POOL> --amount 0.1
87
+ outsmart buy --dex meteora-damm-v2 --pool <POOL> --amount 1 --tip 0.001
88
+ outsmart buy --dex jupiter-ultra --token <MINT> --amount 0.5 --slippage 500
89
+ ```
90
+
91
+ | Flag | Description |
92
+ |------|-------------|
93
+ | `-d, --dex <name>` | DEX adapter name (required) |
94
+ | `-a, --amount <sol>` | SOL amount to spend (required) |
95
+ | `-p, --pool <address>` | Pool address (required for on-chain DEXes) |
96
+ | `-t, --token <mint>` | Token mint (auto-detected from pool; required for aggregators or non-SOL quote pools) |
97
+
98
+ ### sell
99
+
100
+ Sell tokens for SOL (or a quote token). Specify what percentage of your balance to sell.
101
+
102
+ ```bash
103
+ outsmart sell --dex <name> --pool <POOL> --pct <0-100>
104
+ outsmart sell --dex raydium-cpmm --pool <POOL> --pct 100
105
+ outsmart sell --dex dflow --token <MINT> --pct 50 --slippage 300
106
+ ```
107
+
108
+ | Flag | Description |
109
+ |------|-------------|
110
+ | `-d, --dex <name>` | DEX adapter name (required) |
111
+ | `--pct <percentage>` | Percentage of balance to sell, 0-100 (required) |
112
+ | `-p, --pool <address>` | Pool address (required for on-chain DEXes) |
113
+ | `-t, --token <mint>` | Token mint (auto-detected from pool; required for aggregators or non-SOL quote pools) |
114
+
115
+ ### add-liq
116
+
117
+ Add liquidity to a pool.
118
+
119
+ ```bash
120
+ outsmart add-liq --dex meteora-damm-v2 --pool <POOL> --amount-sol 1.0
121
+ outsmart add-liq --dex meteora-dlmm --pool <POOL> --amount-sol 0.5 --amount-token 1000
122
+ ```
123
+
124
+ | Flag | Description |
125
+ |------|-------------|
126
+ | `-d, --dex <name>` | DEX adapter name (required) |
127
+ | `-p, --pool <address>` | Pool address (required) |
128
+ | `--amount-sol <amount>` | Amount of SOL to deposit |
129
+ | `--amount-token <amount>` | Amount of non-SOL token to deposit |
130
+ | `-t, --token <mint>` | Token mint (for single-sided token deposits) |
131
+ | `--strategy <type>` | Distribution: `spot` \| `curve` \| `bid-ask` (DLMM only, default: spot) |
132
+ | `--bins <count>` | Number of bins (DLMM only, default: 50, max: 70) |
133
+
134
+ ### remove-liq
135
+
136
+ Remove liquidity from a pool.
137
+
138
+ ```bash
139
+ outsmart remove-liq --dex meteora-damm-v2 --pool <POOL> --pct 100
140
+ outsmart remove-liq --dex meteora-dlmm --pool <POOL> --pct 50
141
+ ```
142
+
143
+ | Flag | Description |
144
+ |------|-------------|
145
+ | `-d, --dex <name>` | DEX adapter name (required) |
146
+ | `-p, --pool <address>` | Pool address (required) |
147
+ | `--pct <percentage>` | Percentage of LP position to remove, 0-100 (required) |
148
+ | `--position <address>` | Specific position to remove from (default: first found) |
149
+
150
+ ### claim-fees
151
+
152
+ Claim accumulated swap fees from LP positions.
153
+
154
+ ```bash
155
+ outsmart claim-fees --dex meteora-damm-v2 --pool <POOL>
156
+ outsmart claim-fees --dex meteora-dlmm --pool <POOL> --position <POSITION>
157
+ ```
158
+
159
+ | Flag | Description |
160
+ |------|-------------|
161
+ | `-d, --dex <name>` | DEX adapter name (required) |
162
+ | `-p, --pool <address>` | Pool address (required) |
163
+ | `--position <address>` | Specific position to claim from (default: all) |
164
+
165
+ ### positions
166
+
167
+ List LP positions in a pool.
168
+
169
+ ```bash
170
+ outsmart positions --dex meteora-damm-v2 --pool <POOL>
171
+ outsmart positions --dex meteora-dlmm --pool <POOL> --json
172
+ ```
173
+
174
+ | Flag | Description |
175
+ |------|-------------|
176
+ | `-d, --dex <name>` | DEX adapter name (required) |
177
+ | `-p, --pool <address>` | Pool address (required) |
178
+ | `--json` | Output as JSON |
179
+
180
+ ### quote
181
+
182
+ Get the current on-chain price from a pool.
183
+
184
+ ```bash
185
+ outsmart quote --dex raydium-cpmm --pool <POOL>
186
+ outsmart quote --dex meteora-dlmm --pool <POOL>
187
+ ```
188
+
189
+ ### find-pool
190
+
191
+ Discover a pool for a token pair on a specific DEX.
192
+
193
+ ```bash
194
+ outsmart find-pool --dex raydium-cpmm --token <MINT>
195
+ outsmart find-pool --dex raydium-amm-v4 --token <MINT> --quote <USDC_MINT>
196
+ ```
197
+
198
+ ### create-pump-coin
199
+
200
+ Create a new PumpFun token with a bonding curve. The token is instantly tradeable on pump.fun.
201
+
202
+ ```bash
203
+ outsmart create-pump-coin --name "My Token" --symbol "MYTKN" --uri "https://ipfs.io/ipfs/Qm..."
204
+ ```
205
+
206
+ | Flag | Description |
207
+ |------|-------------|
208
+ | `--name <name>` | Token name (required) |
209
+ | `--symbol <symbol>` | Token symbol (required) |
210
+ | `--uri <uri>` | Metadata URI — IPFS/Arweave link to JSON metadata (required) |
211
+
212
+ Returns the new mint address and bonding curve address.
213
+
214
+ ### create-pool
215
+
216
+ Create a new PumpSwap AMM pool with initial liquidity.
217
+
218
+ ```bash
219
+ outsmart create-pool --base <MINT> --quote So111...112 --base-amount 1000000 --quote-amount 1
220
+ ```
221
+
222
+ | Flag | Description |
223
+ |------|-------------|
224
+ | `--base <mint>` | Base token mint address (required) |
225
+ | `--quote <mint>` | Quote token mint address, usually WSOL (required) |
226
+ | `--base-amount <amount>` | Initial base token deposit, human-readable (required) |
227
+ | `--quote-amount <amount>` | Initial quote token deposit, human-readable (required) |
228
+ | `--index <number>` | Pool index (default: 1; 0 is reserved for canonical pump pools) |
229
+
230
+ ### create-damm-pool
231
+
232
+ Create a Meteora DAMM v2 custom pool with full fee configuration. This is the primary method for token launches — gives full control over fee schedule, dynamic fees, and activation timing.
233
+
234
+ ```bash
235
+ # Basic: create with default fee schedule (99% → 2% linear decay over 24h)
236
+ outsmart create-damm-pool --base <MINT> --base-amount 1000000 --quote-amount 0.5
237
+
238
+ # Custom fees: exponential decay, dynamic fee enabled
239
+ outsmart create-damm-pool --base <MINT> --base-amount 1000000 --quote-amount 0.5 \
240
+ --max-fee 5000 --min-fee 100 --fee-mode 1 --dynamic-fee
241
+
242
+ # Scheduled activation (unix timestamp)
243
+ outsmart create-damm-pool --base <MINT> --base-amount 1000000 --quote-amount 0.5 \
244
+ --activation 1740000000
245
+ ```
246
+
247
+ | Flag | Description | Default |
248
+ |------|-------------|---------|
249
+ | `--base <mint>` | Base token mint address (required) | |
250
+ | `--base-amount <amount>` | Initial base token deposit (required) | |
251
+ | `--quote-amount <amount>` | Initial quote token deposit (required) | |
252
+ | `--quote <mint>` | Quote token mint | WSOL |
253
+ | `--price <number>` | Initial price in quote/base units | quoteAmount / baseAmount |
254
+ | `--max-fee <bps>` | Max base fee at activation | 9900 |
255
+ | `--min-fee <bps>` | Min base fee after decay | 200 |
256
+ | `--periods <n>` | Number of fee decay periods | 1440 |
257
+ | `--duration <secs>` | Total fee decay duration in seconds | 86400 |
258
+ | `--fee-mode <0\|1>` | 0 = linear decay, 1 = exponential | 0 |
259
+ | `--dynamic-fee` | Enable dynamic fee on top of base fee | false |
260
+ | `--collect-mode <0\|1>` | 0 = both tokens, 1 = quote only | 1 |
261
+ | `--activation <timestamp>` | Activation unix timestamp | immediate |
262
+ | `--alpha-vault` | Create alpha vault after pool | false |
263
+
264
+ ### create-damm-config-pool
265
+
266
+ Create a Meteora DAMM v2 pool using an existing on-chain config. Simpler than `create-damm-pool` — the config determines the fee schedule and price range.
267
+
268
+ ```bash
269
+ outsmart create-damm-config-pool --base <MINT> --base-amount 1000000 --quote-amount 0.5 \
270
+ --config 2yAJha5NVgq5mEitTUvdWSUKrcYvxAAc2H6rPDbEQqSu
271
+ ```
272
+
273
+ | Flag | Description | Default |
274
+ |------|-------------|---------|
275
+ | `--base <mint>` | Base token mint address (required) | |
276
+ | `--base-amount <amount>` | Initial base token deposit (required) | |
277
+ | `--quote-amount <amount>` | Initial quote token deposit (required) | |
278
+ | `--config <address>` | On-chain config address (required) | |
279
+ | `--quote <mint>` | Quote token mint | WSOL |
280
+ | `--price <number>` | Initial price in quote/base units | quoteAmount / baseAmount |
281
+ | `--activation <timestamp>` | Activation unix timestamp | immediate |
282
+ | `--lock` | Permanently lock initial liquidity | false |
283
+
284
+ ### list-dex
285
+
286
+ List all registered DEX adapters and their capabilities.
287
+
288
+ ```bash
289
+ outsmart list-dex
290
+ outsmart list-dex --cap canSell
291
+ outsmart list-dex --cap canAddLiquidity --json
292
+ ```
293
+
294
+ ### info
295
+
296
+ Fetch token market data from DexScreener.
297
+
298
+ ```bash
299
+ outsmart info --token <MINT>
300
+ ```
301
+
302
+ Returns: price, market cap, volume, liquidity, pair age, buyer counts, social links.
303
+
304
+ ### init
305
+
306
+ Interactive setup — prompts for your wallet private key and RPC endpoint, validates the key, and writes config to `~/.outsmart/config.env`.
307
+
308
+ ```bash
309
+ outsmart init
310
+ ```
311
+
312
+ You only need to run this once. After that, all commands will use the saved config.
313
+
314
+ ### config
315
+
316
+ View or generate configuration.
317
+
318
+ ```bash
319
+ outsmart config show # Show current env config (sensitive values masked)
320
+ outsmart config env # Print a .env template
321
+ outsmart config env > .env # Generate .env file
322
+ ```
323
+
324
+ ---
325
+
326
+ ## Stablecoin Auto-Swap
327
+
328
+ Some pools use stablecoins (USDC, USDT, USD1) as the quote token instead of SOL. The CLI handles this automatically — no extra steps needed.
329
+
330
+ **On buy:** detects the stablecoin quote from the pool, swaps SOL → stablecoin, then buys the token with the full swapped amount.
331
+
332
+ **On sell:** sells the token for stablecoin on the DEX, then swaps the stablecoin proceeds back to SOL.
333
+
334
+ ```bash
335
+ # LaunchLab pool quoted in USD1 — just specify SOL amount as usual
336
+ outsmart buy --dex raydium-launchlab --pool <POOL> --amount 0.1
337
+ # → auto-swaps 0.1 SOL → USD1 → buys token
338
+
339
+ outsmart sell --dex raydium-launchlab --pool <POOL> --pct 100
340
+ # → sells token → USD1 → auto-swaps USD1 → SOL
341
+ ```
342
+
343
+ **How it works:**
344
+ - If `JUPITER_API_KEY` is set, uses Jupiter Ultra for the SOL↔stablecoin conversion
345
+ - If not set, falls back to on-chain DEX adapters with a curated pool registry (high-TVL Raydium CLMM, AMM v4, and Meteora DLMM pools)
346
+ - Only the swapped amount is used — pre-existing stablecoin balances in your wallet are untouched
347
+
348
+ Get a free Jupiter API key at [portal.jup.ag](https://portal.jup.ag) (optional — on-chain fallback works without it).
349
+
350
+ ---
351
+
352
+ ## Shared Swap Options
353
+
354
+ All swap commands (`buy`, `sell`) accept these options:
355
+
356
+ | Option | Description | Default |
357
+ |--------|-------------|---------|
358
+ | `--slippage <bps>` | Slippage tolerance in basis points | 300 (3%) |
359
+ | `--priority <microLamports>` | Priority fee per compute unit | from env |
360
+ | `--tip <sol>` | MEV tip in SOL | 0.001 |
361
+ | `--cu <units>` | Compute unit limit | auto |
362
+ | `--jito` | Use Jito bundle submission | false |
363
+ | `--strategy <mode>` | TX landing: `concurrent` \| `race` \| `random` \| `sequential` | concurrent |
364
+ | `--quote <mint>` | Quote token mint | WSOL |
365
+
366
+ ---
367
+
368
+ ## DEX Adapters
369
+
370
+ 18 adapters covering every major Solana DEX protocol:
371
+
372
+ | Adapter | Protocol | Buy | Sell | Pool | Price | LP | Extra | Tested |
373
+ |---------|----------|:---:|:----:|:----:|:-----:|:--:|-------|:------:|
374
+ | raydium-amm-v4 | AMM v4 | x | x | x | x | | | ✅ |
375
+ | raydium-cpmm | CPMM | x | x | x | x | | | ✅ |
376
+ | raydium-clmm | CLMM | x | x | x | x | | | ✅ |
377
+ | raydium-launchlab | Launchlab | x | x | x | x | | auto-swap | ✅ |
378
+ | meteora-damm-v1 | Dynamic AMM | x | x | x | x | | | — |
379
+ | meteora-damm-v2 | CpAmm | x | x | x | x | add/remove/claim/positions | create pool | ✅ |
380
+ | meteora-dlmm | DLMM | x | x | | x | add/remove/claim/positions | | ✅ |
381
+ | meteora-dbc | DBC | x | x | | x | | | ✅ |
382
+ | **pumpfun** | Bonding Curve | x | x | | x | | create coin | ✅ |
383
+ | **pumpfun-amm** | PumpSwap AMM | x | x | | x | | create pool | ✅ |
384
+ | orca | Whirlpool | x | x | | x | | | ✅ |
385
+ | byreal-clmm | CLMM | x | x | | x | | | ✅ |
386
+ | pancakeswap-clmm | CLMM | x | x | | x | | | ✅ |
387
+ | fusion-amm | Fusion | x | x | | x | | | ✅ |
388
+ | futarchy-amm | Futarchy | x | x | | x | | auto-swap | ✅ |
389
+ | futarchy-launchpad | Launchpad | | | | | fund/claim | | — |
390
+ | jupiter-ultra | Ultra API | x | x | | | | | ✅ |
391
+ | dflow | Intent | x | x | | | | | ✅ |
392
+
393
+ ✅ = buy + sell confirmed on Solana mainnet. 15 of 18 adapters tested (meteora-damm-v1 excluded as legacy, futarchy-launchpad is fund/claim only).
394
+
395
+ ## TX Landing Providers
396
+
397
+ 12 providers with concurrent, race, random, and sequential submission strategies:
398
+
399
+ | Provider | Env Var |
400
+ |----------|---------|
401
+ | Jito | `JITO_API_KEY` |
402
+ | bloXroute | `BLOXROUTE_AUTH_HEADER` |
403
+ | Helius Sender | `HELIUS_API_KEY` |
404
+ | Nozomi | `NOZOMI_API_KEY` |
405
+ | Blockrazor | `BLOCKRAZOR_API_KEY` |
406
+ | NextBlock | `NEXTBLOCK_API_KEY` |
407
+ | 0slot | `ZERO_SLOT_API_KEY` |
408
+ | Soyas | `SOYAS_API_KEY` |
409
+ | Astralane | `ASTRALANE_API_KEY` |
410
+ | Stellium | `STELLIUM_API_KEY` |
411
+ | Flashblock | `FLASHBLOCK_API_KEY` |
412
+ | Node1 | `NODE1_API_KEY` |
413
+
414
+ Set any provider's API key in your `.env` and it's automatically enabled. The orchestrator sends your transaction through all enabled providers simultaneously for the fastest possible landing.
415
+
416
+ Durable nonce accounts prevent duplicate executions when the same transaction hits multiple providers concurrently.
417
+
418
+ ---
419
+
420
+ ## Snipe (Coming Soon)
421
+
422
+ The `outsmart snipe` command is not yet available. Real sniping is not just a buy with a tip — it's a background process that:
423
+
424
+ 1. Connects to a **Geyser gRPC stream** (Yellowstone) using your own gRPC key
425
+ 2. Listens for **new pool creation events** on the DEX(es) you select
426
+ 3. When a new pool is created where the base or quote token matches your target token, it **instantly fires a buy** through concurrent multi-provider TX landing
427
+ 4. Runs as a **background process** (cronjob/tmux) on your machine
428
+
429
+ This requires your own Geyser gRPC key (from Helius, Triton, or another provider). It will be added in a future update.
430
+
431
+ **In the meantime**, you can achieve a competitive buy on a known pool with:
432
+
433
+ ```bash
434
+ outsmart buy --dex raydium-cpmm --token <MINT> --pool <POOL> --amount 0.5 --tip 0.01 --priority 12000000
435
+ ```
436
+
437
+ This sends your buy transaction with a high priority fee and MEV tip through the TX landing layer.
438
+
439
+ ---
440
+
441
+ ## Environment Variables
442
+
443
+ ### Required
444
+
445
+ | Variable | Description |
446
+ |----------|-------------|
447
+ | `SOLANA_RPC_URL` | Solana mainnet RPC endpoint |
448
+ | `WALLET_PRIVATE_KEY` | Base58-encoded wallet private key |
449
+
450
+ ### Optional — Trading Defaults
451
+
452
+ | Variable | Description | Default |
453
+ |----------|-------------|---------|
454
+ | `TX_LANDING_MODE` | `concurrent` \| `race` \| `random` \| `sequential` | `concurrent` |
455
+ | `DEFAULT_TIP_SOL` | MEV tip in SOL | `0.001` |
456
+ | `DEFAULT_SLIPPAGE_BPS` | Slippage in basis points | `300` |
457
+ | `DEFAULT_PRIORITY_FEE` | Priority fee in microLamports per CU | `4000` |
458
+ | `JUPITER_API_KEY` | Jupiter Ultra/Metis API key ([portal.jup.ag](https://portal.jup.ag)) | on-chain fallback |
459
+ | `DFLOW_API_KEY` | DFlow intent API key | |
460
+
461
+ ### Optional — TX Landing Provider Keys
462
+
463
+ See the [TX Landing Providers](#tx-landing-providers) table above.
464
+
465
+ ---
466
+
467
+ ## Programmatic API
468
+
469
+ Use outsmart as a library in your own bots:
470
+
471
+ ```typescript
472
+ import { getDexAdapter, listDexAdapters } from "outsmart";
473
+
474
+ // Import only the adapters you need
475
+ import "outsmart/dist/dex/raydium-cpmm";
476
+ import "outsmart/dist/dex/jupiter-ultra";
477
+
478
+ const cpmm = getDexAdapter("raydium-cpmm");
479
+
480
+ // Buy
481
+ const result = await cpmm.buy({
482
+ tokenMint: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
483
+ amountSol: 0.1,
484
+ opts: { slippageBps: 300, tipSol: 0.001 },
485
+ });
486
+ console.log("TX:", result.txSignature);
487
+
488
+ // Sell
489
+ const sellResult = await cpmm.sell({
490
+ tokenMint: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
491
+ percentage: 100,
492
+ opts: { slippageBps: 300 },
493
+ });
494
+
495
+ // Get price
496
+ const price = await cpmm.getPrice!("POOL_ADDRESS");
497
+ console.log("Price:", price.price);
498
+
499
+ // List adapters
500
+ const adapters = listDexAdapters();
501
+ ```
502
+
503
+ For AI agent integration (MCP server, OpenClaw workflows), see [outsmart-agent](https://github.com/outsmartchad/outsmart-agent).
504
+
505
+ ---
506
+
507
+ ## Testing
508
+
509
+ ```bash
510
+ npm test # All tests
511
+ npm run test:registry # Registry smoke test (no RPC needed)
512
+ npm run test:raydium # Raydium adapters (mainnet)
513
+ npm run test:meteora # Meteora adapters (mainnet)
514
+ npm run test:pumpfun # PumpFun + PumpSwap (mainnet)
515
+ npm run test:orca # Orca Whirlpool (mainnet)
516
+ npm run test:clmm # Byreal + PancakeSwap CLMM (mainnet)
517
+ npm run test:futarchy # Fusion + Futarchy AMM (mainnet)
518
+ npm run test:api # Jupiter Ultra + DFlow (mainnet)
519
+ ```
520
+
521
+ Mainnet tests require `WALLET_PRIVATE_KEY` and `SOLANA_RPC_URL` env vars. Tests use tiny amounts (0.02 SOL per buy). Run suites one at a time — tests share a wallet and cannot run in parallel.
522
+
523
+ ---
524
+
525
+ ## Project Structure
526
+
527
+ ```
528
+ src/
529
+ ├── cli.ts # CLI entry point (Commander.js)
530
+ ├── index.ts # Library entry point
531
+ ├── dex/
532
+ │ ├── types.ts # IDexAdapter interface
533
+ │ ├── index.ts # DexRegistry singleton
534
+ │ ├── shared/clmm-base.ts
535
+ │ └── 18 adapter files
536
+ ├── dexscreener/ # Market data (DexScreener API)
537
+ ├── helpers/ # Config, wallet, Token-2022 utils
538
+ └── transactions/
539
+ └── landing/
540
+ ├── orchestrator.ts # Multi-provider concurrent submission
541
+ ├── nonce-manager.ts # Durable nonce for dedup
542
+ ├── tip-accounts.ts # Tip account registry
543
+ └── providers/ # 12 provider implementations
544
+ ```
545
+
546
+ ## Discord
547
+
548
+ https://discord.gg/dc3Kh3Y3yJ
549
+
550
+ ## Contributing
551
+
552
+ Contributions welcome. Fork, branch, PR.
553
+
554
+ ```bash
555
+ git checkout -b feature/your-feature
556
+ git commit -m 'add your feature'
557
+ git push origin feature/your-feature
558
+ ```
559
+
560
+ ## Disclaimer
561
+
562
+ This software is provided "as is", without warranty of any kind. Use at your own risk. The authors take no responsibility for any financial loss. Users are responsible for ensuring compliance with applicable laws.
563
+
564
+ Never share your private keys. The `.env` file is in `.gitignore` for your safety.
565
+
566
+ ## License
567
+
568
+ ISC
package/dist/cli.d.ts ADDED
@@ -0,0 +1,44 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * outsmart CLI — The Solana trading command-line interface.
4
+ *
5
+ * 18 DEX adapters, 12 TX landing providers, one unified interface.
6
+ *
7
+ * Usage:
8
+ * # On-chain DEX — pool address required, token auto-detected from pool
9
+ * outsmart buy --dex meteora-dlmm --pool <POOL> --amount 0.1
10
+ * outsmart sell --dex meteora-dlmm --pool <POOL> --pct 100
11
+ *
12
+ * # Stablecoin pool — auto-swaps SOL→USD1 then buys, no extra steps needed
13
+ * outsmart buy --dex raydium-launchlab --pool <POOL> --amount 0.1
14
+ *
15
+ * # Swap aggregator — requires token mint only (finds best route automatically)
16
+ * outsmart buy --dex jupiter-ultra --token <MINT> --amount 0.1
17
+ * outsmart sell --dex jupiter-ultra --token <MINT> --pct 100
18
+ *
19
+ * outsmart quote --dex meteora-dlmm --pool <POOL>
20
+ * outsmart list-dex
21
+ * outsmart list-dex --cap canSell
22
+ * outsmart config show
23
+ * outsmart init
24
+ */
25
+ import "dotenv/config";
26
+ import "./dex/raydium-amm-v4";
27
+ import "./dex/raydium-cpmm";
28
+ import "./dex/raydium-clmm";
29
+ import "./dex/raydium-launchlab";
30
+ import "./dex/meteora-damm-v1";
31
+ import "./dex/meteora-damm-v2";
32
+ import "./dex/meteora-dlmm";
33
+ import "./dex/meteora-dbc";
34
+ import "./dex/orca";
35
+ import "./dex/byreal-clmm";
36
+ import "./dex/pancakeswap-clmm";
37
+ import "./dex/fusion-amm";
38
+ import "./dex/futarchy-amm";
39
+ import "./dex/futarchy-launchpad";
40
+ import "./dex/pumpfun";
41
+ import "./dex/pumpfun-amm";
42
+ import "./dex/jupiter-ultra";
43
+ import "./dex/dflow";
44
+ //# sourceMappingURL=cli.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAUA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,eAAe,CAAC;AAMvB,OAAO,sBAAsB,CAAC;AAC9B,OAAO,oBAAoB,CAAC;AAC5B,OAAO,oBAAoB,CAAC;AAC5B,OAAO,yBAAyB,CAAC;AACjC,OAAO,uBAAuB,CAAC;AAC/B,OAAO,uBAAuB,CAAC;AAC/B,OAAO,oBAAoB,CAAC;AAC5B,OAAO,mBAAmB,CAAC;AAE3B,OAAO,YAAY,CAAC;AACpB,OAAO,mBAAmB,CAAC;AAC3B,OAAO,wBAAwB,CAAC;AAChC,OAAO,kBAAkB,CAAC;AAC1B,OAAO,oBAAoB,CAAC;AAC5B,OAAO,0BAA0B,CAAC;AAClC,OAAO,eAAe,CAAC;AACvB,OAAO,mBAAmB,CAAC;AAC3B,OAAO,qBAAqB,CAAC;AAC7B,OAAO,aAAa,CAAC"}