Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIMuseMuseDotsDots+21 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

    Money-back guarantee

    Converts to your local currency at checkout

    Security 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

    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.

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

    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.

    Supports fixed-rate linear models only. No support for tier transitions, portfolio-margin offsets, inverse contracts, or live execution. Requires manual data mapping from exchange exports.

    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 any payment.

    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 1 month ago

    Requires

    Python

    Permissions

    Terminal / Shell
    Listed1 month ago

    What's inside

    Frequently Asked Questions

    It calculates scenario equity, maintenance, and headroom for a supplied linear fixed-maintenance model. A nonpositive headroom flags a breach of that declared model; it does not calculate a venue’s actual liquidation risk.

    No, the skill currently uses a fixed-rate linear approximation and does not account for dynamic tier transitions, portfolio-margin offsets, or collateral haircuts.

    The helper runs with Python 3.10+ and normalized JSON. Any agent that can prepare the documented contract may use it; no AutoGPT, BabyAGI, LangChain, broker, or exchange integration is bundled.

    The package includes the skill instructions, local Python stress helper, normalized JSON contract, synthetic valid and adverse fixtures, example report, runtime notes, smoke-test script, source notes, and logo.

    It can evaluate supplied collateral changes under supplied price shocks and report resulting headroom. It does not solve for the collateral amount required or guarantee survival under a real exchange’s margin rules.

    While the skill identifies potential liquidation risks based on fixed-maintenance models, it is a risk management tool and does not provide or guarantee the exact execution prices used by specific exchanges.

    New in Trading & Investing