Perma a mutlicollateral perpetual dex, bringing perpetual leveraged trading to fraxtal (to gain from low trading gas fees for users) and trade perps directly with frax
Product Road Map
- Architecture and Technical Specifications (github latex maths probably)
- Start work on smart contracts (Fuzz test and invariants instead of unit to save time)
- Start iterating app design
- Launch testnet
- Audits and security
- Mainnet launch
- offchain trading engine in rust/python(EIP 712 Order matching)
- Test coverage (-%)
Perma is coming as the go-to perp trading app for DeFi newbies. Think of it as trading on a CEX, but you’re actually in the DeFi world. It’s about making everything seamless as possible , simple and technical at the same time. You only need to input the size of the position you want in the smart contracts and choose your leverage (the higher the leverage the closer to been liquidated)
Mark Price is calculated as the sum of the Index Price and a 30-period Moving Average (MA30). The MA30 is computed based on the difference between the mid-price of the current order book and the Index Price. Specifically:
Mark Price = Index Price + MA30 MA30 = 30-period Moving Average of [(Bid1 + Ask1) / 2 - Index Price]
Where Bid1 is the highest buy order price And Ask1 is the lowest sell order price
The Mark Price is recalculated each time there's a change in either the highest bid (Bid1) or the lowest ask (Ask1) price in the order book. This ensures that the Mark Price remains responsive to real-time market conditions while also accounting for short-term price trends through the moving average component.
Then:
Mid-price calculation:
Simplifying:
-
$F$ = Funding Rate -
$P$ = Premium Index -
$I$ = Interest Rate -
$\text{max}_F$ = Maximum value (around 1%) -
$\text{min}_F$ = Minimum value (around -1%)
Here, the Clamp
function can be expressed as:
Breaking this down:
- Inner Clamp:
- Adding to P:
- Outer Clamp:
Where:
- PerpRouter : - Contract for managing perp markets, handles trade matching, trading approval, etc
- PerpMarket :- Tracking the balances of the users acount and positions
- FundingRate.sol :- Contract for Managing funding rates across markets