Works with the AI Agents you already use

    Perp Protocol Design Review

    by BanditXBT

    1

    Solvency-focused review of perp/margin protocols: margin, funding, liquidation, insurance fund, ADL.

    $4.20

    Secure checkout via Stripe

    Money-back guarantee

    Converts to your local currency at checkout

    Security scanned

    About this skill

    A perp venue is a solvency machine: every unit of unrealized profit is someone's loss or the pool's liability. Review whether that books always balance under stress.

    • Orderbook / matching engine (on- or off-chain): counterparties are traders; protocol bears only bad debt.
    • Oracle-priced pool (LP/vault is counterparty): LPs are short trader PnL; price manipulation and skew become LP losses.
    • vAMM / virtual curve: price impact from curve; funding anchors mark to index. State who is the counterparty to each trade and who absorbs shortfall.
    1. Conservation: total collateral + insurance ≈ Σ(user equity) + protocol liabilities; zero-sum PnL across longs/shorts net of fees.
    2. No free money: open then immediately close at the same price returns ≤ initial collateral minus fees.
    3. Margin: equity ≥ initial margin to open or increase; equity < maintenance margin ⇒ liquidatable; liquidation must move account to a safer state.
    4. OI & risk caps: per-market OI, per-account size, skew/imbalance limits are enforced on every path (including partial close, collateral withdrawal, and order execution by keepers).
    5. Funding: payments net to ~zero between longs and shorts (or are accounted for if pool is counterparty); accrual is time-weighted and cannot be skipped or double-counted.
    • Mark vs. index vs. last price: liquidation and PnL should use a manipulation-resistant mark (index with premium/TWAP clamp), not last trade. Check price-source switching and fallback behavior.
    • Funding rate: formula (premium/skew-based), clamp, interval, sign convention, max rate; behavior at extreme skew; precision and rounding; funding applied before margin checks.
    • Margin model: isolated vs. cross; per-asset haircuts on collateral; collateral that correlates with the position (wrong-way risk: ETH collateral long ETH); unrealized-PnL counted as collateral?
    • Liquidation: trigger, close factor (partial vs. full), penalty/fee split (liquidator vs. insurance), minimum position size so liquidations remain profitable under gas, keeper incentive vs. gas on each chain, behavior when liquidation is unprofitable (bad debt accrues). Self-liquidation to capture the fee; liquidation of positions at the same oracle tick used to open.
    • Insurance fund & socialization: order of loss absorption (liquidation penalty → insurance → LP/vault → ADL or socialized loss). ADL rules should be deterministic and ranked by profit×leverage. Attack: drain insurance fund via coordinated bad-debt creation.
    • Order lifecycle: keeper-executed orders (two-step request/execute) with price-at-execution vs. price-at-request; stale-order replay; cancellation griefing; front-running of oracle updates (latency arbitrage against pull oracles such as Pyth: attacker picks which signed price to submit within the allowed window).
    • Fees & rebates: exploitable with wash trading, self-referral, negative-fee maker rebates.
    • Admin/risk params: who can change leverage, caps, oracle, fee? Timelock? Can an update instantly make healthy accounts liquidatable?
    • Chain specifics: sequencer downtime (grace period before liquidations resume), block time/latency vs. funding interval, gas auction dynamics on congested chains.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before buying a skill.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Money-back guarantee

    Doesn't do what its page promises? You get your money back.

    Trust & safety

    Security scan

    Security scan passed 13 days ago

    Requires

    Nothing to install.

    Permissions

    No special permissions declared or detected

    Listed13 days ago

    What's inside

    Frequently Asked Questions

    Solvency-focused review of perp/margin protocols: margin, funding, liquidation, insurance fund, ADL.

    This skill uses the open SKILL.md standard. Use it through an MCP-compatible agent connected to Agensi, and check the compatibility information on this page for confirmed agents and required capabilities.

    Connect your AI agent to Agensi through MCP, then ask it to use perp-protocol-design-review on your task. Your agent loads the latest approved version each time. Paid skills require a purchase or active subscription. Skill files are not available for download; your licence does not allow you to save, copy or export any part of a skill.

    New in Security

    Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Security.