outsmart 2.0.0-alpha.0 → 2.0.0-alpha.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +400 -226
- package/dist/cli.js +629 -5
- package/dist/cli.js.map +1 -1
- package/dist/dex/meteora-dlmm.d.ts.map +1 -1
- package/dist/dex/meteora-dlmm.js +13 -1
- package/dist/dex/meteora-dlmm.js.map +1 -1
- package/dist/dex/percolator/adapter.d.ts +145 -0
- package/dist/dex/percolator/adapter.d.ts.map +1 -0
- package/dist/dex/percolator/adapter.js +856 -0
- package/dist/dex/percolator/adapter.js.map +1 -0
- package/dist/dex/percolator/core/abi/accounts.d.ts +45 -0
- package/dist/dex/percolator/core/abi/accounts.d.ts.map +1 -0
- package/dist/dex/percolator/core/abi/accounts.js +212 -0
- package/dist/dex/percolator/core/abi/accounts.js.map +1 -0
- package/dist/dex/percolator/core/abi/encode.d.ts +17 -0
- package/dist/dex/percolator/core/abi/encode.d.ts.map +1 -0
- package/dist/dex/percolator/core/abi/encode.js +102 -0
- package/dist/dex/percolator/core/abi/encode.js.map +1 -0
- package/dist/dex/percolator/core/abi/errors.d.ts +19 -0
- package/dist/dex/percolator/core/abi/errors.d.ts.map +1 -0
- package/dist/dex/percolator/core/abi/errors.js +72 -0
- package/dist/dex/percolator/core/abi/errors.js.map +1 -0
- package/dist/dex/percolator/core/abi/index.d.ts +5 -0
- package/dist/dex/percolator/core/abi/index.d.ts.map +1 -0
- package/dist/dex/percolator/core/abi/index.js +21 -0
- package/dist/dex/percolator/core/abi/index.js.map +1 -0
- package/dist/dex/percolator/core/abi/instructions.d.ts +176 -0
- package/dist/dex/percolator/core/abi/instructions.d.ts.map +1 -0
- package/dist/dex/percolator/core/abi/instructions.js +208 -0
- package/dist/dex/percolator/core/abi/instructions.js.map +1 -0
- package/dist/dex/percolator/core/config/program-ids.d.ts +25 -0
- package/dist/dex/percolator/core/config/program-ids.d.ts.map +1 -0
- package/dist/dex/percolator/core/config/program-ids.js +50 -0
- package/dist/dex/percolator/core/config/program-ids.js.map +1 -0
- package/dist/dex/percolator/core/index.d.ts +15 -0
- package/dist/dex/percolator/core/index.d.ts.map +1 -0
- package/dist/dex/percolator/core/index.js +31 -0
- package/dist/dex/percolator/core/index.js.map +1 -0
- package/dist/dex/percolator/core/math/index.d.ts +2 -0
- package/dist/dex/percolator/core/math/index.d.ts.map +1 -0
- package/dist/dex/percolator/core/math/index.js +18 -0
- package/dist/dex/percolator/core/math/index.js.map +1 -0
- package/dist/dex/percolator/core/math/trading.d.ts +14 -0
- package/dist/dex/percolator/core/math/trading.d.ts.map +1 -0
- package/dist/dex/percolator/core/math/trading.js +77 -0
- package/dist/dex/percolator/core/math/trading.js.map +1 -0
- package/dist/dex/percolator/core/runtime/index.d.ts +2 -0
- package/dist/dex/percolator/core/runtime/index.d.ts.map +1 -0
- package/dist/dex/percolator/core/runtime/index.js +18 -0
- package/dist/dex/percolator/core/runtime/index.js.map +1 -0
- package/dist/dex/percolator/core/runtime/tx.d.ts +29 -0
- package/dist/dex/percolator/core/runtime/tx.d.ts.map +1 -0
- package/dist/dex/percolator/core/runtime/tx.js +71 -0
- package/dist/dex/percolator/core/runtime/tx.js.map +1 -0
- package/dist/dex/percolator/core/solana/ata.d.ts +9 -0
- package/dist/dex/percolator/core/solana/ata.d.ts.map +1 -0
- package/dist/dex/percolator/core/solana/ata.js +12 -0
- package/dist/dex/percolator/core/solana/ata.js.map +1 -0
- package/dist/dex/percolator/core/solana/discovery.d.ts +38 -0
- package/dist/dex/percolator/core/solana/discovery.d.ts.map +1 -0
- package/dist/dex/percolator/core/solana/discovery.js +139 -0
- package/dist/dex/percolator/core/solana/discovery.js.map +1 -0
- package/dist/dex/percolator/core/solana/index.d.ts +6 -0
- package/dist/dex/percolator/core/solana/index.d.ts.map +1 -0
- package/dist/dex/percolator/core/solana/index.js +22 -0
- package/dist/dex/percolator/core/solana/index.js.map +1 -0
- package/dist/dex/percolator/core/solana/pda.d.ts +16 -0
- package/dist/dex/percolator/core/solana/pda.d.ts.map +1 -0
- package/dist/dex/percolator/core/solana/pda.js +39 -0
- package/dist/dex/percolator/core/solana/pda.js.map +1 -0
- package/dist/dex/percolator/core/solana/slab.d.ts +131 -0
- package/dist/dex/percolator/core/solana/slab.d.ts.map +1 -0
- package/dist/dex/percolator/core/solana/slab.js +376 -0
- package/dist/dex/percolator/core/solana/slab.js.map +1 -0
- package/dist/dex/percolator/core/solana/token-program.d.ts +9 -0
- package/dist/dex/percolator/core/solana/token-program.d.ts.map +1 -0
- package/dist/dex/percolator/core/solana/token-program.js +21 -0
- package/dist/dex/percolator/core/solana/token-program.js.map +1 -0
- package/dist/dex/percolator/core/validation.d.ts +16 -0
- package/dist/dex/percolator/core/validation.d.ts.map +1 -0
- package/dist/dex/percolator/core/validation.js +99 -0
- package/dist/dex/percolator/core/validation.js.map +1 -0
- package/dist/dex/types.d.ts +5 -0
- package/dist/dex/types.d.ts.map +1 -1
- package/dist/dex/types.js.map +1 -1
- package/dist/helpers/config.d.ts +5 -0
- package/dist/helpers/config.d.ts.map +1 -1
- package/dist/helpers/config.js +43 -10
- package/dist/helpers/config.js.map +1 -1
- package/dist/helpers/index.d.ts +1 -0
- package/dist/helpers/index.d.ts.map +1 -1
- package/dist/helpers/index.js +1 -0
- package/dist/helpers/index.js.map +1 -1
- package/dist/helpers/util.d.ts +0 -7
- package/dist/helpers/util.d.ts.map +1 -1
- package/dist/helpers/util.js +0 -20
- package/dist/helpers/util.js.map +1 -1
- package/dist/helpers/wallets.d.ts +69 -0
- package/dist/helpers/wallets.d.ts.map +1 -0
- package/dist/helpers/wallets.js +198 -0
- package/dist/helpers/wallets.js.map +1 -0
- package/dist/index.d.ts +19 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +105 -1
- package/dist/index.js.map +1 -1
- package/dist/transactions/bloXroute_tips_tx_executor.d.ts.map +1 -1
- package/dist/transactions/bloXroute_tips_tx_executor.js +42 -22
- package/dist/transactions/bloXroute_tips_tx_executor.js.map +1 -1
- package/dist/transactions/index.d.ts +2 -0
- package/dist/transactions/index.d.ts.map +1 -1
- package/dist/transactions/index.js +7 -1
- package/dist/transactions/index.js.map +1 -1
- package/dist/transactions/landing/providers/bloxroute.d.ts +3 -4
- package/dist/transactions/landing/providers/bloxroute.d.ts.map +1 -1
- package/dist/transactions/landing/providers/bloxroute.js +55 -24
- package/dist/transactions/landing/providers/bloxroute.js.map +1 -1
- package/dist/transactions/send-rpc.d.ts +37 -0
- package/dist/transactions/send-rpc.d.ts.map +1 -1
- package/dist/transactions/send-rpc.js +160 -5
- package/dist/transactions/send-rpc.js.map +1 -1
- package/package.json +18 -13
package/README.md
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
# outsmart
|
|
2
2
|
|
|
3
|
-
**Solana trading CLI — buy, sell, and
|
|
3
|
+
**Solana trading CLI — buy, sell, LP, and operate perp exchanges across 18 DEXes with 12 TX landing providers.**
|
|
4
|
+
|
|
5
|
+
**[Documentation](https://outsmartchad.github.io/outsmart-cli/)** | **[npm](https://www.npmjs.com/package/outsmart)** | **[Discord](https://discord.gg/dc3Kh3Y3yJ)**
|
|
4
6
|
|
|
5
7
|
```bash
|
|
6
|
-
npm install -g outsmart
|
|
8
|
+
npm install -g outsmart@alpha
|
|
9
|
+
outsmart init
|
|
7
10
|
outsmart buy --dex raydium-cpmm --pool <POOL> --amount 0.1
|
|
8
11
|
```
|
|
9
12
|
|
|
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
|
---
|
|
13
14
|
|
|
14
15
|
## Quick Start
|
|
@@ -16,40 +17,23 @@ outsmart buy --dex raydium-cpmm --pool <POOL> --amount 0.1
|
|
|
16
17
|
### 1. Install
|
|
17
18
|
|
|
18
19
|
```bash
|
|
19
|
-
# From
|
|
20
|
+
# From npm (recommended)
|
|
21
|
+
npm install -g outsmart@alpha
|
|
22
|
+
|
|
23
|
+
# Or from source
|
|
20
24
|
git clone https://github.com/outsmartchad/outsmart-cli.git
|
|
21
25
|
cd outsmart-cli
|
|
22
|
-
nvm install && nvm use
|
|
23
26
|
npm install --legacy-peer-deps
|
|
24
27
|
npm run build
|
|
25
|
-
|
|
26
|
-
# Or globally (when published to npm)
|
|
27
|
-
npm install -g outsmart
|
|
28
28
|
```
|
|
29
29
|
|
|
30
30
|
### 2. Configure
|
|
31
31
|
|
|
32
|
-
Run the interactive setup — it prompts for your wallet key and RPC endpoint:
|
|
33
|
-
|
|
34
32
|
```bash
|
|
35
33
|
outsmart init
|
|
36
34
|
```
|
|
37
35
|
|
|
38
|
-
|
|
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.).
|
|
36
|
+
Prompts for your wallet key and RPC endpoint. Writes config to `~/.outsmart/config.env`. You only need to do this once.
|
|
53
37
|
|
|
54
38
|
### 3. Trade
|
|
55
39
|
|
|
@@ -60,32 +44,41 @@ outsmart buy --dex raydium-cpmm --pool <POOL> --amount 0.1
|
|
|
60
44
|
# Sell 100% of held balance
|
|
61
45
|
outsmart sell --dex raydium-cpmm --pool <POOL> --pct 100
|
|
62
46
|
|
|
63
|
-
#
|
|
64
|
-
outsmart buy --dex
|
|
47
|
+
# Swap aggregator (no pool needed, just token mint)
|
|
48
|
+
outsmart buy --dex jupiter-ultra --token <MINT> --amount 0.1
|
|
65
49
|
|
|
66
|
-
#
|
|
67
|
-
outsmart
|
|
50
|
+
# Check your balances
|
|
51
|
+
outsmart balance
|
|
52
|
+
```
|
|
68
53
|
|
|
69
|
-
|
|
70
|
-
outsmart buy --dex jupiter-ultra --token <MINT> --amount 0.1
|
|
54
|
+
**Example output:**
|
|
71
55
|
|
|
72
|
-
|
|
73
|
-
|
|
56
|
+
```
|
|
57
|
+
buying on raydium-cpmm...
|
|
58
|
+
TX sent: 5zwjta... — confirming...
|
|
59
|
+
|
|
60
|
+
dex: raydium-cpmm
|
|
61
|
+
tx: 5zwjtaMj8LCzf4cY7Kt2QU2CAcAn3BAwvpVCbTjsR3qJ...
|
|
62
|
+
confirmed: true
|
|
63
|
+
in: 0.001 SOL
|
|
64
|
+
out: 2.001886 USELESS
|
|
65
|
+
pool: Q2sPHPdUWFMg7M7wwrQKLrn619cAucfRsmhVJffodSp
|
|
74
66
|
```
|
|
75
67
|
|
|
76
68
|
---
|
|
77
69
|
|
|
78
70
|
## Commands
|
|
79
71
|
|
|
80
|
-
###
|
|
72
|
+
### Trading
|
|
73
|
+
|
|
74
|
+
#### buy
|
|
81
75
|
|
|
82
76
|
Buy tokens with SOL (or a quote token).
|
|
83
77
|
|
|
84
78
|
```bash
|
|
85
79
|
outsmart buy --dex <name> --pool <POOL> --amount <SOL>
|
|
86
80
|
outsmart buy --dex raydium-cpmm --pool <POOL> --amount 0.1
|
|
87
|
-
outsmart buy --dex
|
|
88
|
-
outsmart buy --dex jupiter-ultra --token <MINT> --amount 0.5 --slippage 500
|
|
81
|
+
outsmart buy --dex jupiter-ultra --token <MINT> --amount 0.5
|
|
89
82
|
```
|
|
90
83
|
|
|
91
84
|
| Flag | Description |
|
|
@@ -93,26 +86,128 @@ outsmart buy --dex jupiter-ultra --token <MINT> --amount 0.5 --slippage 500
|
|
|
93
86
|
| `-d, --dex <name>` | DEX adapter name (required) |
|
|
94
87
|
| `-a, --amount <sol>` | SOL amount to spend (required) |
|
|
95
88
|
| `-p, --pool <address>` | Pool address (required for on-chain DEXes) |
|
|
96
|
-
| `-t, --token <mint>` | Token mint (auto-detected from pool; required for aggregators
|
|
89
|
+
| `-t, --token <mint>` | Token mint (auto-detected from pool; required for aggregators) |
|
|
97
90
|
|
|
98
|
-
|
|
91
|
+
#### sell
|
|
99
92
|
|
|
100
|
-
Sell tokens for SOL
|
|
93
|
+
Sell tokens for SOL. Specify what percentage of your balance to sell.
|
|
101
94
|
|
|
102
95
|
```bash
|
|
103
|
-
outsmart sell --dex <name> --pool <POOL> --pct <
|
|
96
|
+
outsmart sell --dex <name> --pool <POOL> --pct <1-100>
|
|
104
97
|
outsmart sell --dex raydium-cpmm --pool <POOL> --pct 100
|
|
105
|
-
outsmart sell --dex
|
|
98
|
+
outsmart sell --dex jupiter-ultra --token <MINT> --pct 50
|
|
106
99
|
```
|
|
107
100
|
|
|
108
101
|
| Flag | Description |
|
|
109
102
|
|------|-------------|
|
|
110
103
|
| `-d, --dex <name>` | DEX adapter name (required) |
|
|
111
|
-
| `--pct <percentage>` | Percentage of balance to sell,
|
|
104
|
+
| `--pct <percentage>` | Percentage of balance to sell, 1-100 (required) |
|
|
112
105
|
| `-p, --pool <address>` | Pool address (required for on-chain DEXes) |
|
|
113
|
-
| `-t, --token <mint>` | Token mint (auto-detected from pool; required for aggregators
|
|
106
|
+
| `-t, --token <mint>` | Token mint (auto-detected from pool; required for aggregators) |
|
|
107
|
+
|
|
108
|
+
#### quote
|
|
109
|
+
|
|
110
|
+
Get the current on-chain price from a pool.
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
outsmart quote --dex raydium-cpmm --pool <POOL>
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
#### find-pool
|
|
117
|
+
|
|
118
|
+
Discover a pool for a token pair on a specific DEX.
|
|
119
|
+
|
|
120
|
+
```bash
|
|
121
|
+
outsmart find-pool --dex raydium-cpmm --token <MINT>
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
### Wallet Management
|
|
125
|
+
|
|
126
|
+
#### wallet
|
|
127
|
+
|
|
128
|
+
Show the active wallet address and SOL balance.
|
|
129
|
+
|
|
130
|
+
```bash
|
|
131
|
+
outsmart wallet
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
```
|
|
135
|
+
label: default
|
|
136
|
+
address: tstXr3NbiMd6FFZF2qbPzxJqxCGXuSjpZVvdjeXiPv1
|
|
137
|
+
balance: 0.377743 SOL
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
#### wallet list
|
|
141
|
+
|
|
142
|
+
Show all saved wallets with their balances. Active wallet marked with `*`.
|
|
143
|
+
|
|
144
|
+
```bash
|
|
145
|
+
outsmart wallet list
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
```
|
|
149
|
+
LABEL ADDRESS SOL
|
|
150
|
+
──────────────────────────────────────────────────────────────────────────
|
|
151
|
+
* default tstXr3NbiMd6FFZF2qbPzxJqxCGXuSjpZVvdjeXiPv1 0.3777
|
|
152
|
+
trading 7xKXt... 1.2340
|
|
153
|
+
|
|
154
|
+
* = active wallet
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
#### wallet add
|
|
114
158
|
|
|
115
|
-
|
|
159
|
+
Add a new wallet. Prompts for the private key.
|
|
160
|
+
|
|
161
|
+
```bash
|
|
162
|
+
outsmart wallet add --label trading
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
#### wallet switch
|
|
166
|
+
|
|
167
|
+
Switch the active wallet. All subsequent commands use the new wallet.
|
|
168
|
+
|
|
169
|
+
```bash
|
|
170
|
+
outsmart wallet switch trading
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
#### wallet remove
|
|
174
|
+
|
|
175
|
+
Remove a saved wallet (with confirmation prompt).
|
|
176
|
+
|
|
177
|
+
```bash
|
|
178
|
+
outsmart wallet remove trading
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
### Balances
|
|
182
|
+
|
|
183
|
+
#### balance
|
|
184
|
+
|
|
185
|
+
Show SOL + stablecoin balances for the active wallet.
|
|
186
|
+
|
|
187
|
+
```bash
|
|
188
|
+
outsmart balance
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
```
|
|
192
|
+
Wallet: tstXr3NbiMd6FFZF2qbPzxJqxCGXuSjpZVvdjeXiPv1
|
|
193
|
+
|
|
194
|
+
SOL 0.377743
|
|
195
|
+
USDC 0.000001
|
|
196
|
+
USDT 0
|
|
197
|
+
USD1 0
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
#### balance --token
|
|
201
|
+
|
|
202
|
+
Check the balance of a specific token.
|
|
203
|
+
|
|
204
|
+
```bash
|
|
205
|
+
outsmart balance --token <MINT>
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
### Liquidity
|
|
209
|
+
|
|
210
|
+
#### add-liq
|
|
116
211
|
|
|
117
212
|
Add liquidity to a pool.
|
|
118
213
|
|
|
@@ -127,198 +222,199 @@ outsmart add-liq --dex meteora-dlmm --pool <POOL> --amount-sol 0.5 --amount-toke
|
|
|
127
222
|
| `-p, --pool <address>` | Pool address (required) |
|
|
128
223
|
| `--amount-sol <amount>` | Amount of SOL to deposit |
|
|
129
224
|
| `--amount-token <amount>` | Amount of non-SOL token to deposit |
|
|
130
|
-
| `-t, --token <mint>` | Token mint (for single-sided token deposits) |
|
|
131
225
|
| `--strategy <type>` | Distribution: `spot` \| `curve` \| `bid-ask` (DLMM only, default: spot) |
|
|
132
226
|
| `--bins <count>` | Number of bins (DLMM only, default: 50, max: 70) |
|
|
133
227
|
|
|
134
|
-
|
|
228
|
+
#### remove-liq
|
|
135
229
|
|
|
136
230
|
Remove liquidity from a pool.
|
|
137
231
|
|
|
138
232
|
```bash
|
|
139
233
|
outsmart remove-liq --dex meteora-damm-v2 --pool <POOL> --pct 100
|
|
140
|
-
outsmart remove-liq --dex meteora-dlmm --pool <POOL> --pct 50
|
|
141
234
|
```
|
|
142
235
|
|
|
143
|
-
|
|
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
|
|
236
|
+
#### claim-fees
|
|
151
237
|
|
|
152
238
|
Claim accumulated swap fees from LP positions.
|
|
153
239
|
|
|
154
240
|
```bash
|
|
155
241
|
outsmart claim-fees --dex meteora-damm-v2 --pool <POOL>
|
|
156
|
-
outsmart claim-fees --dex meteora-dlmm --pool <POOL> --position <POSITION>
|
|
157
242
|
```
|
|
158
243
|
|
|
159
|
-
|
|
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
|
|
244
|
+
#### positions
|
|
166
245
|
|
|
167
246
|
List LP positions in a pool.
|
|
168
247
|
|
|
169
248
|
```bash
|
|
170
249
|
outsmart positions --dex meteora-damm-v2 --pool <POOL>
|
|
171
|
-
outsmart positions --dex meteora-dlmm --pool <POOL> --json
|
|
172
250
|
```
|
|
173
251
|
|
|
174
|
-
|
|
175
|
-
|------|-------------|
|
|
176
|
-
| `-d, --dex <name>` | DEX adapter name (required) |
|
|
177
|
-
| `-p, --pool <address>` | Pool address (required) |
|
|
178
|
-
| `--json` | Output as JSON |
|
|
252
|
+
### Pool Creation
|
|
179
253
|
|
|
180
|
-
|
|
254
|
+
#### create-pump-coin
|
|
181
255
|
|
|
182
|
-
|
|
256
|
+
Create a new PumpFun token with a bonding curve.
|
|
183
257
|
|
|
184
258
|
```bash
|
|
185
|
-
outsmart
|
|
186
|
-
outsmart quote --dex meteora-dlmm --pool <POOL>
|
|
259
|
+
outsmart create-pump-coin --name "My Token" --symbol "MYTKN" --uri "https://ipfs.io/ipfs/Qm..."
|
|
187
260
|
```
|
|
188
261
|
|
|
189
|
-
|
|
262
|
+
#### create-pool
|
|
190
263
|
|
|
191
|
-
|
|
264
|
+
Create a new PumpSwap AMM pool with initial liquidity.
|
|
192
265
|
|
|
193
266
|
```bash
|
|
194
|
-
outsmart
|
|
195
|
-
outsmart find-pool --dex raydium-amm-v4 --token <MINT> --quote <USDC_MINT>
|
|
267
|
+
outsmart create-pool --base <MINT> --quote So111...112 --base-amount 1000000 --quote-amount 1
|
|
196
268
|
```
|
|
197
269
|
|
|
198
|
-
|
|
270
|
+
#### create-damm-pool
|
|
199
271
|
|
|
200
|
-
Create a
|
|
272
|
+
Create a Meteora DAMM v2 custom pool with full fee configuration.
|
|
201
273
|
|
|
202
274
|
```bash
|
|
203
|
-
outsmart create-
|
|
275
|
+
outsmart create-damm-pool --base <MINT> --base-amount 1000000 --quote-amount 0.5
|
|
276
|
+
outsmart create-damm-pool --base <MINT> --base-amount 1000000 --quote-amount 0.5 \
|
|
277
|
+
--max-fee 5000 --min-fee 100 --fee-mode 1 --dynamic-fee
|
|
204
278
|
```
|
|
205
279
|
|
|
206
|
-
|
|
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) |
|
|
280
|
+
#### create-damm-config-pool
|
|
211
281
|
|
|
212
|
-
|
|
282
|
+
Create a Meteora DAMM v2 pool using an existing on-chain config.
|
|
213
283
|
|
|
214
|
-
|
|
284
|
+
```bash
|
|
285
|
+
outsmart create-damm-config-pool --base <MINT> --base-amount 1000000 --quote-amount 0.5 \
|
|
286
|
+
--config <CONFIG_ADDRESS>
|
|
287
|
+
```
|
|
215
288
|
|
|
216
|
-
|
|
289
|
+
### Perpetual Futures (Percolator)
|
|
290
|
+
|
|
291
|
+
Create and operate on-chain perpetual futures exchanges. All prices in USD, all amounts in SOL.
|
|
292
|
+
|
|
293
|
+
#### perp create-market
|
|
294
|
+
|
|
295
|
+
Create a new perp market. You become the admin/oracle authority.
|
|
217
296
|
|
|
218
297
|
```bash
|
|
219
|
-
outsmart create-
|
|
298
|
+
outsmart perp create-market --price 150 --lp 2
|
|
299
|
+
outsmart perp create-market --price 0.00001 --lp 5 --tier medium --network mainnet
|
|
300
|
+
```
|
|
301
|
+
|
|
302
|
+
| Flag | Description | Default |
|
|
303
|
+
|------|-------------|---------|
|
|
304
|
+
| `--price <usd>` | Initial oracle price in USD (required) | |
|
|
305
|
+
| `--lp <sol>` | Initial LP collateral in SOL (required) | |
|
|
306
|
+
| `--tier <size>` | `small` \| `medium` \| `large` | `small` |
|
|
307
|
+
| `--network <net>` | `devnet` \| `mainnet` | `devnet` |
|
|
308
|
+
|
|
309
|
+
#### perp long / short
|
|
310
|
+
|
|
311
|
+
Open a leveraged position.
|
|
312
|
+
|
|
313
|
+
```bash
|
|
314
|
+
outsmart perp long -m <MARKET> -s 0.1
|
|
315
|
+
outsmart perp short -m <MARKET> -s 0.05
|
|
220
316
|
```
|
|
221
317
|
|
|
222
318
|
| Flag | Description |
|
|
223
319
|
|------|-------------|
|
|
224
|
-
|
|
|
225
|
-
|
|
|
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) |
|
|
320
|
+
| `-m, --market <address>` | Market (slab) address (required) |
|
|
321
|
+
| `-s, --size <sol>` | Position size in SOL (required) |
|
|
229
322
|
|
|
230
|
-
|
|
323
|
+
#### perp close
|
|
231
324
|
|
|
232
|
-
|
|
325
|
+
Close your open position.
|
|
233
326
|
|
|
234
327
|
```bash
|
|
235
|
-
|
|
236
|
-
|
|
328
|
+
outsmart perp close -m <MARKET>
|
|
329
|
+
```
|
|
237
330
|
|
|
238
|
-
|
|
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
|
|
331
|
+
#### perp status
|
|
241
332
|
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
333
|
+
View your position and market state.
|
|
334
|
+
|
|
335
|
+
```bash
|
|
336
|
+
outsmart perp status -m <MARKET>
|
|
245
337
|
```
|
|
246
338
|
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
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 |
|
|
339
|
+
#### perp deposit / withdraw
|
|
340
|
+
|
|
341
|
+
Manage collateral in your trading account.
|
|
263
342
|
|
|
264
|
-
|
|
343
|
+
```bash
|
|
344
|
+
outsmart perp deposit -m <MARKET> -a 1.0
|
|
345
|
+
outsmart perp withdraw -m <MARKET> -a 0.5
|
|
346
|
+
outsmart perp withdraw -m <MARKET> -a all
|
|
347
|
+
```
|
|
265
348
|
|
|
266
|
-
|
|
349
|
+
#### perp init-user
|
|
350
|
+
|
|
351
|
+
Register a trading account on a market (required before first deposit/trade).
|
|
267
352
|
|
|
268
353
|
```bash
|
|
269
|
-
outsmart
|
|
270
|
-
--config 2yAJha5NVgq5mEitTUvdWSUKrcYvxAAc2H6rPDbEQqSu
|
|
354
|
+
outsmart perp init-user -m <MARKET>
|
|
271
355
|
```
|
|
272
356
|
|
|
273
|
-
|
|
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 |
|
|
357
|
+
#### perp set-price
|
|
283
358
|
|
|
284
|
-
|
|
359
|
+
Push a new oracle price (admin-oracle markets only).
|
|
285
360
|
|
|
286
|
-
|
|
361
|
+
```bash
|
|
362
|
+
outsmart perp set-price -m <MARKET> --price 155.50
|
|
363
|
+
```
|
|
364
|
+
|
|
365
|
+
#### perp crank
|
|
366
|
+
|
|
367
|
+
Run the permissionless keeper crank (updates funding rates).
|
|
287
368
|
|
|
288
369
|
```bash
|
|
289
|
-
outsmart
|
|
290
|
-
outsmart list-dex --cap canSell
|
|
291
|
-
outsmart list-dex --cap canAddLiquidity --json
|
|
370
|
+
outsmart perp crank -m <MARKET>
|
|
292
371
|
```
|
|
293
372
|
|
|
294
|
-
|
|
373
|
+
#### perp markets
|
|
295
374
|
|
|
296
|
-
|
|
375
|
+
Discover all markets on-chain.
|
|
297
376
|
|
|
298
377
|
```bash
|
|
299
|
-
outsmart
|
|
378
|
+
outsmart perp markets
|
|
379
|
+
outsmart perp markets --network mainnet
|
|
300
380
|
```
|
|
301
381
|
|
|
302
|
-
|
|
382
|
+
---
|
|
383
|
+
|
|
384
|
+
### Utilities
|
|
303
385
|
|
|
304
|
-
|
|
386
|
+
#### info
|
|
305
387
|
|
|
306
|
-
|
|
388
|
+
Fetch token market data from DexScreener.
|
|
307
389
|
|
|
308
390
|
```bash
|
|
309
|
-
outsmart
|
|
391
|
+
outsmart info --token <MINT>
|
|
310
392
|
```
|
|
311
393
|
|
|
312
|
-
|
|
394
|
+
#### list-dex
|
|
313
395
|
|
|
314
|
-
|
|
396
|
+
List all registered DEX adapters and their capabilities.
|
|
397
|
+
|
|
398
|
+
```bash
|
|
399
|
+
outsmart list-dex
|
|
400
|
+
outsmart list-dex --cap canSell
|
|
401
|
+
```
|
|
402
|
+
|
|
403
|
+
#### config
|
|
315
404
|
|
|
316
405
|
View or generate configuration.
|
|
317
406
|
|
|
318
407
|
```bash
|
|
319
408
|
outsmart config show # Show current env config (sensitive values masked)
|
|
320
409
|
outsmart config env # Print a .env template
|
|
321
|
-
|
|
410
|
+
```
|
|
411
|
+
|
|
412
|
+
#### init
|
|
413
|
+
|
|
414
|
+
Interactive setup — prompts for wallet key and RPC endpoint.
|
|
415
|
+
|
|
416
|
+
```bash
|
|
417
|
+
outsmart init
|
|
322
418
|
```
|
|
323
419
|
|
|
324
420
|
---
|
|
@@ -327,9 +423,9 @@ outsmart config env > .env # Generate .env file
|
|
|
327
423
|
|
|
328
424
|
Some pools use stablecoins (USDC, USDT, USD1) as the quote token instead of SOL. The CLI handles this automatically — no extra steps needed.
|
|
329
425
|
|
|
330
|
-
**On buy:** detects the stablecoin quote from the pool, swaps SOL → stablecoin, then buys the token
|
|
426
|
+
**On buy:** detects the stablecoin quote from the pool, swaps SOL → stablecoin, then buys the token.
|
|
331
427
|
|
|
332
|
-
**On sell:** sells the token for stablecoin
|
|
428
|
+
**On sell:** sells the token for stablecoin, then swaps the proceeds back to SOL.
|
|
333
429
|
|
|
334
430
|
```bash
|
|
335
431
|
# LaunchLab pool quoted in USD1 — just specify SOL amount as usual
|
|
@@ -340,12 +436,7 @@ outsmart sell --dex raydium-launchlab --pool <POOL> --pct 100
|
|
|
340
436
|
# → sells token → USD1 → auto-swaps USD1 → SOL
|
|
341
437
|
```
|
|
342
438
|
|
|
343
|
-
|
|
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).
|
|
439
|
+
Uses Jupiter Ultra if `JUPITER_API_KEY` is set, otherwise falls back to on-chain DEX pools. Get a free key at [portal.jup.ag](https://portal.jup.ag) (optional).
|
|
349
440
|
|
|
350
441
|
---
|
|
351
442
|
|
|
@@ -360,7 +451,6 @@ All swap commands (`buy`, `sell`) accept these options:
|
|
|
360
451
|
| `--tip <sol>` | MEV tip in SOL | 0.001 |
|
|
361
452
|
| `--cu <units>` | Compute unit limit | auto |
|
|
362
453
|
| `--jito` | Use Jito bundle submission | false |
|
|
363
|
-
| `--strategy <mode>` | TX landing: `concurrent` \| `race` \| `random` \| `sequential` | concurrent |
|
|
364
454
|
| `--quote <mint>` | Quote token mint | WSOL |
|
|
365
455
|
|
|
366
456
|
---
|
|
@@ -369,28 +459,135 @@ All swap commands (`buy`, `sell`) accept these options:
|
|
|
369
459
|
|
|
370
460
|
18 adapters covering every major Solana DEX protocol:
|
|
371
461
|
|
|
372
|
-
| Adapter | Protocol | Buy | Sell |
|
|
373
|
-
|
|
374
|
-
| raydium-amm-v4 | AMM v4 |
|
|
375
|
-
| raydium-cpmm | CPMM |
|
|
376
|
-
| raydium-clmm | CLMM |
|
|
377
|
-
| raydium-launchlab | Launchlab |
|
|
378
|
-
| meteora-damm-v1 | Dynamic AMM |
|
|
379
|
-
| meteora-damm-v2 | CpAmm |
|
|
380
|
-
| meteora-dlmm | DLMM |
|
|
381
|
-
| meteora-dbc | DBC |
|
|
382
|
-
|
|
|
383
|
-
|
|
|
384
|
-
| orca | Whirlpool |
|
|
385
|
-
| byreal-clmm | CLMM |
|
|
386
|
-
| pancakeswap-clmm | CLMM |
|
|
387
|
-
| fusion-amm | Fusion |
|
|
388
|
-
| futarchy-amm | Futarchy |
|
|
389
|
-
| futarchy-launchpad | Launchpad | | | | | fund/claim |
|
|
390
|
-
| jupiter-ultra | Ultra API |
|
|
391
|
-
| dflow | Intent |
|
|
392
|
-
|
|
393
|
-
✅
|
|
462
|
+
| Adapter | Protocol | Buy | Sell | Price | LP | Extra | Tested |
|
|
463
|
+
|---------|----------|:---:|:----:|:-----:|:--:|-------|:------:|
|
|
464
|
+
| raydium-amm-v4 | AMM v4 | ✅ | ✅ | ✅ | | findpool | ✅ |
|
|
465
|
+
| raydium-cpmm | CPMM | ✅ | ✅ | ✅ | | findpool | ✅ |
|
|
466
|
+
| raydium-clmm | CLMM | ✅ | ✅ | ✅ | | findpool | ✅ |
|
|
467
|
+
| raydium-launchlab | Launchlab | ✅ | ✅ | ✅ | | findpool, auto-swap | ✅ |
|
|
468
|
+
| meteora-damm-v1 | Dynamic AMM | ✅ | ✅ | ✅ | | findpool | — |
|
|
469
|
+
| meteora-damm-v2 | CpAmm | ✅ | ✅ | ✅ | full | findpool, create pool | ✅ |
|
|
470
|
+
| meteora-dlmm | DLMM | ✅ | ✅ | ✅ | full | | ✅ |
|
|
471
|
+
| meteora-dbc | DBC | ✅ | ✅ | ✅ | | | ✅ |
|
|
472
|
+
| pumpfun | Bonding Curve | ✅ | ✅ | ✅ | | create coin | ✅ |
|
|
473
|
+
| pumpfun-amm | PumpSwap AMM | ✅ | ✅ | ✅ | | create pool | ✅ |
|
|
474
|
+
| orca | Whirlpool | ✅ | ✅ | ✅ | | | ✅ |
|
|
475
|
+
| byreal-clmm | CLMM | ✅ | ✅ | ✅ | | auto-swap | ✅ |
|
|
476
|
+
| pancakeswap-clmm | CLMM | ✅ | ✅ | ✅ | | | ✅ |
|
|
477
|
+
| fusion-amm | Fusion | ✅ | ✅ | ✅ | | | ✅ |
|
|
478
|
+
| futarchy-amm | Futarchy | ✅ | ✅ | ✅ | | auto-swap | ✅ |
|
|
479
|
+
| futarchy-launchpad | Launchpad | | | | | fund/claim | — |
|
|
480
|
+
| jupiter-ultra | Ultra API | ✅ | ✅ | | | aggregator | ✅ |
|
|
481
|
+
| dflow | Intent API | ✅ | ✅ | | | aggregator | ✅ |
|
|
482
|
+
|
|
483
|
+
All ✅ adapters confirmed on Solana mainnet with real transactions.
|
|
484
|
+
|
|
485
|
+
## Percolator — Permissionless Perpetual Futures
|
|
486
|
+
|
|
487
|
+
Create and operate your own on-chain perpetual futures exchange on Solana. The `PercolatorAdapter` is a standalone class (not `IDexAdapter` — perps are fundamentally different from spot).
|
|
488
|
+
|
|
489
|
+
### Why This Matters
|
|
490
|
+
|
|
491
|
+
First mover creates the perp market for a trending token and captures ALL leveraged volume fees. Nobody else has done AI-operated perp exchanges yet. This is the Percolator alpha.
|
|
492
|
+
|
|
493
|
+
### Quick Start (Programmatic API)
|
|
494
|
+
|
|
495
|
+
```typescript
|
|
496
|
+
import { PercolatorAdapter } from "outsmart";
|
|
497
|
+
|
|
498
|
+
const percolator = new PercolatorAdapter();
|
|
499
|
+
|
|
500
|
+
// 1. Create a perp market (devnet, BONK collateral, $1 initial price)
|
|
501
|
+
const market = await percolator.createMarket({
|
|
502
|
+
collateralMint: "DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263", // BONK
|
|
503
|
+
initialPriceE6: 1_000_000n, // $1.00
|
|
504
|
+
tier: "small",
|
|
505
|
+
network: "devnet",
|
|
506
|
+
lpCollateral: 1_000_000_000n, // 1B BONK for LP
|
|
507
|
+
});
|
|
508
|
+
console.log("Market:", market.slabAddress);
|
|
509
|
+
|
|
510
|
+
// 2. Register a trader
|
|
511
|
+
const { userIdx } = await percolator.initUser(market.slabAddress, "devnet");
|
|
512
|
+
|
|
513
|
+
// 3. Deposit collateral
|
|
514
|
+
await percolator.deposit(market.slabAddress, userIdx, 500_000_000n, "devnet");
|
|
515
|
+
|
|
516
|
+
// 4. Open a long position (positive size = long, negative = short)
|
|
517
|
+
await percolator.trade({
|
|
518
|
+
slabAddress: market.slabAddress,
|
|
519
|
+
userIdx,
|
|
520
|
+
lpIdx: market.lpIndex,
|
|
521
|
+
size: 100_000_000n, // long 100M units
|
|
522
|
+
network: "devnet",
|
|
523
|
+
});
|
|
524
|
+
|
|
525
|
+
// 5. Push oracle price (admin-oracle mode)
|
|
526
|
+
await percolator.pushOraclePrice(market.slabAddress, 1_100_000n, "devnet"); // $1.10
|
|
527
|
+
|
|
528
|
+
// 6. Read market state
|
|
529
|
+
const state = await percolator.getMarketState(market.slabAddress, "devnet");
|
|
530
|
+
console.log("Open interest:", state.engine.openInterestLong);
|
|
531
|
+
|
|
532
|
+
// 7. Check your position
|
|
533
|
+
const pos = await percolator.getMyPosition(market.slabAddress, "devnet");
|
|
534
|
+
console.log("PnL:", pos?.account.unrealizedPnl);
|
|
535
|
+
```
|
|
536
|
+
|
|
537
|
+
### PercolatorAdapter Methods (20)
|
|
538
|
+
|
|
539
|
+
| Method | Description |
|
|
540
|
+
|--------|-------------|
|
|
541
|
+
| `createMarket(params)` | Full 10-step market creation (slab → init → oracle → crank → vAMM → LP) |
|
|
542
|
+
| `initUser(slab, network?, tier?)` | Register a trader account, returns assigned index |
|
|
543
|
+
| `deposit(slab, idx, amount, network?, tier?)` | Deposit collateral |
|
|
544
|
+
| `withdraw(slab, idx, amount, network?, tier?)` | Withdraw collateral |
|
|
545
|
+
| `trade(params)` | Open/close/modify positions via TradeCpi |
|
|
546
|
+
| `closeAccount(slab, idx, network?, tier?)` | Close account and recover rent |
|
|
547
|
+
| `crank(slab, network?, tier?)` | Permissionless keeper crank |
|
|
548
|
+
| `pushOraclePrice(slab, priceE6, network?, tier?)` | Update oracle price (admin only) |
|
|
549
|
+
| `liquidate(slab, targetIdx, network?, tier?)` | Permissionless liquidation |
|
|
550
|
+
| `createInsuranceMint(slab, network?, tier?)` | One-time insurance LP mint creation |
|
|
551
|
+
| `depositInsuranceLP(slab, amount, network?, tier?)` | Deposit into insurance fund |
|
|
552
|
+
| `withdrawInsuranceLP(slab, lpAmount, network?, tier?)` | Withdraw from insurance fund |
|
|
553
|
+
| `getMarketState(slab, network?)` | Read full slab state (header, config, engine, params, accounts) |
|
|
554
|
+
| `getMyPosition(slab, network?)` | Find user's account by owner pubkey |
|
|
555
|
+
| `discoverMarkets(network?)` | Find all markets across all program tiers |
|
|
556
|
+
| `adminForceClose(slab, targetIdx, network?, tier?)` | Admin force-close a position |
|
|
557
|
+
| `resolveMarket(slab, network?, tier?)` | Resolve/freeze market (admin only) |
|
|
558
|
+
| `withdrawInsurance(slab, network?, tier?)` | Withdraw insurance fund balance |
|
|
559
|
+
| `closeSlab(slab, network?, tier?)` | Close slab account and recover rent |
|
|
560
|
+
| `teardownMarket(slab, network?, tier?)` | Full teardown: resolve → force-close all → withdraw → close |
|
|
561
|
+
|
|
562
|
+
### Math Utilities
|
|
563
|
+
|
|
564
|
+
Exported for PnL calculation, risk analysis, and pre-trade simulation:
|
|
565
|
+
|
|
566
|
+
```typescript
|
|
567
|
+
import {
|
|
568
|
+
computeMarkPnl,
|
|
569
|
+
computeLiqPrice,
|
|
570
|
+
computePreTradeLiqPrice,
|
|
571
|
+
computeTradingFee,
|
|
572
|
+
computePnlPercent,
|
|
573
|
+
computeEstimatedEntryPrice,
|
|
574
|
+
computeFundingRateAnnualized,
|
|
575
|
+
computeRequiredMargin,
|
|
576
|
+
computeMaxLeverage,
|
|
577
|
+
computeVammQuote,
|
|
578
|
+
} from "outsmart";
|
|
579
|
+
```
|
|
580
|
+
|
|
581
|
+
### Deployed Programs
|
|
582
|
+
|
|
583
|
+
| Tier | Devnet | Mainnet |
|
|
584
|
+
|------|--------|---------|
|
|
585
|
+
| Small | `FxfD37s1AZTeWfFQps9Zpebi2dNQ9QSSDtfMKdbsfKrD` | `GM8zjJ8LTBMv9xEsverh6H6wLyevgMHEJXcEzyY3rY24` |
|
|
586
|
+
| Medium | `FwfBKZXbYr4vTK23bMFkbgKq3npJ3MSDxEaKmq9Aj4Qn` | — |
|
|
587
|
+
| Large | `g9msRSV3sJmmE3r5Twn9HuBsxzuuRGTjKCVTKudm9in` | — |
|
|
588
|
+
| Matcher | `4HcGCsyjAqnFua5ccuXyt8KRRQzKFbGTJkVChpS7Yfzy` | `DHP6DtwXP1yJsz8YzfoeigRFPB979gzmumkmCxDLSkUX` |
|
|
589
|
+
|
|
590
|
+
---
|
|
394
591
|
|
|
395
592
|
## TX Landing Providers
|
|
396
593
|
|
|
@@ -411,30 +608,7 @@ All swap commands (`buy`, `sell`) accept these options:
|
|
|
411
608
|
| Flashblock | `FLASHBLOCK_API_KEY` |
|
|
412
609
|
| Node1 | `NODE1_API_KEY` |
|
|
413
610
|
|
|
414
|
-
Set any provider's API key
|
|
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.
|
|
611
|
+
Set any provider's API key and it's automatically enabled. The orchestrator sends your transaction through all enabled providers simultaneously for the fastest possible landing.
|
|
438
612
|
|
|
439
613
|
---
|
|
440
614
|
|
|
@@ -444,10 +618,10 @@ This sends your buy transaction with a high priority fee and MEV tip through the
|
|
|
444
618
|
|
|
445
619
|
| Variable | Description |
|
|
446
620
|
|----------|-------------|
|
|
447
|
-
| `
|
|
448
|
-
| `
|
|
621
|
+
| `PRIVATE_KEY` | Base58-encoded wallet private key |
|
|
622
|
+
| `MAINNET_ENDPOINT` | Solana mainnet RPC endpoint |
|
|
449
623
|
|
|
450
|
-
### Optional
|
|
624
|
+
### Optional
|
|
451
625
|
|
|
452
626
|
| Variable | Description | Default |
|
|
453
627
|
|----------|-------------|---------|
|
|
@@ -455,12 +629,9 @@ This sends your buy transaction with a high priority fee and MEV tip through the
|
|
|
455
629
|
| `DEFAULT_TIP_SOL` | MEV tip in SOL | `0.001` |
|
|
456
630
|
| `DEFAULT_SLIPPAGE_BPS` | Slippage in basis points | `300` |
|
|
457
631
|
| `DEFAULT_PRIORITY_FEE` | Priority fee in microLamports per CU | `4000` |
|
|
458
|
-
| `
|
|
459
|
-
| `
|
|
460
|
-
|
|
461
|
-
### Optional — TX Landing Provider Keys
|
|
462
|
-
|
|
463
|
-
See the [TX Landing Providers](#tx-landing-providers) table above.
|
|
632
|
+
| `DEVNET_ENDPOINT` | Solana devnet RPC endpoint (for Percolator) | not set |
|
|
633
|
+
| `JUPITER_API_KEY` | Jupiter Ultra API key ([portal.jup.ag](https://portal.jup.ag)) | works without key |
|
|
634
|
+
| `DFLOW_API_KEY` | DFlow intent API key ([pond.dflow.net](https://pond.dflow.net/build/api-key)) | required for dflow |
|
|
464
635
|
|
|
465
636
|
---
|
|
466
637
|
|
|
@@ -484,6 +655,7 @@ const result = await cpmm.buy({
|
|
|
484
655
|
opts: { slippageBps: 300, tipSol: 0.001 },
|
|
485
656
|
});
|
|
486
657
|
console.log("TX:", result.txSignature);
|
|
658
|
+
console.log("Received:", result.amountOut);
|
|
487
659
|
|
|
488
660
|
// Sell
|
|
489
661
|
const sellResult = await cpmm.sell({
|
|
@@ -507,18 +679,19 @@ For AI agent integration (MCP server, OpenClaw workflows), see [outsmart-agent](
|
|
|
507
679
|
## Testing
|
|
508
680
|
|
|
509
681
|
```bash
|
|
510
|
-
npm test
|
|
511
|
-
npm run test:registry # Registry smoke test
|
|
682
|
+
npm run test:unit # 43 CI-safe unit tests (no RPC/SOL needed)
|
|
683
|
+
npm run test:registry # Registry smoke test
|
|
512
684
|
npm run test:raydium # Raydium adapters (mainnet)
|
|
513
685
|
npm run test:meteora # Meteora adapters (mainnet)
|
|
514
686
|
npm run test:pumpfun # PumpFun + PumpSwap (mainnet)
|
|
515
687
|
npm run test:orca # Orca Whirlpool (mainnet)
|
|
516
688
|
npm run test:clmm # Byreal + PancakeSwap CLMM (mainnet)
|
|
517
|
-
npm run test:
|
|
689
|
+
npm run test:fusion # Fusion + Futarchy AMM (mainnet)
|
|
518
690
|
npm run test:api # Jupiter Ultra + DFlow (mainnet)
|
|
691
|
+
npm run test:percolator # Percolator perps (devnet)
|
|
519
692
|
```
|
|
520
693
|
|
|
521
|
-
Mainnet tests require `
|
|
694
|
+
Mainnet tests require `PRIVATE_KEY` and `MAINNET_ENDPOINT` env vars. Percolator tests require `DEVNET_ENDPOINT`. Tests use tiny amounts (0.002 SOL per buy). Run suites one at a time — tests share a wallet and cannot run in parallel.
|
|
522
695
|
|
|
523
696
|
---
|
|
524
697
|
|
|
@@ -532,10 +705,17 @@ src/
|
|
|
532
705
|
│ ├── types.ts # IDexAdapter interface
|
|
533
706
|
│ ├── index.ts # DexRegistry singleton
|
|
534
707
|
│ ├── shared/clmm-base.ts
|
|
708
|
+
│ ├── percolator/
|
|
709
|
+
│ │ ├── adapter.ts # PercolatorAdapter (15 methods)
|
|
710
|
+
│ │ └── core/ # Vendored @percolator/core SDK
|
|
535
711
|
│ └── 18 adapter files
|
|
536
712
|
├── dexscreener/ # Market data (DexScreener API)
|
|
537
|
-
├── helpers/
|
|
713
|
+
├── helpers/
|
|
714
|
+
│ ├── config.ts # Wallet, connection, env loading
|
|
715
|
+
│ ├── wallets.ts # Multi-wallet management
|
|
716
|
+
│ └── logger.ts # Structured logger
|
|
538
717
|
└── transactions/
|
|
718
|
+
├── send-rpc.ts # sendAndConfirmVtx (standard swaps)
|
|
539
719
|
└── landing/
|
|
540
720
|
├── orchestrator.ts # Multi-provider concurrent submission
|
|
541
721
|
├── nonce-manager.ts # Durable nonce for dedup
|
|
@@ -551,17 +731,11 @@ https://discord.gg/dc3Kh3Y3yJ
|
|
|
551
731
|
|
|
552
732
|
Contributions welcome. Fork, branch, PR.
|
|
553
733
|
|
|
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
734
|
## Disclaimer
|
|
561
735
|
|
|
562
736
|
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
737
|
|
|
564
|
-
Never share your private keys.
|
|
738
|
+
Never share your private keys. Wallet keys are stored in `~/.outsmart/` with owner-only permissions.
|
|
565
739
|
|
|
566
740
|
## License
|
|
567
741
|
|