-
Notifications
You must be signed in to change notification settings - Fork 1
Closed
Description
Feature Request: Auto-Sell Based on Market Cap Target
Summary
Add built-in functionality to automatically sell a position when a token reaches a target market cap.
Use Case
As a trader, I want to set a market cap target for my positions and have them automatically sell when that target is reached, without needing to manually monitor prices.
Current Workaround
Created a bash script that polls slopesniper price every 30 seconds and executes slopesniper sell all when the target is hit:
#!/bin/bash
# Auto-sell Peyote when market cap hits $300k
MINT="HP9V5Un3uvoex7JQEyUUSiW4yb2mRmEt9Z23axW7fLSn"
TARGET_MCAP=300000
CHECK_INTERVAL=30 # seconds between checks
SLOPESNIPER="$HOME/.local/bin/slopesniper"
echo "=========================================="
echo " Peyote Auto-Sell Bot"
echo "=========================================="
echo "Target: Market cap >= \$300,000"
echo "Check interval: ${CHECK_INTERVAL}s"
echo "Monitoring: $MINT"
echo ""
while true; do
# Get market cap from price command
MCAP=$($SLOPESNIPER price "$MINT" 2>&1 | grep '"market_cap"' | grep -o '[0-9.]*' | head -1)
if [ -z "$MCAP" ]; then
echo "[$(date '+%Y-%m-%d %H:%M:%S')] ⚠️ Failed to fetch market cap, retrying..."
sleep $CHECK_INTERVAL
continue
fi
# Convert to integer for comparison
MCAP_INT=$(echo "$MCAP" | cut -d. -f1)
echo "[$(date '+%Y-%m-%d %H:%M:%S')] 📊 Market cap: \$${MCAP_INT}"
# Check if we hit target
if [ "$MCAP_INT" -ge "$TARGET_MCAP" ]; then
echo ""
echo "=========================================="
echo "🎯 TARGET HIT! Market cap: \$${MCAP_INT}"
echo "=========================================="
echo ""
echo "Executing sell order..."
# Execute the sell
SELL_RESULT=$($SLOPESNIPER sell "$MINT" all 2>&1)
echo "$SELL_RESULT"
# Check if successful
if echo "$SELL_RESULT" | grep -q '"success": true'; then
echo ""
echo "✅ SELL EXECUTED SUCCESSFULLY!"
echo ""
echo "=========================================="
exit 0
else
echo ""
echo "❌ SELL FAILED - check output above"
echo "Exiting..."
exit 1
fi
fi
sleep $CHECK_INTERVAL
doneProposed Solution
Option 1: CLI Command
slopesniper watch <TOKEN> --sell-at-mcap 300000Option 2: Strategy-Based Auto-Sell
# Set target when buying
slopesniper buy BONK 25 --target-mcap 500000
# Set target for existing position
slopesniper set-target BONK --mcap 500000
# List active targets
slopesniper targetsOption 3: Background Service
# Start the watcher service
slopesniper daemon start
# Add a target
slopesniper target add BONK --mcap 500000 --sell-percent 100
# List targets
slopesniper target list
# Remove target
slopesniper target remove BONKFeatures to Consider
-
Multiple target types:
- Market cap threshold
- USD price threshold
- Percentage gain/loss (trailing stop)
- Time-based exit
-
Partial sells:
- Sell 50% at 2x, hold rest
- Ladder sells (25% at 2x, 25% at 3x, etc.)
-
Notifications:
- Alert when target is hit
- Option to confirm before executing
-
Persistence:
- Store targets in database
- Survive restarts
-
Safety:
- Configurable check intervals
- Rate limiting to avoid spam
- Dry-run mode
Benefits
- Set and forget - no manual monitoring needed
- Automated profit taking
- Risk management (stop losses)
- Better execution - instant response to price movements
- Scales to multiple positions
Implementation Notes
Could use existing Jupiter/DexScreener APIs for price monitoring. Store targets in SQLite alongside trade history. Background service could be a simple daemon or integrate with system services (systemd, launchd).
Related
- Could also support buy targets - auto-buy when price/mcap drops to X
- Integration with portfolio tracking
- Alert-only mode (notify but don't execute)
Metadata
Metadata
Assignees
Labels
No labels