Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIDeepSeekDeepSeekMuseMuse+22 more

    perp funding basis analyzer

    1

    Attribute linear spot/perp basis P&L, reconcile funding cash flows, and identify residual hedge risks.

    $15

    Secure checkout via Stripe

    Money-back guarantee

    Converts to your local currency at checkout

    Security scanned
    perp funding basis analyzer

    perp funding basis analyzer

    Example session with this skill installed

    Analyze this basis trade data for BTC-USDT. Spot: 1.2 BTC @ 60000. Perp: -1.2 BTC @ 60100. Funding received: 45.00 USDT. Fees: 12.00 USDT. Spot mark is now 60500, Perp mark is 60550.

    • Read your context and instructions
    • Compiled the perp funding basis

    I have processed the BTC-USDT basis trade data. The analysis reconciles the mark P&L against the realized cash flows to determine the net basis performance.

    Basis Attribution Report

    ComponentValue (USDT)Type
    Spot Mark P&L+600.00Unrealized
    Perp Mark P&L-540.00Unrealized
    Gross Mark P&L+60.00Basis Convergence
    Funding Cash Flow+45.00Realized
    Trading Fees-12.00Realized
    Net Realized Cash+33.00Carry Income
    Total Attribution+93.00Net Result

    Position Residuals

    • Normalized Quantity: 1.20000000 BTC
    • Hedge Ratio: 1.00 (Perfectly Hedged)
    • Residual Delta: 0.00000000 BTC

    Basis Scenario Analysis

    If the Perpetual Mark Price moves to 60,700 USDT (+150) while Spot remains at 60,500 USDT:

    • Scenario P&L Change: -180.00 USDT
    • Adjusted Total Attribution: -87.00 USDT

    Next steps

    1. Review the trading_fees breakdown to see if the -12.00 USDT matches your venue's VIP tier.
    2. Verify if the +45.00 USDT funding payment includes or excludes interest on the spot margin loan.
    3. Update the report.json with the current borrowing rate for a more accurate net carry calculation.

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

    About this skill

    The problem

    Attributing P&L in basis trades is difficult due to the mixing of spot price movement, perpetual mark prices, and realized funding cash flows. Manual reconciliation often fails to distinguish between unrealized mark P&L and actual cash-in-hand funding payments.

    What it does

    • Normalizes linear spot and perpetual quantities into unified underlying units and quote currencies.
    • Separates mark P&L from realized account P&L, including signed funding cash flows and borrowing costs.
    • Calculates residual hedge quantities to identify delta leakage in delta-neutral positions.
    • Runs basis-only scenarios to model P&L sensitivity to perpetual price shocks relative to fixed spot.
    • Identifies missing records and unresolved discrepancies between helper calculations and statement data.

    Why this beats prompting it yourself

    General-purpose LLMs struggle with the precise arithmetic required for signed funding flows and often hallucinate annualized yields from small samples. This skill enforces a strict normalization workflow and prevents the common mistake of treating quoted rates as realized cash.

    Use cases

    • Reconciling monthly funding payments against spot/perp basis trade performance.
    • Auditing delta-neutral portfolios for residual exposure after quantity adjustments.
    • Stress testing basis positions against perpetual mark price deviations.
    • Identifying specific fee or borrowing cost drains on a carry trade.

    Known limitations

    Supports linear contracts only. Inverse and quanto contracts are rejected. No live market feeds or automated execution.

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

    Only supports linear contracts; inverse and quanto products are not supported. Requires pre-normalized input data. No live exchange connectivity or order execution.

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

    Software
    Python

    Permissions

    Terminal / Shell
    Listed1 month ago

    What's inside

    Frequently Asked Questions

    It applies deterministic arithmetic to supplied linear spot and perpetual quantities, mark prices, funding, fee, and borrowing cash flows. It reports mark P&L, cash-flow totals, basis changes, residual underlying quantity, and supplied basis scenarios. It does not calculate delta leakage or theoretical yield.

    The skill supports linear spot and perpetual contracts; however, it is currently incompatible with inverse, quanto, or non-linear derivative structures.

    No. It runs locally on normalized JSON input and does not connect to exchanges, fetch live rates, reconcile statements automatically, or execute trades. CSV or API data must be mapped to the documented input contract externally.

    The package includes the skill instructions, standalone Python helper, normalized JSON input contract, runtime guide, synthetic valid and adverse fixtures, generated example report, source notes, smoke-test script, and logo. It does not include exchange connectors, live market data, or prebuilt venue-specific normalization adapters.

    The helper requires Python 3.10+ and normalized JSON. Any agent or platform may prepare the input if it can provide the documented fields, but no direct integration with OpenAI, Claude, exchanges, or trading frameworks is bundled.

    The helper performs deterministic calculations from supplied quantities, prices, and signed cash flows. It does not infer funding rates, annualize returns, verify that supplied cash flows are accurate, or prevent incorrect source data from being entered.

    New in Trading & Investing