Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
alsk1992 avatar

Trading System

  • 40 installs
  • 610 repo stars
  • Updated June 26, 2026
  • alsk1992/cloddsbot

trading-system is a skill that runs and tracks trading bots with SQLite auto-logging and performance analytics.

About

This skill is a unified trading layer that auto-logs trades to SQLite, manages trading bots, and reports performance analytics. It aggregates portfolio and positions across platforms, computes statistics like win rate, profit factor, and Sharpe ratio, and registers bots running built-in strategies such as mean-reversion, momentum, and arbitrage. A developer uses it to run and track automated trading across the clodds bot's connected platforms.

  • Unified trading system with auto-logging to SQLite
  • Bot management with mean-reversion, momentum, and arbitrage strategies
  • Portfolio view, P&L breakdowns, and performance analytics

Trading System by the numbers

  • 40 all-time installs (skills.sh)
  • Ranked #636 of 1,106 Finance & Trading skills by installs in the Skillselion catalog
  • Data as of Aug 5, 2026 (Skillselion catalog sync)
At a glance

trading-system capabilities & compatibility

Requires a platform API key (Polymarket or Kalshi); logs to a local SQLite file.

Capabilities
bot management · portfolio tracking · pnl analytics · trade logging
Use cases
trading · orchestration
Runs
Runs locally
Pricing
Bring your own API key
From the docs

What trading-system says it does

Unified trading system with auto-logging to SQLite, bot management, and performance analytics.
SKILL.md
Register a bot
SKILL.md
npx skills add https://github.com/alsk1992/cloddsbot --skill trading-system

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs40
repo stars610
Last updatedJune 26, 2026
Repositoryalsk1992/cloddsbot

What it does

Run and track trading bots with auto-logging, portfolio, and P&L analytics.

Who is it for?

Orchestrating strategy bots and tracking portfolio, P&L, and stats across trading platforms.

Skip if: Executing a single manual swap on one DEX.

When should I use this skill?

You need to register/start trading bots or read portfolio, P&L, and performance stats.

What you get

Managed strategy bots with logged trades and computed performance metrics.

  • Managed trading bots
  • Portfolio, P&L, and statistics reports

By the numbers

  • 3 built-in strategies (mean-reversion, momentum, arbitrage)
  • Default maxConcurrent 5 bots

Files

SKILL.mdMarkdownGitHub ↗

Trading System - Complete API Reference

Unified trading system with auto-logging to SQLite, bot management, and performance analytics.

---

Chat Commands

Portfolio

/trading portfolio                          # View all positions
/trading portfolio poly                     # Positions on Polymarket
/trading portfolio --value                  # Include current values

Performance

/trading stats                              # Overall statistics
/trading stats --period 30d                 # Last 30 days
/trading daily-pnl                          # Daily P&L breakdown
/trading weekly-pnl                         # Weekly P&L
/trading monthly-pnl                        # Monthly P&L

Trade History

/trading history                            # Recent trades
/trading history --limit 50                 # Last 50 trades
/trading history --platform poly            # Polymarket only
/trading export                             # Export to CSV
/trading export --format json               # Export as JSON

Bot Management

/bot list                                   # List all bots
/bot register <name> <strategy>             # Register new bot
/bot start <name>                           # Start bot
/bot stop <name>                            # Stop bot
/bot status <name>                          # Bot status
/bot delete <name>                          # Delete bot

Bot Strategies

/bot strategies                             # List available strategies
/bot create mean-reversion --config {...}   # Create with config
/bot create momentum --lookback 14          # Momentum strategy
/bot create arbitrage --min-spread 1        # Arbitrage strategy

---

TypeScript API Reference

Create Trading System

import { createTradingSystem } from 'clodds/trading';

const trading = createTradingSystem({
  // Execution service
  execution: executionService,

  // Auto-logging
  autoLog: true,
  logPath: './trades.db',

  // Bot configuration
  bots: {
    enabled: true,
    maxConcurrent: 5,
  },
});

Portfolio

// Get portfolio
const portfolio = await trading.getPortfolio();

console.log(`Total value: $${portfolio.totalValue.toLocaleString()}`);
console.log(`Unrealized P&L: $${portfolio.unrealizedPnl.toLocaleString()}`);

for (const position of portfolio.positions) {
  console.log(`[${position.platform}] ${position.market}`);
  console.log(`  Side: ${position.side}`);
  console.log(`  Size: ${position.size}`);
  console.log(`  Avg price: ${position.avgPrice}`);
  console.log(`  Current: ${position.currentPrice}`);
  console.log(`  P&L: $${position.unrealizedPnl.toFixed(2)}`);
}

Statistics

// Get trading statistics
const stats = await trading.getStats({ period: '30d' });

console.log(`Total trades: ${stats.totalTrades}`);
console.log(`Win rate: ${(stats.winRate * 100).toFixed(1)}%`);
console.log(`Profit factor: ${stats.profitFactor.toFixed(2)}`);
console.log(`Total P&L: $${stats.totalPnl.toLocaleString()}`);
console.log(`Avg trade: $${stats.avgTrade.toFixed(2)}`);
console.log(`Largest win: $${stats.largestWin.toFixed(2)}`);
console.log(`Largest loss: $${stats.largestLoss.toFixed(2)}`);
console.log(`Sharpe ratio: ${stats.sharpeRatio.toFixed(2)}`);
console.log(`Max drawdown: ${(stats.maxDrawdown * 100).toFixed(1)}%`);

Daily P&L

// Get daily P&L
const dailyPnl = await trading.getDailyPnL({ days: 30 });

for (const day of dailyPnl) {
  const sign = day.pnl >= 0 ? '+' : '';
  console.log(`${day.date}: ${sign}$${day.pnl.toFixed(2)} (${day.trades} trades)`);
}

Export Trades

// Export to CSV
await trading.exportTrades({
  format: 'csv',
  path: './trades.csv',
  from: '2024-01-01',
  to: '2024-12-31',
});

// Export to JSON
const trades = await trading.exportTrades({
  format: 'json',
  from: '2024-01-01',
});

Bot Management

// List bots
const bots = trading.bots.list();

// Register a bot
await trading.bots.register({
  name: 'my-arb-bot',
  strategy: 'arbitrage',
  config: {
    minSpread: 1,
    maxPositionSize: 500,
    platforms: ['polymarket', 'kalshi'],
  },
});

// Start bot
await trading.bots.start('my-arb-bot');

// Get status
const status = trading.bots.getStatus('my-arb-bot');
console.log(`Running: ${status.isRunning}`);
console.log(`Trades today: ${status.tradesToday}`);
console.log(`P&L today: $${status.pnlToday}`);

// Stop bot
await trading.bots.stop('my-arb-bot');

// Delete bot
await trading.bots.delete('my-arb-bot');

Built-in Strategies

// Mean Reversion
await trading.bots.register({
  name: 'mean-rev',
  strategy: 'mean-reversion',
  config: {
    lookbackPeriod: 20,
    deviationThreshold: 2,
    positionSize: 100,
  },
});

// Momentum
await trading.bots.register({
  name: 'momentum',
  strategy: 'momentum',
  config: {
    lookbackPeriod: 14,
    entryThreshold: 0.6,
    exitThreshold: 0.4,
    positionSize: 100,
  },
});

// Arbitrage
await trading.bots.register({
  name: 'arb',
  strategy: 'arbitrage',
  config: {
    minSpread: 1,
    minLiquidity: 500,
    maxPositionSize: 1000,
  },
});

Custom Strategy

// Register custom strategy
trading.bots.registerStrategy('my-strategy', {
  init: async (ctx) => {
    // Initialize state
  },

  evaluate: async (ctx) => {
    // Return signals
    return [
      {
        platform: 'polymarket',
        marketId: 'market-123',
        action: 'buy',
        side: 'YES',
        size: 100,
        reason: 'Signal triggered',
      },
    ];
  },

  onTrade: (trade) => {
    console.log(`Trade executed: ${trade.orderId}`);
  },

  cleanup: async () => {
    // Cleanup
  },
});

---

Auto-Logging

All trades are automatically logged to SQLite:

-- trades table
SELECT * FROM trades
WHERE platform = 'polymarket'
ORDER BY timestamp DESC
LIMIT 10;

-- Get win rate
SELECT
  COUNT(CASE WHEN pnl > 0 THEN 1 END) * 100.0 / COUNT(*) as win_rate
FROM trades;

---

Best Practices

1. Start with paper trading - Use dry-run mode first 2. Set position limits - Prevent overexposure 3. Monitor bots regularly - Don't set and forget 4. Review performance weekly - Adjust strategies 5. Export data regularly - Backup your trade history

Related skills

FAQ

What strategies are built in?

Mean-reversion, momentum, and arbitrage strategies.

How are trades logged?

The system auto-logs to a SQLite database when autoLog is enabled.

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.