---
name: undertow-crypto-scenarios
description: Calculate perpetual funding costs or stress a portfolio of linear crypto exposures using explicit user assumptions. Use for funding drag, fee break-even, scenario P&L and exposure concentration; excludes forecasts, options and exchange liquidation prices.
---

# Undertow crypto scenarios

Prefer the local calculators in the downloaded crypto kit for private
portfolio inputs. Run `python3 crypto_scenarios.py funding --input scenario.json`
or `python3 crypto_scenarios.py portfolio --input scenario.json`. These commands
read a bounded JSON file and print JSON; they do not contact a service.
The browser at https://liquilens-undertow.com/crypto/ also calculates locally.

Alternatively, the public MCP `https://api.seiche.info/undertow/mcp` exposes
`crypto_funding_cost` and `crypto_portfolio_stress`. Inputs sent through MCP
are sent to Undertow. The calculations require no account or wallet access.

For funding, establish notional in USD, long/short side, funding **basis
points per settlement**, number of settlements and total round-trip fee bps.
One bp is 0.01%; 0.01% therefore means 1 bp. Do not silently infer an
eight-hour settlement interval or a venue fee. Positive rates make longs pay
and shorts receive; returned cashflows are positive when received. Constant
rate/notional and linear break-even are assumptions, not predicted returns.

For a portfolio, establish current total equity and up to twenty positions:
`asset`, `side`, `notional_usd`, `price_change_pct`, optional `venue` and
optional nonnegative `cost_usd`. Equity already includes current holdings;
do not add their value again. Position size means gross exposure, not margin.
The same asset can appear on both sides; preserve gross concentration even
when signed exposure offsets. Unspecified venues remain unspecified.

If key inputs are absent, ask for them or label an illustrative scenario
explicitly. Do not convert a hypothetical shock into a probability, price
target or liquidation price. These calculations omit venue margin rules,
inverse contracts, options, borrowing, correlation and collateral FX changes.
Arbitrary asset labels permit arithmetic, not live coverage claims.

Explain assumptions beside the resulting funding cashflow, fees, P&L,
remaining equity and concentration. Return the source input with an export
so the user can reproduce the calculation. Do not request wallet secrets,
place orders or install a scheduler as part of this skill.
