Loading...
Loading...
Meteora DLMM plugin for Solana — search liquidity pools, get swap quotes, view user positions, execute token swaps, add and remove liquidity, quickstart wallet check
npx skill4agent add okx/plugin-store meteora-pluginRun once per session before first use. These checks ensure required tools are installed.
AI Agent Instruction: Run this version check before executing any commands from this skill. If an update is applied, re-read this SKILL.md before proceeding — the instructions may have changed.
# Check for skill updates (1-hour cache)
UPDATE_CACHE="$HOME/.plugin-store/update-cache/meteora-plugin"
CACHE_MAX=3600
LOCAL_VER="0.3.7"
DO_CHECK=true
if [ -f "$UPDATE_CACHE" ]; then
CACHE_MOD=$(stat -f %m "$UPDATE_CACHE" 2>/dev/null || stat -c %Y "$UPDATE_CACHE" 2>/dev/null || echo 0)
NOW=$(date +%s)
AGE=$(( NOW - CACHE_MOD ))
[ "$AGE" -lt "$CACHE_MAX" ] && DO_CHECK=false
fi
if [ "$DO_CHECK" = true ]; then
REMOTE_VER=$(curl -sf --max-time 3 "https://raw.githubusercontent.com/okx/plugin-store/main/skills/meteora-plugin/plugin.yaml" | grep '^version' | head -1 | tr -d '"' | awk '{print $2}')
if [ -n "$REMOTE_VER" ]; then
mkdir -p "$HOME/.plugin-store/update-cache"
echo "$REMOTE_VER" > "$UPDATE_CACHE"
fi
fi
REMOTE_VER=$(cat "$UPDATE_CACHE" 2>/dev/null || echo "$LOCAL_VER")
if [ "$REMOTE_VER" != "$LOCAL_VER" ]; then
echo "Update available: meteora-plugin v$LOCAL_VER -> v$REMOTE_VER. Updating..."
npx skills add okx/plugin-store --skill meteora-plugin --yes --global 2>/dev/null || true
echo "Updated meteora-plugin to v$REMOTE_VER. Please re-read this SKILL.md."
fi# 1. Install onchainos CLI
onchainos --version 2>/dev/null || curl -fsSL https://raw.githubusercontent.com/okx/onchainos-skills/main/install.sh | sh
# 2. Install onchainos skills (enables AI agent to use onchainos commands)
npx skills add okx/onchainos-skills --yes --global
# 3. Install plugin-store skills (enables plugin discovery and management)
npx skills add okx/plugin-store --skill plugin-store --yes --global# Install shared infrastructure (launcher + update checker, only once)
LAUNCHER="$HOME/.plugin-store/launcher.sh"
CHECKER="$HOME/.plugin-store/update-checker.py"
if [ ! -f "$LAUNCHER" ]; then
mkdir -p "$HOME/.plugin-store"
curl -fsSL "https://raw.githubusercontent.com/okx/plugin-store/main/scripts/launcher.sh" -o "$LAUNCHER" 2>/dev/null || true
chmod +x "$LAUNCHER"
fi
if [ ! -f "$CHECKER" ]; then
curl -fsSL "https://raw.githubusercontent.com/okx/plugin-store/main/scripts/update-checker.py" -o "$CHECKER" 2>/dev/null || true
fi
# Clean up old installation
rm -f "$HOME/.local/bin/meteora-plugin" "$HOME/.local/bin/.meteora-plugin-core" 2>/dev/null
# Download binary
OS=$(uname -s | tr A-Z a-z)
ARCH=$(uname -m)
EXT=""
case "${OS}_${ARCH}" in
darwin_arm64) TARGET="aarch64-apple-darwin" ;;
darwin_x86_64) TARGET="x86_64-apple-darwin" ;;
linux_x86_64) TARGET="x86_64-unknown-linux-musl" ;;
linux_i686) TARGET="i686-unknown-linux-musl" ;;
linux_aarch64) TARGET="aarch64-unknown-linux-musl" ;;
linux_armv7l) TARGET="armv7-unknown-linux-musleabihf" ;;
mingw*_x86_64|msys*_x86_64|cygwin*_x86_64) TARGET="x86_64-pc-windows-msvc"; EXT=".exe" ;;
mingw*_i686|msys*_i686|cygwin*_i686) TARGET="i686-pc-windows-msvc"; EXT=".exe" ;;
mingw*_aarch64|msys*_aarch64|cygwin*_aarch64) TARGET="aarch64-pc-windows-msvc"; EXT=".exe" ;;
esac
mkdir -p ~/.local/bin
curl -fsSL "https://github.com/okx/plugin-store/releases/download/plugins/meteora-plugin@0.3.7/meteora-plugin-${TARGET}${EXT}" -o ~/.local/bin/.meteora-plugin-core${EXT}
chmod +x ~/.local/bin/.meteora-plugin-core${EXT}
# Symlink CLI name to universal launcher
ln -sf "$LAUNCHER" ~/.local/bin/meteora-plugin
# Register version
mkdir -p "$HOME/.plugin-store/managed"
echo "0.3.7" > "$HOME/.plugin-store/managed/meteora-plugin"REPORT_FLAG="$HOME/.plugin-store/reported/meteora-plugin"
if [ ! -f "$REPORT_FLAG" ]; then
mkdir -p "$HOME/.plugin-store/reported"
# Device fingerprint → SHA256 → 32-char device ID
DEV_RAW="$(hostname):$(uname -s):$(uname -m):$HOME"
DEV_ID=$(echo -n "$DEV_RAW" | shasum -a 256 | head -c 32)
# HMAC signature (obfuscated key, same as CLI binary)
_K=$(echo 'OE9nNWFRUFdfSVJkektrMExOV2RNeTIzV2JibXo3ZWNTbExJUDFIWnVoZw==' | base64 -d 2>/dev/null || echo 'OE9nNWFRUFdfSVJkektrMExOV2RNeTIzV2JibXo3ZWNTbExJUDFIWnVoZw==' | openssl base64 -d)
HMAC_SIG=$(echo -n "${_K}${DEV_ID}" | shasum -a 256 | head -c 8)
DIV_ID="${DEV_ID}${HMAC_SIG}"
unset _K
# Report to Vercel stats
curl -s -X POST "https://plugin-store-dun.vercel.app/install" \
-H "Content-Type: application/json" \
-d '{"name":"meteora-plugin","version":"0.3.7"}' >/dev/null 2>&1 || true
# Report to OKX API (with HMAC-signed device token)
curl -s -X POST "https://www.okx.com/priapi/v1/wallet/plugins/download/report" \
-H "Content-Type: application/json" \
-d '{"pluginName":"meteora-plugin","divId":"'"$DIV_ID"'"}' >/dev/null 2>&1 || true
touch "$REPORT_FLAG"
figet-poolsget-pool-detailget-swap-quotehttps://dlmm.datapi.meteora.agget-user-positionsgetProgramAccountsswaponchainos swap execute --chain solanaadd-liquidityonchainos wallet contract-call --chain 501remove-liquidityremoveLiquidityByRangeclaimFeeclosePositionIfEmptyonchainos wallet contract-call --chain 501meteora get-pools [--page <n>] [--page-size <n>] [--sort-key tvl|volume|apr|fee_tvl_ratio] [--order-by asc|desc] [--search-term <token_symbol_or_address>]meteora get-pools --search-term SOL-USDC --sort-key tvl --order-by desc
meteora get-pools --sort-key apr --order-by desc --page-size 5meteora get-pool-detail --address <pool_address>meteora get-pool-detail --address 5rCf1DM8LjKTw4YqhnoLcngyZYeNnQqztScTogYHAS6meteora get-swap-quote --from-token <mint> --to-token <mint> --amount <readable_amount>from_tokenfrom_symbolto_tokento_symbolfrom_amount_readablefrom_amount_rawto_amount_readable"84.132157"to_amount_rawprice_impact_pctprice_impact_warningmeteora get-swap-quote --from-token So11111111111111111111111111111111111111112 --to-token EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v --amount 1.0meteora get-user-positions [--wallet <address>] [--pool <pool_address>]--walletposition_addresspool_addressownertoken_x_minttoken_y_minttoken_x_amounttoken_y_amounttoken_x_decimalstoken_y_decimalsbin_rangeactive_binssourceUsedirectly asposition_addresswhen calling--position.remove-liquidity
meteora get-user-positions
meteora get-user-positions --wallet GbE9k66MjLRQC7RnMCkRuSgHi3Lc8LJQXWdCmYFtGo2
meteora get-user-positions --pool 5rCf1DM8LjKTw4YqhnoLcngyZYeNnQqztScTogYHAS6meteora swap --from-token <mint> --to-token <mint> --amount <readable_amount> [--slippage <pct>] [--wallet <address>] [--dry-run]--dry-runestimated_outputestimated_output_rawprice_impact_pctmeteora swap --from-token ... --to-token ... --amount ...# Preview swap (dry run)
meteora --dry-run swap --from-token So11111111111111111111111111111111111111112 --to-token EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v --amount 1.0
# Execute swap (after user confirmation)
meteora swap --from-token So11111111111111111111111111111111111111112 --to-token EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v --amount 1.0 --slippage 0.5meteora add-liquidity --pool <pool_address> [--amount-x <float>] [--amount-y <float>] [--bin-range <n>] [--wallet <address>] [--dry-run]--pool--amount-x0.01--amount-y1.5--bin-range--wallet--dry-runokpoolwalletpositionamount_xamount_ytx_hashexplorer_url--dry-runmeteora add-liquidity --pool <addr> --amount-x ... --amount-y ...# Preview adding liquidity to JitoSOL-USDC pool
meteora add-liquidity --pool 8skykrYgFFpQNMhqhKbZoVKXFss55uGPUXhVMfnCzqJv --amount-x 0.01 --amount-y 1.5 --dry-run
# Execute (after user confirmation)
meteora add-liquidity --pool 8skykrYgFFpQNMhqhKbZoVKXFss55uGPUXhVMfnCzqJv --amount-x 0.01 --amount-y 1.5
# Narrow range (5 bins each side instead of default 10)
meteora add-liquidity --pool <addr> --amount-x 0.1 --amount-y 10 --bin-range 5meteora remove-liquidity --pool <pool_address> --position <position_address> [--pct <1-100>] [--close] [--wallet <address>] [--dry-run]--pool--positionget-user-positions--pct--close--wallet--dry-runokpoolpositionwalletpct_removedposition_closedtx_hashexplorer_urlUsefromposition_addressoutput directly asget-user-positions.--position
--dry-run--close--close--pct 100--close"ok": false--close--pct 100--closeclaim_feeclose_position_if_empty# Preview removing all liquidity from a position
meteora remove-liquidity --pool 8skykrYgFFpQNMhqhKbZoVKXFss55uGPUXhVMfnCzqJv --position <position_addr> --dry-run
# Remove 50% of liquidity
meteora remove-liquidity --pool 8skykrYgFFpQNMhqhKbZoVKXFss55uGPUXhVMfnCzqJv --position <position_addr> --pct 50
# Remove all liquidity and close the position (reclaims rent)
meteora remove-liquidity --pool 8skykrYgFFpQNMhqhKbZoVKXFss55uGPUXhVMfnCzqJv --position <position_addr> --closeadd-liquiditymeteora quickstart --pool <pool_address> [--wallet <address>]--pool--walletokwalletpoolsol_balanceusdc_balanceactive_idbin_steptoken_x_minttoken_y_mintsuggestiontwo_sidedx_onlyy_onlyinsufficient_fundsrecommended_commandadd-liquiditymeteora quickstart --pool 5rCf1DM8LjKTw4YqhnoLcngyZYeNnQqztScTogYHAS6| Token | Mint Address |
|---|---|
| SOL (native) | |
| Wrapped SOL | |
| USDC | |
| USDT | |
# Step 1: Find best SOL-USDC pool
meteora get-pools --search-term SOL-USDC --sort-key tvl --order-by desc --page-size 3
# Step 2: Get swap quote
meteora get-swap-quote --from-token So11111111111111111111111111111111111111112 --to-token EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v --amount 1.0
# Step 3: Preview swap (dry run)
meteora --dry-run swap --from-token So11111111111111111111111111111111111111112 --to-token EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v --amount 1.0
# Step 4: Ask user to confirm, then execute
meteora swap --from-token So11111111111111111111111111111111111111112 --to-token EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v --amount 1.0 --slippage 0.5# View all positions for logged-in wallet
meteora get-user-positions
# Filter by specific pool
meteora get-user-positions --pool 5rCf1DM8LjKTw4YqhnoLcngyZYeNnQqztScTogYHAS6# Top pools by APY
meteora get-pools --sort-key apr --order-by desc --page-size 10# Step 1: Find the pool
meteora get-pools --search-term JitoSOL-USDC --sort-key tvl --order-by desc --page-size 3
# Step 2: Preview the liquidity position
meteora add-liquidity --pool 8skykrYgFFpQNMhqhKbZoVKXFss55uGPUXhVMfnCzqJv --amount-x 0.01 --amount-y 1.5 --dry-run
# Step 3: Ask user to confirm, then execute
meteora add-liquidity --pool 8skykrYgFFpQNMhqhKbZoVKXFss55uGPUXhVMfnCzqJv --amount-x 0.01 --amount-y 1.5# Step 1: Find your positions
meteora get-user-positions
# Step 2: Preview removal (dry run)
meteora remove-liquidity --pool 8skykrYgFFpQNMhqhKbZoVKXFss55uGPUXhVMfnCzqJv --position <position_addr> --dry-run
# Step 3: Ask user to confirm, then remove all and close position
meteora remove-liquidity --pool 8skykrYgFFpQNMhqhKbZoVKXFss55uGPUXhVMfnCzqJv --position <position_addr> --close