Use this file to discover all available pages before exploring further.
Practical examples that build from one-liners to full automation scripts. Every command is copy-pasteable and every JSON output is realistic.
Want scheduled automations? See the Automations page for production-ready cron jobs — airdrop scanners, transaction monitors, nightly exports, and more.
All examples assume you’ve already authenticated with octav auth set-key YOUR_API_KEY. See Authentication for setup.
# Get top tokens by value using jqoctav portfolio get --addresses 0x742d35Cc6634C0532925a3b844Bc9e7595f2bD68 --raw \ | jq '[.tokens | sort_by(-.value) | .[:5][] | {symbol, value: (.value | round), chain}]'
Aggregate NAV across multiple wallets into a summary.
#!/bin/bash# aggregate-nav.sh — Sum NAV across all treasury walletsWALLETS="0x742d35Cc6634C0532925a3b844Bc9e7595f2bD68,0xAb5801a7D398351b8bE11C439e05C5B3259aeC9B,7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU"echo "Treasury NAV Report — $(date +%Y-%m-%d)"echo "================================"# Fetch NAV for all wallets in one callRESULT=$(octav portfolio nav --addresses "$WALLETS" --raw)# Parse and display per-wallet breakdownecho "$RESULT" | jq -r ' .wallets[] | " \(.address[0:6])...\(.address[-4:]): $\(.nav | round)"'# Calculate totalTOTAL=$(echo "$RESULT" | jq '[.wallets[].nav] | add | round')echo "================================"echo " Total: \$$TOTAL"
Monitor a wallet for large transactions and log alerts.
#!/bin/bash# whale-alert.sh — Detect large transactionsADDR="0xAb5801a7D398351b8bE11C439e05C5B3259aeC9B"ALERT_THRESHOLD=50000 # USD valueCHECK_INTERVAL=300 # seconds (5 minutes)LAST_CHECK_FILE="/tmp/whale-alert-last-check"# Initialize last check time[ ! -f "$LAST_CHECK_FILE" ] && date -u +%Y-%m-%d > "$LAST_CHECK_FILE"SINCE=$(cat "$LAST_CHECK_FILE")while true; do echo "[$(date)] Checking for whale transactions since $SINCE..." # Fetch recent transactions TXNS=$(octav transactions get \ --addresses "$ADDR" \ --start-date "$SINCE" \ --limit 50 \ --raw) # Filter for large transactions echo "$TXNS" | jq -r --argjson threshold "$ALERT_THRESHOLD" ' .transactions[] | select(.value_usd > $threshold) | "WHALE ALERT: \(.type) \(.amount) \(.token_symbol) ($\(.value_usd)) on \(.chain) — \(.date)" ' # Update last check date -u +%Y-%m-%d > "$LAST_CHECK_FILE" sleep "$CHECK_INTERVAL"done
[2025-01-15 14:30:01] Checking for whale transactions since 2025-01-15...WHALE ALERT: swap 80.0 ETH ($276000) on ethereum — 2025-01-15WHALE ALERT: transfer 500000.0 USDC ($500000) on ethereum — 2025-01-15
Portfolio Analysis — $184,230Your DeFi positions look healthy:• Aave V3: $55.4K supplied, $8.2K borrowed (health factor 2.14 — safe)• Uniswap V3: $12.3K LP, currently in rangeRebalancing Suggestions:1. Your WBTC ($27.6K) is sitting idle — deposit into Aave to earn 0.5-2% APY and improve capital efficiency2. Consider narrowing your Uniswap V3 range for higher fee capture (current range may be too wide)3. 45% ETH concentration is aggressive — if you're bearish short-term, rotating 10% to stables would bring you to a more neutral position