defi-trading-systems
Designs DeFi trading systems for perpetual futures, liquidity provision, and automated strategies with risk management and MEV protection.
Skill by 4444J99
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/4444j99-defi-trading-systems
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: finance
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/defi-trading-systems
What's inside
- Skill name
defi-trading-systems- Description
- Designs DeFi trading systems for perpetual futures, liquidity provision, and automated strategies with risk management and MEV protection.
- License
- MIT
- Instructions
- 659 lines in SKILL.md · view on GitHub
Before installing
- Instructions call the network
Agent Skills spec issues
- body: 659 lines (spec recommends under 500)
Files (4)
- SKILL.md
- amm-formulas.md · references/
- mev-protection.md · references/
- perpetual-mechanics.md · references/
SKILL.md (first lines)
# 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
```python
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) / leverageFrom 4444J99/a-i--skills, MIT.
More from 4444J99/a-i--skills
- 0.646score
d2l-discussion-responder
4444J99
Review D2L/Brightspace discussion threads as an instructor, identify unanswered questions, verify course facts, and draft concise replies in the instructor's…
SkillAFreshness: A★ 17Claude Code +9 - 0.646score
domain-ideal-whole-substrate
4444J99
Foundational layer beneath PDE.
SkillAFreshness: A★ 17Claude Code +9 - 0.646score
artifact-resurfacing
4444J99
Four-phase protocol for clearing accumulated drift between memory claims, CLAUDE.md citations, and on-disk reality.
SkillAFreshness: A★ 17Claude Code +9 - 0.641score
conversation-content-pipeline
4444J99
Transform AI conversations and chat transcripts into publishable content including blog posts, documentation, tutorials, and knowledge base entries.
SkillAFreshness: A★ 17Claude Code +9 - 0.641score
document-audit-extraction
4444J99
Audit document collections to extract features, identify patterns, assess quality, and build structured inventories.
SkillAFreshness: A★ 17Claude Code +9 - 0.637score
closeout
4444J99
Session-end ritual that walks back through plans authored and atoms touched in this session, assigning each a closure status (DONE-NNN, IRF-XXX-NNN, or…
SkillAFreshness: A★ 17Claude Code +9 - 0.601score
code-review-checklist
4444J99
Guide an AI agent through a structured code review — correctness, security, performance, readability, and test coverage — producing a summary with actionable…
SkillBFreshness: B★ 17Claude Code +9 - 0.556score
ecosystem-autopsy
4444J99
Orchestrate a full directory-graph autopsy across an ORGANVM workspace, then emit migration signals that unite repositories under canonical governance.
SkillCFreshness: C★ 17Claude Code +9 - 0.551score
expansive-inquiry
4444J99
Multi-perspective collaborative inquiry.
SkillCFreshness: C★ 17Claude Code +9 - 0.551score
corpus-persona-extraction
4444J99
Ingest a corpus of session logs (JSONL transcripts, chat exports) and extract a persona profile — vocabulary frequency, unique idioms and coinages, structural…
SkillCFreshness: C★ 17Claude Code +9 - 0.550score
continuous-learning-agent
4444J99
Self-improvement patterns for AI agents to learn from feedback, errors, and successful patterns across sessions
SkillCFreshness: C★ 17Claude Code +9 - 0.491score
evaluation-to-growth
4444J99
Systematic content evaluation framework progressing through Critique → Reinforcement → Risk Analysis → Growth.
SkillDFreshness: D★ 17Claude Code +9
Signals
- Stars
- 17
- Forks
- 9
- Open issues
- 6
- Last commit (this folder)
- Apr 18, 2026 (6 months ago)
- Last release
- Feb 6, 2026 (8 months ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- Repository
- github.com/4444J99/a-i--skills
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from 4444J99
- 0.646score
domain-ideal-whole-substrate
4444J99
Foundational layer beneath PDE.
SkillAFreshness: A★ 17Claude Code +9 - 0.646score
d2l-discussion-responder
4444J99
Review D2L/Brightspace discussion threads as an instructor, identify unanswered questions, verify course facts, and draft concise replies in the instructor's…
SkillAFreshness: A★ 17Claude Code +9 - 0.646score
artifact-resurfacing
4444J99
Four-phase protocol for clearing accumulated drift between memory claims, CLAUDE.md citations, and on-disk reality.
SkillAFreshness: A★ 17Claude Code +9 - 0.641score
document-audit-extraction
4444J99
Audit document collections to extract features, identify patterns, assess quality, and build structured inventories.
SkillAFreshness: A★ 17Claude Code +9 - 0.641score
conversation-content-pipeline
4444J99
Transform AI conversations and chat transcripts into publishable content including blog posts, documentation, tutorials, and knowledge base entries.
SkillAFreshness: A★ 17Claude Code +9 - 0.637score
closeout
4444J99
Session-end ritual that walks back through plans authored and atoms touched in this session, assigning each a closure status (DONE-NNN, IRF-XXX-NNN, or…
SkillAFreshness: A★ 17Claude Code +9
Cite this page
defi-trading-systems skill. Agent Mart. https://agentmart.dev/skills/4444j99-defi-trading-systems (last updated 2026-10-24)