Skip to content
Automation
Skill

/triggers

Conditional orders that auto-execute when price thresholds are met

From plugin
cloddsbot
651120 skills
Install
$ npx -y skills add alsk1992/CloddsBot --skill triggers --agent claude-code

How it fires

How this skill gets triggered: by you, by Claude, or both.

  • Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
  • You can call itInvoke it directly when you want it.
  • Slash command/triggers

Context preview

The summary Claude sees to decide when to auto-load this skill.

Conditional orders that auto-execute when price thresholds are met

SKILL.md

triggers.SKILL.md
name: triggers
description: "Conditional orders that auto-execute when price thresholds are met"
emoji: "⚡"

Triggers - Complete API Reference

Set up conditional orders that automatically execute trades when price conditions are met. Works across prediction markets, futures, and crypto spot.

---

Chat Commands

Create Trigger Orders

/trigger buy poly "Trump 2028" YES below 0.40 size 100
/trigger buy poly "Fed rate" NO above 0.60 size 50
/trigger sell poly "Trump 2028" YES above 0.55 size all

Futures Triggers

/trigger long binance BTCUSDT below 95000 size 0.1 leverage 10x
/trigger short binance ETHUSDT above 4000 size 1 leverage 20x
/trigger close binance BTCUSDT above 105000

Crypto Spot Triggers

/trigger buy sol SOL below 180 size 100usdc
/trigger sell eth ETH above 4000 size 0.5
/trigger swap arb USDC to ARB below 1.50 size 500

Manage Triggers

/triggers                        List all active triggers
/triggers pending                Show pending only
/triggers history                Triggered order history
/trigger cancel <id>             Cancel trigger
/trigger cancel all              Cancel all triggers

Stop-Loss & Take-Profit

/sl poly "Trump" at 0.35         Stop-loss on position
/tp poly "Trump" at 0.65         Take-profit on position
/trailing-stop poly "Trump" 10%  Trailing stop (% from high)

---

TypeScript API Reference

Create Trigger Service

import { createTriggerService } from 'clodds/triggers';

const triggers = createTriggerService({
  // Price monitoring
  checkIntervalMs: 5000,  // Check every 5 seconds

  // Execution
  maxSlippagePercent: 2,
  retryAttempts: 3,

  // Storage
  storage: 'sqlite',
  dbPath: './triggers.db',
});

// Start monitoring
await triggers.start();

Create Prediction Market Trigger

// Buy YES when price drops below threshold
const trigger = await triggers.create({
  type: 'entry',
  platform: 'polymarket',
  market: 'will-trump-win-2028',
  side: 'YES',
  direction: 'below',
  triggerPrice: 0.40,
  size: 100,  // $100
  orderType: 'limit',  // 'market' | 'limit'
  limitPrice: 0.41,    // Optional: max price for limit
});

console.log(`Trigger ID: ${trigger.id}`);
console.log(`Status: ${trigger.status}`);  // 'pending'

// Sell when price rises above threshold
await triggers.create({
  type: 'exit',
  platform: 'polymarket',
  market: 'will-trump-win-2028',
  side: 'YES',
  direction: 'above',
  triggerPrice: 0.55,
  size: 'all',  // Sell entire position
});

Create Futures Trigger

// Long entry when BTC drops below support
await triggers.create({
  type: 'entry',
  platform: 'binance',
  symbol: 'BTCUSDT',
  side: 'long',
  direction: 'below',
  triggerPrice: 95000,
  size: 0.1,
  leverage: 10,

  // Auto-set SL/TP on fill
  stopLoss: 93000,
  takeProfit: 105000,
});

// Short entry when ETH breaks above resistance
await triggers.create({
  type: 'entry',
  platform: 'bybit',
  symbol: 'ETHUSDT',
  side: 'short',
  direction: 'above',
  triggerPrice: 4000,
  size: 1,
  leverage: 20,
});

// Close position when price target hit
await triggers.create({
  type: 'exit',
  platform: 'binance',
  symbol: 'BTCUSDT',
  direction: 'above',
  triggerPrice: 105000,
  size: 'all',
});

Create Crypto Spot Trigger

// Buy SOL when price drops
await triggers.create({
  type: 'entry',
  platform: 'jupiter',  // Solana DEX
  tokenIn: 'USDC',
  tokenOut: 'SOL',
  direction: 'below',
  triggerPrice: 180,
  size: 100,  // 100 USDC
  slippagePercent: 1,
});

// Sell ETH when price rises
await triggers.create({
  type: 'exit',
  platform: 'uniswap',  // EVM DEX
  chain: 'ethereum',
  tokenIn: 'ETH',
  tokenOut: 'USDC',
  direction: 'above',
  triggerPrice: 4000,
  size: 0.5,
});

Stop-Loss & Take-Profit

// Set stop-loss on existing position
await triggers.setStopLoss({
  platform: 'polymarket',
  market: 'will-trump-win-2028',
  side: 'YES',
  triggerPrice: 0.35,
  size: 'all',
});

// Set take-profit
await triggers.setTakeProfit({
  platform: 'polymarket',
  market: 'will-trump-win-2028',
  side: 'YES',
  triggerPrice: 0.65,
  size: 'all',
});

// Trailing stop (follows price up, triggers on pullback)
await triggers.setTrailingStop({
  platform: 'polymarket',
  market: 'will-trump-win-2028',
  side: 'YES',
  trailPercent: 10,  // Trigger if drops 10% from high
  size: 'all',
});

Multi-Condition Triggers

// Trigger only when multiple conditions met
await triggers.create({
  type: 'entry',
  platform: 'polymarket',
  market: 'will-trump-win-2028',
  side: 'YES',

  conditions: [
    { type: 'price', direction: 'below', value: 0.40 },
    { type: 'volume24h', direction: 'above', value: 100000 },
    { type: 'spread', direction: 'below', value: 0.02 },
  ],

  // All conditions must be true
  conditionLogic: 'AND',  // 'AND' | 'OR'

  size: 100,
});

One-Cancels-Other (OCO)

// OCO: Either SL or TP triggers, other cancels
const oco = await triggers.createOCO({
  platform: 'binance',
  symbol: 'BTCUSDT',

  stopLoss: {
    direction: 'below',
    triggerPrice: 93000,
    size: 'all',
  },

  takeProfit: {
    direction: 'above',
    triggerPrice: 105000,
    size: 'all',
  },
});

List & Manage Triggers

// List all triggers
const all = await triggers.list();

for (const t of all) {
  console.log(`${t.id}: ${t.platform} ${t.market || t.symbol}`);
  console.log(`  ${t.direction} ${t.triggerPrice}`);
  console.log(`  Status: ${t.status}`);
  console.log(`  Created: ${t.createdAt}`);
}

// Get pending only
const pending = await triggers.list({ status: 'pending' });

// Get history (triggered)
const history = await triggers.list({ status: 'triggered' });

// Cancel trigger
await triggers.cancel(triggerId);

// Cancel all
await triggers.cancelAll();

Event Handlers

// Trigger activated
triggers.
Read more
Ships withcloddsbot

Open Source AI trading agent that operates autonomously across 1000+ markets - Polymarket, Kalshi, Binance, Hyperliquid, Solana DEXs, 5 EVM chains. Scans for edge, executes instantly, manages risk while you sleep. Agent commerce protocol for machine-to-machine payments. Self-hosted. Built on Claude.

Get the whole plugin
Stats
651
Stars
139
Forks
Maintained
Maintenance
TypeScript
Language
MIT
License
1mo ago
Last commit
6mo ago
Created

Repo: alsk1992/CloddsBot