Works with the AI tools you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIGitHub CopilotGitHub CopilotGemini CLIGemini CLI+20 more

    cross margin stress tester

    1

    Calculate scenario headroom and liquidation risks for cross-margin portfolios using linear fixed-maintenance models.

    $15

    Secure checkout via Stripe

    30-day refund guarantee

    Converts to your local currency at checkout

    0 installsSecurity scanned
    cross margin stress tester

    cross margin stress tester

    Example session with this skill installed

    Analyze this cross-margin state: Equity 50,000 USDC. Long 2 BTC at 60,000, Long 20 ETH at 3,000. Maintenance rate 5%. Run a -10% shock on BTC and -15% on ETH.

    • Read your context and instructions
    • Compiled the cross margin stress
    • Generated the document

    I have processed the cross-margin stress test based on your supplied position marks and equity. The calculation applies a linear fixed-maintenance model to determine incremental headroom changes.

    Liquidation Stress Test Report

    MetricBaseline (Current)Stressed ScenarioDelta
    BTC Price60,000.0054,000.00-6,000.00 (-10%)
    ETH Price3,000.002,550.00-450.00 (-15%)
    Total Notional180,000.00159,000.00-21,000.00
    Maintenance Req (5%)9,000.007,950.00-1,050.00
    Account Equity50,000.0029,000.00-21,000.00
    Margin Headroom41,000.0021,050.00-19,950.00
    Margin Usage18.00%27.41%+9.41%

    Model Mismatch Register

    Tier Check: Current notional ($180k) is assumed to be within the base maintenance tier for the venue. If $150k+ triggers a tier increase, results will be understated.

    • Collateral: Assumes USDC equity is valued at 1.00 haircut.
    • Contract Type: Linear fixed-rate approximation.

    Interpretation: The account remains solvent under the -10%/-15% joint shock. Total headroom decreases by $19,950. The primary risk factor is the BTC position, contributing $12,000 to the equity drawdown.

    Next steps

    1. Verify if the $180,000 total notional sits near a maintenance tier boundary for your specific exchange.
    2. Re-run the analysis with a -25% shock to identify the absolute breach price for the ETH leg.
    3. Confirm equity components (e.g., non-stablecoin collateral) haven't been subjected to undisclosed haircuts by the venue.

    cross-margin-stress-tester.pdf

    PDF · document

    Generated

    Example file from a real run - the skill writes it into your workspace.

    Connects securely to your tools. The creator never sees your data.

    What you get

    Calculate margin headroom under multi-asset price shock scenarios.Identify breach points for fixed-maintenance margin models.Audit account solvency against signed collateral and funding changes.Model the impact of additional collateral on liquidation proximity.

    About this skill

    The problem

    Manual liquidation calculations for cross-margin accounts are prone to error during volatile market shifts. Relying on simple spreadsheets often fails to account for how incremental price shocks across multiple positions simultaneously impact total account headroom.

    What it does

    • Calculates scenario headroom using a linear fixed-maintenance cross-margin model.
    • Processes signed collateral changes and individual price shocks per position.
    • Identifies model mismatches where fixed-rate assumptions may break due to tier changes.
    • Generates scenario grids comparing current equity against stressed maintenance requirements.
    • Flags breach points where headroom becomes non-positive under specific shock parameters.

    Why this beats prompting it yourself

    General-purpose LLMs struggle with the precise arithmetic of cross-margin accounting and often hallucinate liquidation mechanics. This skill enforces a strict workflow that reconciles unshocked maintenance with venue data before projecting results, ensuring calculations follow a validated fixed-rate linear approximation rather than best-guess logic.

    Use cases

    • Stress testing a portfolio against specific percentage drops in underlying assets.
    • Planning collateral additions to prevent liquidation during anticipated volatility.
    • Auditing cross-margin headroom after opening new directional positions.

    Known limitations

    Does not support tier transitions, portfolio-margin offsets, inverse contracts, or cross-currency collateral haircuts. It provides headroom analysis, not guaranteed exchange liquidation prices.

    How to install

    Works the same in every agent - Claude, Cursor, Codex, Copilot and 20+ more.

    ~30 seconds
    1. 1

      Download the ZIP

      Free skills download straight away. Paid skills unlock right after purchase.

    2. 2

      Unzip into your skills folder

      Every agent reads skills from one folder on your machine. Drop the unzipped folder in there.

    3. 3

      Ask your agent to use it

      Restart the agent if it was already running. It picks the skill up automatically - no config needed.

    Skills folder by agent

    Click the path to copy it. Create the folder if it does not exist yet.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill passes our trust checks below.

    Security scanned

    Passed our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    30-day refund

    Not a fit? Get your money back

    Trust & safety

    Security scanned

    Verified clean 13 days ago

    • Passed all security checks, Safe to install

    Listed13 days ago

    What's inside

    Frequently Asked Questions