Agent skill

History

by alsk1992 in alsk1992/CloddsBot

Trade history tracking, sync, and performance analytics. An agent skill from alsk1992/CloddsBot.

MITAuto-check passed

Install History

skills CLI
$ npx skills add alsk1992/CloddsBot --skill history -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install alsk1992/CloddsBot history --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/alsk1992/CloddsBot.git skills-src && mkdir -p .claude/skills && cp -r skills-src/src/skills/bundled/history .claude/skills/history && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
history
GitHub stars
3k
Token cost
~1.6k tokens
SKILL.md length
93 words
Files
2
Skills in repo
116
Repo updated
First seen
Licence
MIT

At a glance

Trade history tracking, sync, and performance analytics. An agent skill from alsk1992/CloddsBot.

  • Works in 5 steps: Sync regularly - Keep local database up… → Export backups - Periodically export to… → Review weekly - Analyze performance… → …
  • SKILL.md covers Chat Commands, TypeScript API Reference, Database Schema and Best Practices
  • Runs TypeScript scripts from its folder; needs POLY_API_KEY and KALSHI_API_KEY

What it does

History is an agent skill from alsk1992/CloddsBot. Trade history tracking, sync, and performance analytics

Its SKILL.md is about 1.6k tokens, which your agent loads only when the skill is triggered. The skill folder holds 1 other file (for example `index.ts`).

The repository describes itself as: Open Source AI trading agent that operates autonomously across 1000+ markets - Polymarket, Kalshi, Binance, Hyperliquid, Solana DEXs, 5 EVM chains. Scans for edge, executes… The licence is MIT.

Example prompts

  • “/history”

Requirements

  • Node.js
  • A credential in POLY_API_KEY
  • A credential in KALSHI_API_KEY

Workflow steps

5 steps, taken from the first numbered list in SKILL.md.

  1. Sync regularly - Keep local database up to date
  2. Export backups - Periodically export to CSV
  3. Review weekly - Analyze performance patterns
  4. Track by category - Identify strong/weak areas
  5. Monitor drawdown - Set alerts for max drawdown

What it can do on your machine

Read from SKILL.md and the folder at commit c930628. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships script files (TypeScript), which the agent can run.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • POLY_API_KEY
    • KALSHI_API_KEY

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

History loads about 1.6k tokens when it runs. Until then it costs about 16 tokens; SKILL.md has 93 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~16
When it runs · the whole SKILL.md, loaded when a task matches
~1.6k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from alsk1992/CloddsBot at commit c930628, republished under its MIT licence (© alsk1992). 93 words, ~1,632 tokens.

Download SKILL.mdSave it as .claude/skills/history/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
history
description
Trade history tracking, sync, and performance analytics
emoji
📊

Trade History - Complete API Reference

Fetch, sync, and analyze trade history from Polymarket and Kalshi with detailed performance metrics.


Chat Commands

Fetch & Sync
/history fetch                              # Fetch all trades from APIs
/history fetch poly                         # Fetch Polymarket only
/history fetch --from 2024-01-01            # From specific date
/history sync                               # Sync to local database
View History
/history list                               # Recent trades
/history list --limit 50                    # Last 50 trades
/history list --platform poly               # Polymarket only
/history list --market <id>                 # Specific market
Statistics
/history stats                              # Overall statistics
/history stats --period 30d                 # Last 30 days
/history stats --platform kalshi            # Platform-specific
P&L Analysis
/history daily-pnl                          # Daily P&L
/history weekly-pnl                         # Weekly P&L
/history monthly-pnl                        # Monthly P&L
/history by-market                          # P&L by market category
Export
/history export                             # Export to CSV
/history export --format json               # Export as JSON
/history export --from 2024-01-01           # Date range
Filtering
/history filter --side buy                  # Only buys
/history filter --pnl positive              # Only winners
/history filter --pnl negative              # Only losers
/history filter --min-size 100              # Min $100 trades

TypeScript API Reference

Create History Service
typescript
import { createTradeHistoryService } from 'clodds/history';

const history = createTradeHistoryService({
  polymarket: {
    apiKey: process.env.POLY_API_KEY,
    address: process.env.POLY_ADDRESS,
  },
  kalshi: {
    apiKey: process.env.KALSHI_API_KEY,
  },

  // Local storage
  dbPath: './trade-history.db',
});
Fetch Trades from APIs
typescript
// Fetch all trades from exchange APIs
const trades = await history.fetchTrades({
  platforms: ['polymarket', 'kalshi'],
  from: '2024-01-01',
});

console.log(`Fetched ${trades.length} trades`);

// Fetch from specific platform
const polyTrades = await history.fetchTrades({
  platforms: ['polymarket'],
  limit: 100,
});
Sync to Database
typescript
// Sync fetched trades to local database
await history.syncToDatabase();

console.log('Trades synced to database');
Get Trades
typescript
// Get trades from local storage
const trades = await history.getTrades({
  platform: 'polymarket',
  from: '2024-01-01',
  to: '2024-12-31',
  limit: 100,
});

for (const trade of trades) {
  console.log(`${trade.timestamp}: ${trade.side} ${trade.market}`);
  console.log(`  Size: $${trade.size}`);
  console.log(`  Price: ${trade.price}`);
  console.log(`  P&L: $${trade.pnl?.toFixed(2) || 'open'}`);
}
Statistics
typescript
// Get comprehensive statistics
const stats = await history.getStats({
  period: '30d',
  platform: 'polymarket',
});

console.log(`=== Trading Statistics (30d) ===`);
console.log(`Total trades: ${stats.totalTrades}`);
console.log(`Winning trades: ${stats.winningTrades}`);
console.log(`Losing trades: ${stats.losingTrades}`);
console.log(`Win rate: ${(stats.winRate * 100).toFixed(1)}%`);
console.log(`\nP&L:`);
console.log(`  Total: $${stats.totalPnl.toLocaleString()}`);
console.log(`  Gross profit: $${stats.grossProfit.toLocaleString()}`);
console.log(`  Gross loss: $${stats.grossLoss.toLocaleString()}`);
console.log(`  Profit factor: ${stats.profitFactor.toFixed(2)}`);
console.log(`\nTrade sizes:`);
console.log(`  Average: $${stats.avgTradeSize.toFixed(2)}`);
console.log(`  Largest win: $${stats.largestWin.toFixed(2)}`);
console.log(`  Largest loss: $${stats.largestLoss.toFixed(2)}`);
console.log(`\nRisk metrics:`);
console.log(`  Sharpe ratio: ${stats.sharpeRatio.toFixed(2)}`);
console.log(`  Max drawdown: ${(stats.maxDrawdown * 100).toFixed(1)}%`);
Daily P&L
typescript
// Get daily P&L breakdown
const dailyPnl = await history.getDailyPnL({
  days: 30,
  platform: 'polymarket',
});

console.log('=== Daily P&L ===');
for (const day of dailyPnl) {
  const sign = day.pnl >= 0 ? '+' : '';
  const bar = day.pnl >= 0
    ? '█'.repeat(Math.min(Math.floor(day.pnl / 10), 20))
    : '▓'.repeat(Math.min(Math.floor(Math.abs(day.pnl) / 10), 20));

  console.log(`${day.date} | ${sign}$${day.pnl.toFixed(2).padStart(8)} | ${bar}`);
}
Performance by Market
typescript
// Get performance breakdown by market category
const byMarket = await history.getPerformanceByMarket({
  period: '30d',
});

console.log('=== Performance by Market Category ===');
for (const [category, data] of Object.entries(byMarket)) {
  console.log(`\n${category}:`);
  console.log(`  Trades: ${data.trades}`);
  console.log(`  Win rate: ${(data.winRate * 100).toFixed(1)}%`);
  console.log(`  P&L: $${data.pnl.toLocaleString()}`);
  console.log(`  Avg trade: $${data.avgTrade.toFixed(2)}`);
}
Export
typescript
// Export to CSV
await history.exportCsv({
  path: './trades.csv',
  from: '2024-01-01',
  to: '2024-12-31',
  columns: ['timestamp', 'platform', 'market', 'side', 'size', 'price', 'pnl'],
});

// Export to JSON
const json = await history.exportJson({
  from: '2024-01-01',
});

Database Schema

sql
CREATE TABLE trades (
  id TEXT PRIMARY KEY,
  platform TEXT NOT NULL,
  market_id TEXT NOT NULL,
  market_question TEXT,
  side TEXT NOT NULL,  -- 'buy' or 'sell'
  outcome TEXT,        -- 'YES' or 'NO'
  size REAL NOT NULL,
  price REAL NOT NULL,
  fee REAL DEFAULT 0,
  pnl REAL,
  timestamp INTEGER NOT NULL,
  created_at INTEGER DEFAULT (strftime('%s', 'now'))
);

CREATE INDEX idx_trades_platform ON trades(platform);
CREATE INDEX idx_trades_timestamp ON trades(timestamp);
CREATE INDEX idx_trades_market ON trades(market_id);

Best Practices

  1. Sync regularly - Keep local database up to date
  2. Export backups - Periodically export to CSV
  3. Review weekly - Analyze performance patterns
  4. Track by category - Identify strong/weak areas
  5. Monitor drawdown - Set alerts for max drawdown

© alsk1992, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file in src/skills/bundled/history of alsk1992/CloddsBot.

  • SKILL.md
  • index.ts

Open the folder on GitHubat commit c930628

Compare with similar skills

History next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

History compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
History this skillalsk1992/CloddsBot3k—~1.6kAutomated safety check: PassMIT
Agent Trading Predictorruvnet/ruflo74k2 repos~2.5kAutomated safety check: PassMIT
AI-Trader Trade SyncHKUDS/AI-Trader23k—~1.1kAutomated safety check: PassNone
LLM Trading Agent Securityaffaan-m/ECC276k2 repos~1.2kAutomated safety check: PassMIT
Trade Journal AnalysisHKUDS/Vibe-Trading35k—~1.8kAutomated safety check: PassMIT
Trading Ledgersickn33/agentic-awesome-skills47k1 repos~2.2kAutomated safety check: PassMIT

Similar skills

  • Agent skill for trading-predictor - invoke with $agent-trading-predictor

    74k GitHub starsUsed in 2 repos~2.5k tokens
    Business, Finance & HRAuto-check passed
  • AI-Trader Trade Sync

    HKUDS/AI-Trader

    Uploads positions and trade history to the AI-Trader copy-trading platform and pushes real-time buy, sell, short and cover signals to followers.

    23k GitHub stars~1.1k tokensUpdated 4 mo ago
    Business, Finance & HRAuto-check passed
  • Security patterns for autonomous trading agents with wallet or transaction authority.

    276k GitHub starsUsed in 2 repos~1.2k tokens
    SecurityAuto-check passed
  • Trade Journal Analysis

    HKUDS/Vibe-Trading

    Reads a broker export of your trades (CSV or Excel), builds a trading profile and runs four behavior checks: disposition effect, overtrading, chasing and anchoring.

    35k GitHub stars~1.8k tokensUpdated yesterday
    Business, Finance & HRAuto-check passed
  • Trading Ledger

    sickn33/agentic-awesome-skills

    A trading journal that captures the decision, not just the fill: thesis, plan, and emotion at the moment of entry, written to the user's own Notion database; reviews grade decisions, not P&L.

    47k GitHub starsUsed in 1 repo~2.2k tokens
    Business, Finance & HRAuto-check passed
  • Cost Tracking

    affaan-m/ECC

    Track and report Claude Code token usage, spending, and budgets from the local ECC cost-tracker metrics log.

    276k GitHub starsUsed in 1 repo~1.3k tokens
    AI & LLM EngineeringAuto-check passed

More from alsk1992/CloddsBot

All 116 skills in this repo
  • Qmd

    alsk1992/CloddsBot

    Local hybrid search for markdown notes and docs. An agent skill from alsk1992/CloddsBot.

    3k GitHub starsUsed in 3 repos~1.2k tokens
    Auto-check passed
  • AI Strategy

    alsk1992/CloddsBot

    AI Strategy - natural language to trades. An agent skill from alsk1992/CloddsBot.

    3k GitHub stars~670 tokensUpdated 8 days ago
    Auto-check passed
  • Alerts

    alsk1992/CloddsBot

    Create and manage price alerts for prediction markets. An agent skill from alsk1992/CloddsBot.

    3k GitHub stars~460 tokensUpdated 8 days ago
    Auto-check passed
  • Analytics

    alsk1992/CloddsBot

    Performance attribution, trade analytics, and strategy optimization

    3k GitHub stars~1.6k tokensUpdated 8 days ago
    Auto-check passed
  • Arbitrage

    alsk1992/CloddsBot

    Automated cross-platform arbitrage detection and monitoring. An agent skill from alsk1992/CloddsBot.

    3k GitHub stars~1.7k tokensUpdated 8 days ago
    Auto-check passed
  • Auto Reply

    alsk1992/CloddsBot

    Automatic response rules, patterns, and scheduled messages. An agent skill from alsk1992/CloddsBot.

    3k GitHub stars~1.5k tokensUpdated 8 days ago
    Auto-check passed

Questions about History

What does History do?

Trade history tracking, sync, and performance analytics. An agent skill from alsk1992/CloddsBot. History is an agent skill from alsk1992/CloddsBot.

How do I install History in Claude Code?

Run `npx skills add alsk1992/CloddsBot --skill history -a claude-code`. Or copy the skill folder (src/skills/bundled/history in alsk1992/CloddsBot) into .claude/skills/history in your project. Claude Code loads it when a task matches its description.

How do I install History in Codex?

Run `npx skills add alsk1992/CloddsBot --skill history -a codex`. Or copy the skill folder (src/skills/bundled/history in alsk1992/CloddsBot) into .agents/skills/history in your project. Codex loads it when a task matches its description.

Can I use History in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add alsk1992/CloddsBot --skill history -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/history, .gemini/skills/history, .github/skills/history and .opencode/skills/history in your project.

What does History need to run?

Going by SKILL.md and its folder, History needs TypeScript for the scripts in its folder and credentials named POLY_API_KEY and KALSHI_API_KEY. Our summary lists: Node.js; A credential in POLY_API_KEY; A credential in KALSHI_API_KEY.

Does History access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is History safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does History use?

History is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does History use?

About 1.6k tokens (SKILL.md is roughly 6.5k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to History?

Skills that share tags, products or a category with History: Agent Trading Predictor (ruvnet/ruflo, 74k stars), AI-Trader Trade Sync (HKUDS/AI-Trader, 23k stars), LLM Trading Agent Security (affaan-m/ECC, 276k stars) and Trade Journal Analysis (HKUDS/Vibe-Trading, 35k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains History?

alsk1992 (a GitHub user) maintains it in alsk1992/CloddsBot, which has 2,951 GitHub stars. The repository holds 116 skills in this directory. The repository was last updated on October 2, 2026.

Source: alsk1992/CloddsBot on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.