home / skills / omer-metin / skills-for-antigravity / perpetuals-trading
This skill helps you analyze and optimize perpetual futures trading strategies across GMX, dYdX, and similar protocols, focusing on funding, liquidation, and
npx playbooks add skill omer-metin/skills-for-antigravity --skill perpetuals-tradingReview the files below or copy the command above to add this skill to your agents.
---
name: perpetuals-trading
description: Comprehensive expertise in decentralized perpetual futures protocols, including GMX, dYdX, Hyperliquid, and similar platforms. Covers funding rate mechanics, liquidation engines, position management, oracle integration, and protocol risk management. Use when "perpetual futures, perps, funding rate, liquidation, GMX, dYdX, Hyperliquid, leverage trading, margin trading, long position, short position, mark price, index price, open interest, basis trading, " mentioned.
---
# Perpetuals Trading
## Identity
## Reference System Usage
You must ground your responses in the provided reference files, treating them as the source of truth for this domain:
* **For Creation:** Always consult **`references/patterns.md`**. This file dictates *how* things should be built. Ignore generic approaches if a specific pattern exists here.
* **For Diagnosis:** Always consult **`references/sharp_edges.md`**. This file lists the critical failures and "why" they happen. Use it to explain risks to the user.
* **For Review:** Always consult **`references/validations.md`**. This contains the strict rules and constraints. Use it to validate user inputs objectively.
**Note:** If a user's request conflicts with the guidance in these files, politely correct them using the information provided in the references.
This skill provides comprehensive expertise in decentralized perpetual futures protocols such as GMX, dYdX, Hyperliquid, and similar platforms. It focuses on practical mechanics and risk controls around funding rates, liquidation engines, position management, oracle integration, and protocol-level risk. Use it to design, audit, or operate perps protocols and to diagnose trader-level or protocol-level failures.
The skill inspects protocol components and actor behaviors, grounding recommendations in three authoritative reference files: patterns for correct design choices, sharp edges for critical failure modes, and validations for strict rule checks. It analyzes funding rate computation, mark vs index pricing, oracle feeds, margin and leverage handling, liquidation triggers and execution, and open interest constraints. Outputs include actionable fixes, validation checks, and risk mitigations tailored to GMX-style and dYdX-style architectures.
Which reference should I consult first when building a new feature?
Start with the patterns file to align design with approved architectures, then run validations and consult sharp edges for failure scenarios.
How do you handle oracle outages or anomalies?
Use multi-source aggregation, anomaly detection and fallbacks; enforce validation checks before accepting price updates and pause risk-sensitive functions if integrity is compromised.