
PERPS
18 posts

PERPS
@perpsuniv4
one token to swap, leverage, burn ◯ v4 hook · trustless perps · LP at 0xdEaD audit-clean. holder-aligned. immutable.
Katılım Ağustos 2012
60 Takip Edilen63 Takipçiler



perps. — Trading Rules
On-chain constraints from Perps3-remix.sol v0.2.2 Contract: 0x041258A73dF56ada0F92E0446D42b8A4AB166Ec4
Position lifecycle limits
RuleValueWhyMin collateral (after fee)0.01 ETHPrevents dust position spam attacks (L-01 audit fix)Max leverage10×Hard cap in contractMin hold time50 blocks (~10 min)Prevents TWAP arbitrage (M-03 audit fix)Same-block open+closeBlockedPrevents flash loan exit attacksPosition size cap20% of pool depthPer-trade size limitSide OI cap40% of pool depthPer-side total OI limitUser OI cap15% of pool depthPer-wallet total OI limit
Why your 0.01 ETH might fail
The contract checks msg.value − openFee ≥ 0.01 ETH. The open fee is 0.5% × notional.
For 2.5× leverage: minimum effective collateral = 0.01013 ETHFor 10× leverage: minimum effective collateral = 0.01053 ETH
Just send ≥ 0.011 ETH and you're safe at any leverage.
Fees
Open fee: 0.5% of notional (taken from msg.value)
Close fee: 0.5% of exit notional (taken from PnL if positive, capped at gross profit)
Liquidation fee: 1% to protocol (rest to liquidator)
All fees split: 60% → POL · 20% → buyback · 10% → treasury · 10% → insurance
Oracle / TWAP
MARK_TWAP_SECONDS = 900s (15 min) — used as oracle for entry/exit/liquidation price
MAX_STALENESS_SECONDS = 60s — if last observation > 60s old, must syncObservation() first
The frontend auto-syncs when needed — you don't need to do this manually
Liquidation
Triggered when collateral + PnL − funding < maintenance margin
Maintenance margin = ~5% of notional
Max 3 liquidations per block to prevent cascade (M-04 audit fix)
Liquidator gets remaining collateral minus 1% protocol cut
Death Switch
If no swaps for 24 hours, anyone can call triggerDeathSwitch()
Burns 100% of buyback bucket immediately as final defense
Positions can still close after death switch (your collateral is safe)
English

🛠️ perps. v1.1 hotfix live.
Fixed: price loads without wallet · 0.01 ETH error explained · close errors decoded · 19 contract errors translated · auto TWAP sync.
1/5 🛠️ perps. frontend v1.1 hotfix is live.
Fixed a batch of post-launch issues you all hit ⤵️
2/5 💀 Main bugs:
Price didn't show without wallet
0.01 ETH collateral silently failed
Close threw "unknown custom error"
Oracle errors didn't auto-recover
3/5 🔧 Root causes:
Wrong contract for V4 state reads (need StateView, not PoolManager)
Only 5/19 errors in ABI
Reading wrong ethers field (shortMessage instead of e.revert.name)
0.01 ETH gets eaten by 0.5% open fee
4/5 ✅ Now:
Price shows without wallet connect
Min collateral displayed live as you move leverage slider
All 19 errors translated to plain English/中文
Auto-syncs TWAP on stale oracle
Unknown selectors surface for fast reporting
5/5 📜 Trading rules (audit-fix design):
Min collateral ≥ 0.011 ETH
Max 10× leverage
Hold ≥ 50 blocks (~10 min) before close
Single position ≤ 20% pool depth
English






