Skip to content

Feature Request: Built-in monitoring script lifecycle management #33

@joseph-eldo

Description

@joseph-eldo

Feature Request: Built-in monitoring script lifecycle management

Issue

When users start monitoring scripts (like auto-sell bots), they run in the background and there's no easy way to:

  • Check if any monitors are currently active
  • See what they're watching and their targets
  • Stop them without manually finding and killing processes

User experience:

  1. User starts auto-sell bot: nohup ./auto-sell-peyote.sh &
  2. Hours/days pass, user forgets it's running
  3. User has to remember to check: ps aux | grep auto-sell
  4. User has to manually kill: pkill -f auto-sell-peyote.sh

This creates confusion and potential issues:

  • Multiple monitoring scripts could be running for tokens no longer held
  • No centralized way to see what's being monitored
  • Easy to forget and leave orphaned processes

Proposed Solution

Add built-in monitoring/target management to SlopeSniper:

1. Commands

# Set a target for auto-sell
slopesniper target add MINT --mcap 300000
slopesniper target add MINT --price 0.01
slopesniper target add MINT --gain 100  # 100% gain

# List active targets
slopesniper target list

# Remove a target
slopesniper target remove MINT

# View monitoring status
slopesniper monitor status

# Start the monitoring daemon (if not running)
slopesniper monitor start

# Stop monitoring
slopesniper monitor stop

2. Status Command Integration

Add monitoring info to slopesniper status:

{
  "wallet": { ... },
  "strategy": { ... },
  "monitoring": {
    "active": true,
    "targets": [
      {
        "mint": "HP9V5Un3...",
        "symbol": "Peyote",
        "trigger": "mcap >= 300000",
        "action": "sell 100%",
        "current_mcap": 97345,
        "progress": "32%"
      }
    ]
  }
}

3. Persistent Storage

Store targets in ~/.slopesniper/targets.json:

{
  "targets": [
    {
      "id": "uuid-here",
      "mint": "HP9V5Un3uvoex7JQEyUUSiW4yb2mRmEt9Z23axW7fLSn",
      "symbol": "Peyote",
      "created_at": "2026-01-27T22:45:00Z",
      "trigger_type": "market_cap",
      "trigger_value": 300000,
      "action": "sell",
      "action_amount": "all",
      "last_check": "2026-01-28T16:10:00Z",
      "check_count": 1250
    }
  ]
}

4. Background Daemon

Option A: systemd/launchd service (advanced users)

# Install as service
slopesniper monitor install

# Service monitors targets every 30s
# Executes actions when triggers hit
# Logs to ~/.slopesniper/monitor.log

Option B: On-demand polling (simpler)

# CLI checks targets on each invocation
slopesniper monitor check

# User can schedule via cron/launchd
*/1 * * * * ~/.local/bin/slopesniper monitor check

5. Notifications

When a target is hit:

🎯 TARGET HIT: Peyote reached market cap $300,000
   Action: Selling 71,008 tokens
   Executing trade...
   ✅ Sold for $7.50 (signature: 5Kdw...)
   Target removed automatically.

Implementation Notes

Storage:

  • Use SQLite (already in use for trade history)
  • Add monitoring_targets table
  • Link to positions table for context

Daemon Options:

  1. Simple cron - User schedules monitor check (requires manual setup)
  2. Long-running process - Runs in background, checks every N seconds
  3. Systemd/launchd service - Proper OS integration (most robust)

Start with simple cron, expand to daemon later.

Safety:

  • Target expires after 7 days (configurable)
  • Auto-remove targets for tokens no longer held
  • Confirm before executing large sells (unless auto-execute enabled)

Automatic Cleanup:

  • When user closes a position (via slopesniper sell), automatically remove any monitoring targets for that token
  • Check on every sell command: if selling entire position → delete associated targets
  • No manual cleanup needed - selling stops monitoring automatically

Key Feature: Auto-Stop on Position Close

Critical requirement: When a user closes a position, monitoring should automatically stop.

How it works:

  1. User sets target: slopesniper target add BONK --mcap 100000
  2. User sells position: slopesniper sell BONK all
  3. System automatically removes the BONK target - no manual cleanup needed
  4. Confirmation message: 🗑️ Removed monitoring target for BONK (position closed)

Detection:

  • After every slopesniper sell command, check if the position is fully closed
  • If wallet balance for that token = 0 → remove all associated targets
  • Prevents monitoring tokens the user no longer holds

Benefits:

  • Zero maintenance - Users don't need to remember to stop monitoring
  • No orphaned monitors - System stays clean automatically
  • Logical behavior - "I sold it, so stop watching it"

Benefits

  1. Discoverability - slopesniper status shows what's being monitored
  2. Centralized - One place to manage all targets
  3. Persistent - Survives system restarts (if using service)
  4. Clean - No orphaned background scripts
  5. Portable - Works across different setups
  6. Auto-cleanup - Selling a position automatically stops monitoring it

User Flow

Current (Manual Scripts)

# Start monitoring
$ nohup ./auto-sell-peyote.sh &
[1] 12345

# Hours later... "Is it still running?"
$ ps aux | grep auto-sell
joseph  12345  ... ./auto-sell-peyote.sh

# Stop it
$ pkill -f auto-sell-peyote.sh

# Move to new token - need new script!

Proposed (Built-in)

# Set target
$ slopesniper target add Peyote --mcap 300000
✅ Target added: Peyote → sell at $300k mcap

# Check status anytime
$ slopesniper status
...
Monitoring:
  - Peyote: 97k / 300k (32%)

# Add another
$ slopesniper target add BONK --gain 50
✅ Target added: BONK → sell at +50% gain

# List all
$ slopesniper target list
1. Peyote → mcap >= 300k (sell all)
2. BONK → gain >= 50% (sell all)

# Remove one manually
$ slopesniper target remove Peyote
✅ Removed target for Peyote

# Or close the position - monitoring auto-stops!
$ slopesniper sell BONK all
✅ Sold BONK for $75
🗑️  Removed monitoring target for BONK (position closed)

# Clean!

Related Issues

Priority

Medium-High - Quality of life improvement that prevents confusion and improves UX significantly.

Testing

  1. Set target for token
  2. Restart system
  3. Run slopesniper status - should show active target
  4. Token hits target → auto-executes
  5. Target auto-removed after execution
  6. Verify no orphaned processes

Bottom line: Users shouldn't have to remember background processes. The tool should track and display them.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions