Welcome to your static Space!

You can modify this app directly by editing index.html in the Files and versions tab.

Also don't forget to check the Spaces documentation.

Polymarket Perps Calculator — Ahmed Trading

Polymarket Perps Calculator

Reference calculators for Polymarket Perps risk math. Formulas below are simplified educational versions — always verify against official docs.

1. Funding rate (8h)

F_8h = clamp(premium + clamp(interest − premium, −k, +k))

2. Initial & maintenance margin

IM = notional × IMR; MM = notional × MMR; liq when equity ≤ MM.

3. Withdrawal floor

Withdrawable = max(0, equity − MM − open-loss buffer). Keep a floor: bots should never withdraw below MM + kσ of expected 8h adverse move.

4. Liquidation price (isolated, long)

Long: P_liq ≈ entry × (1 − 1/lev + MMR). Short flips the sign of the 1/lev term.

} } } }