Execution logo

Execution

CommunityPopular
alsk1992
execution

Execute trades on prediction markets with slippage protection and order management

Overview

Publisheralsk1992
RepositoryCloddsBot
Skill nameexecution
Stars
2.8K
Forks
336
Bundled files
1
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 1 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by alsk1992 on GitHub. Read the source before you install it.

Installation

Install the Execution AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/alsk1992/CloddsBot.git /tmp/CloddsBot
mkdir -p .claude/skills
cp -r /tmp/CloddsBot/src/skills/bundled/execution .claude/skills/execution
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Execution in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Execution on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Execution is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Execution Service - Complete API Reference

Execute trades on Polymarket and Kalshi with slippage protection, maker orders, and order management.

Supported Platforms

PlatformOrder TypesFeatures
PolymarketLimit, Market, Maker-0.5% maker rebate, GTC/FOK
KalshiLimit, MarketUS regulated

Chat Commands

Place Orders

/execute buy poly <market> YES 100 @ 0.52   # Limit buy on Polymarket
/execute sell kalshi <market> NO 50 @ 0.48  # Limit sell on Kalshi
/execute market-buy poly <market> YES 100   # Market buy
/execute market-sell poly <market> NO 50    # Market sell

Maker Orders (Rebates)

/execute maker-buy poly <market> YES 100 @ 0.52   # Post-only buy
/execute maker-sell poly <market> NO 50 @ 0.48    # Post-only sell

Protected Orders (Slippage Protection)

/execute protected-buy poly <market> YES 100 --max-slippage 1%
/execute protected-sell poly <market> NO 50 --max-slippage 0.5%

Order Management

/orders open                                # View open orders
/orders open poly                           # Open orders on Polymarket
/orders cancel <order-id>                   # Cancel specific order
/orders cancel-all                          # Cancel all open orders
/orders cancel-all poly                     # Cancel all on Polymarket

Slippage Estimation

/estimate-slippage poly <market> buy 1000   # Estimate slippage for $1000 buy
/estimate-slippage kalshi <market> sell 500 # Estimate for $500 sell

TypeScript API Reference

Create Execution Service

typescript
import { createExecutionService } from 'clodds/execution';

const executor = createExecutionService({
  polymarket: {
    apiKey: process.env.POLY_API_KEY,
    apiSecret: process.env.POLY_API_SECRET,
    passphrase: process.env.POLY_API_PASSPHRASE,
    privateKey: process.env.PRIVATE_KEY,
  },
  kalshi: {
    apiKey: process.env.KALSHI_API_KEY,
    privateKey: process.env.KALSHI_PRIVATE_KEY,
  },

  // Defaults
  defaultSlippageTolerance: 0.5,  // 0.5%
  autoLogTrades: true,
});

Limit Orders

typescript
// Buy limit order
const order = await executor.buyLimit({
  platform: 'polymarket',
  marketId: 'market-123',
  side: 'YES',
  size: 100,           // $100
  price: 0.52,         // 52 cents
  timeInForce: 'GTC',  // Good-til-cancel
});

console.log(`Order placed: ${order.orderId}`);
console.log(`Status: ${order.status}`);

// Sell limit order
const sellOrder = await executor.sellLimit({
  platform: 'polymarket',
  marketId: 'market-123',
  side: 'YES',
  size: 100,
  price: 0.55,
});

Market Orders

typescript
// Market buy - executes immediately at best price
const order = await executor.marketBuy({
  platform: 'polymarket',
  marketId: 'market-123',
  side: 'YES',
  size: 100,
});

console.log(`Filled at: ${order.avgFillPrice}`);
console.log(`Filled size: ${order.filledSize}`);

// Market sell
const sellOrder = await executor.marketSell({
  platform: 'kalshi',
  marketId: 'TRUMP-WIN',
  side: 'YES',
  size: 50,
});

Maker Orders (Post-Only)

typescript
// Maker buy - only executes as maker (gets rebate)
const order = await executor.makerBuy({
  platform: 'polymarket',
  marketId: 'market-123',
  side: 'YES',
  size: 100,
  price: 0.52,
});

// Will be rejected if it would execute immediately as taker
if (order.status === 'rejected') {
  console.log('Price too aggressive - would be taker');
}

// Maker sell
const sellOrder = await executor.makerSell({
  platform: 'polymarket',
  marketId: 'market-123',
  side: 'NO',
  size: 50,
  price: 0.48,
});

Protected Orders (Slippage Protection)

typescript
// Protected buy - checks slippage before executing
const order = await executor.protectedBuy({
  platform: 'polymarket',
  marketId: 'market-123',
  side: 'YES',
  size: 100,
  maxSlippage: 0.5,  // 0.5% max slippage
});

if (order.status === 'rejected') {
  console.log(`Rejected: slippage would be ${order.estimatedSlippage}%`);
} else {
  console.log(`Executed with ${order.actualSlippage}% slippage`);
}

// Protected sell
const sellOrder = await executor.protectedSell({
  platform: 'kalshi',
  marketId: 'TRUMP-WIN',
  side: 'YES',
  size: 50,
  maxSlippage: 1,
});

Order Management

typescript
// Cancel specific order
await executor.cancelOrder('polymarket', orderId);

// Cancel all orders on platform
await executor.cancelAllOrders('polymarket');

// Cancel all orders for a market
await executor.cancelAllOrders('polymarket', { marketId: 'market-123' });

// Get open orders
const openOrders = await executor.getOpenOrders('polymarket');

for (const order of openOrders) {
  console.log(`${order.orderId}: ${order.side} ${order.size} @ ${order.price}`);
  console.log(`  Status: ${order.status}`);
  console.log(`  Filled: ${order.filledSize}/${order.size}`);
}

Slippage Estimation

typescript
// Estimate slippage before executing
const estimate = await executor.estimateSlippage({
  platform: 'polymarket',
  marketId: 'market-123',
  side: 'buy',
  size: 1000,
});

console.log(`For $1000 buy:`);
console.log(`  Avg fill price: ${estimate.avgFillPrice}`);
console.log(`  Expected slippage: ${estimate.slippagePct}%`);
console.log(`  Total filled: ${estimate.totalFilled}`);
console.log(`  Levels consumed: ${estimate.levelsConsumed}`);

Order Types

TypeDescriptionBest For
LimitExecute at specific price or betterPrice-sensitive orders
MarketExecute immediately at best availableUrgent execution
MakerPost-only, gets rebateCollecting rebates
ProtectedChecks slippage before executingLarge orders

Time In Force

ValueDescription
GTCGood-til-cancel (default)
FOKFill-or-kill - all or nothing
IOCImmediate-or-cancel - fill what you can

Fee Structure

Polymarket (Verified Jan 2026)

  • Most markets: 0% maker, 0% taker (zero fees)
  • 15-min crypto markets: Dynamic taker fees up to ~3% at 50/50 odds; makers eligible for rebate program

Kalshi

  • Taker: Formula-based ~1.2% average, capped at ~2%
  • Maker: ~0.17% (formula-based)

Best Practices

  1. Use maker orders when possible - Pay no fees on Polymarket (most markets)
  2. Check slippage before large orders
  3. Use protected orders for size > $500
  4. Set appropriate timeInForce - GTC for patient orders, FOK for all-or-nothing
  5. Monitor open orders - Cancel stale orders
  6. Start small - Test with small sizes first

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Execution AI skill do?

Execute trades on prediction markets with slippage protection and order management

Why use Execution on TypingMind?

Because you install it once and use it with any model. Execution is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Execution in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/alsk1992/CloddsBot/tree/main/src/skills/bundled/execution. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Execution?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Execution?

As many as you like. As long as a model supports skills, you can use Execution with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Execution AI skill free?

Yes. It is published on GitHub by alsk1992 under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇