Skill: dagangtj/binance-trading-assistant (version 1.0.0)

# Binance Trading Assistant Skill Monitor Binance account balances, positions, and get price alerts through your AI assistant. ## Capabilities This skill enables your AI assistant to: - Query Binance spot and futures balances - Monitor open positions with real-time P&L - Track portfolio performance - Set price alerts for cryptocurrencies ## Commands The assistant can handle requests like: - "Check my Binance balance" - "Show my open positions" - "What's my total P&L today?" - "How much BTC do I have?" ## Setup 1. Create Binance API keys (read-only recommended) 2. Store credentials in `~/.openclaw/secrets/binance.json`: ```json { "apiKey": "your_api_key", "secret": "your_api_secret" } ``` ## Tools ### check_binance_balance Query account balances across spot and futures. **Usage**: "Check my Binance balance" ### check_positions List all open futures positions with P&L. **Usage**: "Show my open positions" ### get_portfolio_summary Get a complete portfolio overview. **Usage**: "What's my portfolio worth?" ## Safety - Use read-only API keys - Keys stored locally, never transmitted - No trading permissions required ## Pricing $5/month subscription via ClawHub ## Author AI Trading Tools

path: README.md
content: # Binance Trading Assistant

**Monitor your Binance account, track positions, and get real-time alerts — all through your AI assistant.**

## Features

- 💰 **Balance Monitoring** - Check spot & futures balances instantly
- 📊 **Position Tracking** - Monitor open positions with P&L
- 🔔 **Price Alerts** - Get notified when prices hit your targets
- 📈 **Market Summary** - Quick overview of your portfolio

## Installation

```bash
clawhub install binance-trading-assistant
```

## Configuration

Set your Binance API credentials:

```bash
export BINANCE_API_KEY="your_api_key"
export BINANCE_API_SECRET="your_api_secret"
```

## Usage

Ask your assistant:
- "Check my Binance balance"
- "Show my open positions"
- "What's my total P&L?"
- "Alert me when BTC hits $100k"

## Pricing

$5/month - Cancel anytime

## Safety

- Read-only API access recommended
- Your keys never leave your machine
- All data stays local

## Support

Issues? Contact: [your-contact]

---

**Made with ❤️ for crypto traders**


path: package.json
content: {
  "name": "binance-trading-assistant",
  "version": "1.0.0",
  "description": "Monitor Binance balances, positions, and get trading alerts",
  "author": "AI Trading Tools",
  "license": "MIT",
  "pricing": {
    "model": "subscription",
    "price": 5,
    "currency": "USD",
    "interval": "month"
  },
  "keywords": ["binance", "trading", "crypto", "balance", "positions", "alerts"],
  "category": "finance",
  "dependencies": {
    "ccxt": "^4.0.0"
  },
  "scripts": {
    "check-balance": "node scripts/check_balance.js",
    "check-positions": "node scripts/check_positions.js"
  }
}


path: scripts/check_balance.js
content: #!/usr/bin/env node
/**
 * Binance Trading Assistant - Balance Checker
 * Queries Binance spot and futures balances
 */

const ccxt = require('ccxt');
const fs = require('fs');
const path = require('path');

async function checkBalance() {
  try {
    // Load credentials
    const secretsPath = path.join(process.env.HOME, '.openclaw/secrets/binance.json');
    if (!fs.existsSync(secretsPath)) {
      console.error('Error: Binance credentials not found. Please create ~/.openclaw/secrets/binance.json');
      process.exit(1);
    }

    const credentials = JSON.parse(fs.readFileSync(secretsPath, 'utf8'));
    
    // Initialize exchange
    const exchange = new ccxt.binance({
      [REDACTED_SECRET],
      [REDACTED_SECRET],
      options: { defaultType: 'spot' }
    });

    // Fetch spot balance
    const spotBalance = await exchange.fetchBalance();
    const spotTotal = Object.entries(spotBalance.total)
      .filter(([_, amount]) => amount > 0)
      .map(([currency, amount]) => ({ currency, amount: parseFloat(amount.toFixed(8)) }));

    // Fetch futures balance
    const futuresExchange = new ccxt.binance({
      [REDACTED_SECRET],
      [REDACTED_SECRET],
      options: { defaultType: 'future' }
    });
    
    const futuresBalance = await futuresExchange.fetchBalance();
    const futuresUSDT = futuresBalance.USDT ? futuresBalance.USDT.total : 0;

    // Fetch positions
    const positions = await futuresExchange.fetchPositions();
    const openPositions = positions.filter(p => parseFloat(p.contracts) !== 0);
    
    let totalUnrealizedPnl = 0;
    openPositions.forEach(p => {
      totalUnrealizedPnl += p.unrealizedPnl || 0;
    });

    // Output results
    const result = {
      timestamp: new Date().toISOString(),
      spot: spotTotal,
      futures: {
        balance: parseFloat(futuresUSDT.toFixed(2)),
        unrealizedPnl: parseFloat(totalUnrealizedPnl.toFixed(2)),
        openPositions: openPositions.length
      },
      totalValue: parseFloat((spotTotal.reduce((sum, item) => {
        // Simplified: only count USDT for now
        return item.currency === 'USDT' ? sum + item.amount : sum;
      }, 0) + futuresUSDT + totalUnrealizedPnl).toFixed(2))
    };

    console.log(JSON.stringify(result, null, 2));
    
  } catch (error) {
    console.error('Error checking balance:', error.message);
    process.exit(1);
  }
}

checkBalance();


Security scan verdicts — ClawScan: suspicious | static analysis: clean | VirusTotal: clean | SkillSpector: suspicious (CRITICAL)