defi-trading-systems

defi-trading-systems is a skill for Claude Code from organvm-iv-taxis/a-i--skills. It costs 31 tokens per session (4,634 once invoked), scanned A, original, Apache-2.0.

Guidance for designing DeFi trading systems, which are programs that trade assets through blockchain-based financial services. It covers perpetual futures, liquidity provision, automated market makers, risk management, and protection from transaction-order attacks.

In plain words
What is it for?
Use it to plan perpetual-futures strategies, provide liquidity, build automated trading systems, size positions, set stop losses, hedge portfolios, and reduce some MEV risks.
Why use it?
It helps account for risks that are specific to these markets, such as leverage, liquidation, impermanent loss, funding payments, frontrunning, and sandwich attacks.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the example-skills plugin — 47 skills, 2 commands, 1 agent shipped together

Good fit Use it to plan perpetual-futures strategies, provide liquidity, build automated trading systems, size positions, set stop losses, hedge portfolios, and reduce some MEV risks.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/organvm-iv-taxis/a-i--skills/defi-trading-systems
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add organvm-iv-taxis/a-i--skills --skill defi-trading-systems
Clone the repo
git clone --depth 1 https://github.com/organvm-iv-taxis/a-i--skills

Made for: Claude Code.

Or install example-skills, the plugin that ships this one along with the rest of its 47 skills, 2 commands, 1 agent.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for defi-trading-systems

README.md
[![agentmods](https://agentmods.dev/badge/skills/organvm-iv-taxis/a-i--skills/defi-trading-systems/github.svg)](https://agentmods.dev/skills/organvm-iv-taxis/a-i--skills/defi-trading-systems)
Your own site
<a href="https://agentmods.dev/skills/organvm-iv-taxis/a-i--skills/defi-trading-systems"><img src="https://agentmods.dev/badge/skills/organvm-iv-taxis/a-i--skills/defi-trading-systems/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for defi-trading-systems

Your own site · 80×15
<a href="https://agentmods.dev/skills/organvm-iv-taxis/a-i--skills/defi-trading-systems"><img src="https://agentmods.dev/badge/skills/organvm-iv-taxis/a-i--skills/defi-trading-systems.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 31 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,634 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 1 finding, up to medium

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • medium Data Exfiltration · line 527
    Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
    Fix: Verify the destination URL is trusted and necessary. Remove or replace with documented APIs. Ensure no secrets, tokens, or PII are transmitted.
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00031 $0.04634
Opus 5 $0.00015 $0.02317
Sonnet 5 $0.00006 $0.00927
Haiku 4.5 $0.00003 $0.00463

Measured 12d ago against content hash a621383881a4, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

defi-trading-systems scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 12d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

response = requests.post(self.url, json=bundle, headers=headers)
distributions/claude/skills/defi-trading-systems/SKILL.md · 667 lines

How it starts

The opening of the file, as written. The whole thing — 667 lines — stays where its author put it; the contents beside it link to each section on GitHub.

DeFi Trading Systems

This skill provides guidance for building decentralized finance trading systems, with focus on perpetual futures, automated market makers, and risk management.

Core Competencies

  • Perpetual Futures: Funding rates, leverage, liquidation mechanics
  • Automated Market Makers: Liquidity provision, impermanent loss
  • Risk Management: Position sizing, stop losses, portfolio hedging
  • MEV Protection: Sandwich attacks, frontrunning mitigation

DeFi Trading Fundamentals

Perpetual Futures Mechanics

Traditional Futures:              Perpetual Futures:
┌─────────────────┐              ┌─────────────────┐
│   Expiry Date   │              │   No Expiry     │
│   Settlement    │              │   Funding Rate  │
│   Roll Cost     │              │   Continuous    │
└─────────────────┘              └─────────────────┘

Funding Rate = (Mark Price - Index Price) / Index Price × Interval

If funding > 0: Longs pay Shorts
If funding < 0: Shorts pay Longs

Key Concepts

Term Definition
Mark Price Fair value used for liquidation
Index Price Spot price from exchanges
Funding Rate Periodic payment between longs/shorts
Maintenance Margin Minimum equity to avoid liquidation
Liquidation Price Price at which position is forcibly closed

Position Management

Position Sizing

from dataclasses import dataclass
from decimal import Decimal

@dataclass
class Position:
    symbol: str
    side: str  # 'long' or 'short'
    size: Decimal
    entry_price: Decimal
    leverage: int
    margin: Decimal

    @property
    def notional_value(self) -> Decimal:
        return self.size * self.entry_price

    @property
    def liquidation_price(self) -> Decimal:
        """Calculate liquidation price"""
        maintenance_margin_rate = Decimal('0.005')  # 0.5%

        if self.side == 'long':
            # Liq price = Entry × (1 - Initial Margin + Maintenance Margin)
            return self.entry_price * (
                1 - (1 / self.leverage) + maintenance_margin_rate
            )
        else:
            return self.entry_price * (
                1 + (1 / self.leverage) - maintenance_margin_rate
            )

    def unrealized_pnl(self, current_price: Decimal) -> Decimal:
        """Calculate unrealized P&L"""
        if self.side == 'long':
            return self.size * (current_price - self.entry_price)
        else:
            return self.size * (self.entry_price - current_price)

    def roi_percent(self, current_price: Decimal) -> Decimal:
        """Return on investment percentage"""
        pnl = self.unrealized_pnl(current_price)
        return (pnl / self.margin) * 100


class PositionSizer:
    """Calculate position sizes based on risk parameters"""

    def __init__(self, account_balance: Decimal):
        self.balance = account_balance
        self.max_risk_per_trade = Decimal('0.02')  # 2% of account
        self.max_leverage = 10

    def calculate_size(
        self,
        entry_price: Decimal,
        stop_loss_price: Decimal,
        leverage: int
    ) -> dict:
        """Calculate position size for given risk parameters"""
        # Limit leverage
        leverage = min(leverage, self.max_leverage)

        # Risk amount
        risk_amount = self.balance * self.max_risk_per_trade

        # Price distance to stop
        price_distance = abs(entry_price - stop_loss_price)
        price_distance_pct = price_distance / entry_price

        # Position size based on risk
        # size × price_distance = risk_amount
        size = risk_amount / price_distance

        # Check margin requirements
        required_margin = (size * entry_price) / leverage

        if required_margin > self.balance:
            # Reduce size to fit available margin
            size = (self.balance * leverage) / entry_price

        return {
            'size': size,
            'leverage': leverage,
            'margin_required': (size * entry_price) / leverage,
            'risk_amount': size * price_distance,
            'risk_percent': (size * price_distance / self.balance) * 100
        }

Read the full file on GitHub · 667 lines

Files

What ships with it

3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 12d ago First seen · 667 lines · 31 tokens per session scan A a621383881a4

Subscribe to this mod's changes

defi-trading-systems is a skill published in the GitHub repository organvm-iv-taxis/a-i--skills (17 stars, last pushed 16d ago), licensed Apache-2.0. It adds 31 tokens to every session and 4,634 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

crypto-accounting

When the user wants to account for digital assets (Cryptocurrency, NFTs) in financial statements. Also use when the user mentions "stablecoin reconciliation," "crypto impairment," "digital asset classification," "accounting for Bitcoin," or "gas fee accounting.".

GAJETOso/financeskills · 55 tokens

gmgn-swap

BEFORE RUNNING ANY COMMAND: Run gmgn-cli config --check. If exit code is 0, proceed normally. If exit code is 1, (1) run gmgn-cli config and show the output to the user; (2) once the user sends the API Key, run gmgn-cli config --apply to complete configuration and verification, then show the output to the user. If…

aiskillstore/marketplace · 404 tokens

gmgn-token

Research any crypto or meme token by address — real-time price, market cap, liquidity, holder list, trader list, top Smart Money and KOL positions, security audit (honeypot, rug pull risk, dev wallet, renounced status), social links (Twitter/X, website) via GMGN API on Solana, BSC, Base, or Ethereum. Use when user…

aiskillstore/marketplace · 105 tokens

gmgn-token-buy

Turn a token name into a vetted, sized buy order. Two things here are exclusive to this skill: resolving a NAME or symbol to the one right contract among its copycats, and sizing an order — amount, slippage, gas, position. No sibling does either. USE THIS SKILL WHEN a buy is being prepared, which shows up as a NAME or…

aiskillstore/marketplace · 706 tokens

ccxt

CCXT cryptocurrency trading library. Use for cryptocurrency exchange APIs, trading, market data, order management, and crypto trading automation across 150+ exchanges. Supports JavaScript/Python/PHP.

aiskillstore/marketplace · 41 tokens

cryptofeed

Cryptofeed - Real-time cryptocurrency market data feeds from 40+ exchanges. WebSocket streaming, normalized data, order books, trades, tickers. Python library for algorithmic trading and market data analysis.

aiskillstore/marketplace · 46 tokens