- Home
- Skills
- Trading & Investing
- perp funding basis analyzer
Works with the AI Agents you already use
perp funding basis analyzer
Attribute linear spot/perp basis P&L, reconcile funding cash flows, and identify residual hedge risks.
$15
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
| Component | Value (USDT) | Type |
|---|---|---|
| Spot Mark P&L | +600.00 | Unrealized |
| Perp Mark P&L | -540.00 | Unrealized |
| Gross Mark P&L | +60.00 | Basis Convergence |
| Funding Cash Flow | +45.00 | Realized |
| Trading Fees | -12.00 | Realized |
| Net Realized Cash | +33.00 | Carry Income |
| Total Attribution | +93.00 | Net 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
- Review the
trading_feesbreakdown to see if the -12.00 USDT matches your venue's VIP tier. - Verify if the +45.00 USDT funding payment includes or excludes interest on the spot margin loan.
- Update the
report.jsonwith 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.
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
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
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 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