Install, configure, and execute your first trade in under a minute.
Full docs for buy, sell, LP, wallet, balance, pool creation, and more.
18 adapters covering Raydium, Meteora, Orca, PumpFun, Jupiter, and more.
Use outsmart as a TypeScript library in your bots and AI agents.
Quick Start
1. Install
# From npm (recommended) npm install -g outsmart@alpha # Or from source git clone https://github.com/outsmartchad/outsmart-cli.git cd outsmart-cli && npm install --legacy-peer-deps && npm run build
2. Configure
outsmart init
Prompts for wallet key and RPC endpoint. Saved to ~/.outsmart/config.env. One-time setup.
3. Trade
# Buy tokens (token auto-detected from pool) outsmart buy --dex raydium-cpmm --pool <POOL> --amount 0.1 # Sell everything outsmart sell --dex raydium-cpmm --pool <POOL> --pct 100 # Swap aggregator (no pool needed) outsmart buy --dex jupiter-ultra --token <MINT> --amount 0.5 # Preview without spending outsmart buy --dex raydium-cpmm --pool <POOL> --amount 0.1 --dry-run # Check your bag outsmart balance
Commands
outsmart buy
Buy tokens with SOL. On-chain DEXes require --pool; aggregators require --token.
outsmart buy --dex raydium-cpmm --pool <POOL> --amount 0.1 outsmart buy --dex jupiter-ultra --token <MINT> --amount 0.5
| Flag | Description |
|---|---|
| -d, --dex <name> | DEX adapter name (required) |
| -a, --amount <sol> | SOL amount to spend (required) |
| -p, --pool <addr> | Pool address (required for on-chain DEXes) |
| -t, --token <mint> | Token mint (auto-detected; required for aggregators) |
| --dry-run | Simulate only — preview CU without sending |
outsmart sell
Sell a percentage of your held token balance.
outsmart sell --dex raydium-cpmm --pool <POOL> --pct 100 outsmart sell --dex jupiter-ultra --token <MINT> --pct 50
outsmart quote / find-pool
outsmart quote --dex raydium-cpmm --pool <POOL> outsmart find-pool --dex raydium-cpmm --token <MINT>
Shared Swap Options
| Option | Description | Default |
|---|---|---|
| --slippage <bps> | Slippage tolerance | 300 (3%) |
| --priority <uL> | Priority fee per CU | from env |
| --tip <sol> | MEV tip in SOL | 0.001 |
| --cu <units> | Compute unit limit | auto |
| --jito | Use Jito bundles | false |
| --dry-run | Simulate only | false |
| --quote <mint> | Quote token mint | WSOL |
Stablecoin Auto-Swap
Some pools use USDC/USDT/USD1 as the quote token. The CLI handles the conversion automatically — no extra steps.
# LaunchLab pool quoted in USD1 outsmart buy --dex raydium-launchlab --pool <POOL> --amount 0.1 # → auto-swaps SOL → USD1 → buys token
Uses Jupiter Ultra if JUPITER_API_KEY is set, otherwise falls back to on-chain pools.
Wallet
# Show active wallet outsmart wallet # List all wallets outsmart wallet list # Add / switch / remove outsmart wallet add --label trading outsmart wallet switch trading outsmart wallet remove trading
Balance
outsmart balance # SOL + USDC/USDT/USD1 outsmart balance --token <MINT> # specific token
Liquidity
# Add liquidity outsmart add-liq --dex meteora-dlmm --pool <POOL> --amount-sol 0.5 --strategy spot --bins 50 # Remove / claim fees / list positions outsmart remove-liq --dex meteora-damm-v2 --pool <POOL> --pct 100 outsmart claim-fees --dex meteora-dlmm --pool <POOL> outsmart positions --dex meteora-dlmm --pool <POOL>
Pool Creation
# PumpFun token outsmart create-pump-coin --name "My Token" --symbol "MYTKN" --uri "https://..." # PumpSwap AMM pool outsmart create-pool --base <MINT> --quote So111...112 --base-amount 1000000 --quote-amount 1 # Meteora DAMM v2 custom pool outsmart create-damm-pool --base <MINT> --base-amount 1000000 --quote-amount 0.5 \ --max-fee 5000 --min-fee 100 --dynamic-fee
Percolator Perps
Create and operate permissionless perpetual futures exchanges on Solana. First mover creates the perp market for a trending token and captures ALL leveraged volume fees.
CLI Commands
All prices in USD, all amounts in SOL. Auto-cranks before every trade.
# Create a perp market (you become admin/oracle) outsmart perp create-market --price 150 --lp 2 # Register + fund your trading account outsmart perp init-user -m <MARKET> outsmart perp deposit -m <MARKET> -a 1.0 # Trade (positive = long, negative = short) outsmart perp long -m <MARKET> -s 0.1 outsmart perp short -m <MARKET> -s 0.05 outsmart perp close -m <MARKET> # Check position + market state outsmart perp status -m <MARKET> # Manage collateral outsmart perp withdraw -m <MARKET> -a all # Oracle + keeper outsmart perp set-price -m <MARKET> --price 155.50 outsmart perp crank -m <MARKET> # Discover all markets on-chain outsmart perp markets
| Command | Description |
|---|---|
| perp create-market | Create a new perp exchange (--price, --lp, --tier, --network) |
| perp long / short | Open leveraged position (-m, -s size in SOL) |
| perp close | Close open position |
| perp status | View position and market state |
| perp deposit | Deposit collateral (-a amount in SOL) |
| perp withdraw | Withdraw collateral (-a all supported) |
| perp init-user | Register trading account on a market |
| perp set-price | Push oracle price in USD (admin only) |
| perp crank | Run permissionless keeper crank |
| perp markets | Discover all markets on-chain |
Programmatic API
import { PercolatorAdapter } from "outsmart"; const percolator = new PercolatorAdapter(); // Create perp market (10-step lifecycle) const market = await percolator.createMarket({ collateralMint: "DezXAZ...B263", initialPriceE6: 1_000_000n, tier: "small", network: "devnet", lpCollateral: 1_000_000_000n, }); // Register trader + deposit + open long const { userIdx } = await percolator.initUser(market.slabAddress, "devnet"); await percolator.deposit(market.slabAddress, userIdx, 500_000_000n, "devnet"); await percolator.trade({ slabAddress: market.slabAddress, userIdx, lpIdx: market.lpIndex, size: 100_000_000n, // positive = long network: "devnet", });
Methods (20)
| Method | Description |
|---|---|
| createMarket | Full 10-step market creation (slab → vAMM → LP) |
| initUser | Register a trader account |
| deposit | Deposit collateral |
| withdraw | Withdraw collateral |
| trade | Open/close/modify positions |
| closeAccount | Close account, recover rent |
| crank | Permissionless keeper crank |
| pushOraclePrice | Update oracle price (admin) |
| liquidate | Permissionless liquidation |
| createInsuranceMint | Create insurance LP mint |
| depositInsuranceLP | Deposit into insurance fund |
| withdrawInsuranceLP | Withdraw from insurance fund |
| getMarketState | Read full slab state |
| getMyPosition | Find user’s position |
| discoverMarkets | Find all markets on-chain |
| adminForceClose | Admin force-close a position |
| resolveMarket | Resolve/freeze market (admin) |
| withdrawInsurance | Withdraw insurance fund balance |
| closeSlab | Close slab account, recover rent |
| teardownMarket | Full teardown: resolve → force-close → withdraw → close |
Deployed Programs
| Tier | Devnet | Mainnet |
|---|---|---|
| Small | FxfD37s1...fKrD | GM8zjJ8L...rY24 |
| Medium | FwfBKZXb...j4Qn | — |
| Large | g9msRSV3...9in | — |
| Matcher | 4HcGCsyj...Yfzy | DHP6DtwX...kUX |
DEX Adapters
18 adapters covering every major Solana DEX. All confirmed on mainnet with real transactions.
| Adapter | Protocol | Buy | Sell | Price | LP | Extra |
|---|---|---|---|---|---|---|
| raydium-amm-v4 | AMM v4 | ✓ | ✓ | ✓ | — | findpool |
| raydium-cpmm | CPMM | ✓ | ✓ | ✓ | — | findpool |
| raydium-clmm | CLMM | ✓ | ✓ | ✓ | — | findpool |
| raydium-launchlab | Launchlab | ✓ | ✓ | ✓ | — | findpool, auto-swap |
| meteora-damm-v1 | Dynamic AMM | ✓ | ✓ | ✓ | — | findpool |
| meteora-damm-v2 | CpAmm | ✓ | ✓ | ✓ | full | findpool, create pool |
| meteora-dlmm | DLMM | ✓ | ✓ | ✓ | full | — |
| meteora-dbc | DBC | ✓ | ✓ | ✓ | — | — |
| pumpfun | Bonding Curve | ✓ | ✓ | ✓ | — | create coin |
| pumpfun-amm | PumpSwap AMM | ✓ | ✓ | ✓ | — | create pool |
| orca | Whirlpool | ✓ | ✓ | ✓ | — | — |
| byreal-clmm | CLMM | ✓ | ✓ | ✓ | — | auto-swap |
| pancakeswap-clmm | CLMM | ✓ | ✓ | ✓ | — | — |
| fusion-amm | Fusion | ✓ | ✓ | ✓ | — | — |
| futarchy-amm | Futarchy | ✓ | ✓ | ✓ | — | auto-swap |
| futarchy-launchpad | Launchpad | — | — | — | — | fund/claim |
| jupiter-ultra | Ultra API | ✓ | ✓ | — | — | aggregator |
| dflow | Intent API | ✓ | ✓ | — | — | aggregator |
TX Landing Providers
12 providers running simultaneously. Set the API key and the provider auto-enables.
Programmatic API
Use outsmart as a TypeScript library in your bots, scripts, or AI agents.
import { getDexAdapter, listDexAdapters } from "outsmart"; import "outsmart/dist/dex/raydium-cpmm"; import "outsmart/dist/dex/jupiter-ultra"; const cpmm = getDexAdapter("raydium-cpmm"); // Buy const result = await cpmm.buy({ tokenMint: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v", amountSol: 0.1, opts: { slippageBps: 300 }, }); // Sell 100% await cpmm.sell({ tokenMint: "...", percentage: 100 }); // Read price const price = await cpmm.getPrice!("POOL_ADDRESS");
For AI agent integration, see outsmart-agent.
Configuration
Set via outsmart init or manually in ~/.outsmart/config.env.
| Variable | Description | Default |
|---|---|---|
| PRIVATE_KEY | Base58 wallet private key | required |
| MAINNET_ENDPOINT | Solana RPC endpoint | required |
| DEVNET_ENDPOINT | Solana devnet RPC (Percolator) | not set |
| TX_LANDING_MODE | concurrent | race | random | sequential | concurrent |
| DEFAULT_TIP_SOL | MEV tip in SOL | 0.001 |
| DEFAULT_SLIPPAGE_BPS | Slippage in bps | 300 |
| JUPITER_API_KEY | Jupiter Ultra API key | works without |
| DFLOW_API_KEY | DFlow intent API key | required for dflow |
Architecture
Clean adapter pattern. Each DEX module implements IDexAdapter and self-registers on import.
Common interface: buy, sell, getPrice, findPool, addLiquidity. Zero coupling between adapters.
Simulated before sending by default. Failed sims return immediately. --dry-run for preview.
Exponential backoff on 429/503/network errors. Blockhash expiry retry with fresh blockhash.
Project Structure
src/ cli.ts # CLI entry point (Commander.js) index.ts # Library entry point dex/ types.ts # IDexAdapter interface index.ts # DexRegistry singleton percolator/ adapter.ts # PercolatorAdapter (20 methods) core/ # Vendored @percolator/core SDK ... 18 adapter files helpers/ config.ts # Wallet, connection, env wallets.ts # Multi-wallet management transactions/ send-rpc.ts # Simulation, backoff, dry-run landing/ orchestrator.ts # Multi-provider submission providers/ # 12 provider implementations
Testing
# CI-safe (no RPC or SOL needed) npm run test:unit # 43 unit tests npm run test:registry # 18 adapters registered # Mainnet integration npm run test:raydium # Raydium AMM v4, CPMM, CLMM npm run test:meteora # Meteora DAMM v2, DLMM, DBC npm run test:pumpfun # PumpFun + PumpSwap npm run test:orca # Orca Whirlpool npm run test:clmm # Byreal + PancakeSwap npm run test:api # Jupiter Ultra + DFlow # Devnet integration npm run test:percolator # Percolator perps (devnet)