Zenith
  • 💡Introduction
  • 📈Perpetual Futures
    • Virtual AMM (VMM)
    • Funding Payment
    • Liquidation
    • Insurance Fund
    • Examples
    • Smart Contracts
    • Formula
  • 📊Architectures
  • 🔎Trader's Guide
    • Trading on Zenith
    • Connecting to Zenith
    • Opening Position
    • Closing Position
    • Increasing Position
    • Decreasing Position
    • Adding Margin
    • Reducing Margin
  • 💰Tokenomics
    • PPR Token
    • Distribution
    • Staking
  • ❓FAQ
Powered by GitBook
On this page
  • Funding
  • Price Impact ,Long , Short
  • Open long
  • Close Long
  • Open Short
  • Close Short
  • Expected Close Price
  • Update VMM
  • Open Long
  • Closing Long
  • Open Short
  • Close Short

Was this helpful?

  1. Perpetual Futures

Formula

Funding

  1. fundingRate = (markPrice-IndexPrice)/24

    +ve → Long will pay -ve → Short will pay

  2. averageValue = (markPrice+IndexPrice)/2

  3. percentage = (fundingRate / avgValue) * 10

  4. distributing funding perPositionRate = fundingPayment/totalPosition*100 positionSize * perPositionRate

Price Impact ,Long , Short

Open long

old per usd = Vmm usd / Vmm xtz

x=(k / vmm usd + position size)- vmm xtz

new per usd = position size / x

price impact =((new per usd - old per usd ) * 100) / (old per usd ))

Close Long

old per xtz= vmm xtz / vmm usd

x= vmm usd - (k/ Vmm xtz + Closing Position (In XTZ))

new per xtz= closing position xtz / x

price impact =((new per xtz - old per xtz) * 100) / (old per xtz))

Open Short

old per xtz= vmm xtz/ vmm usd

x=(k / (vmm usd - position in usd))-vmm xtz

new per xtz= x / position

price impact = (new per xtz - old per xtz)*100/ old per xtz

Close Short

old per usd = vmm usd / vmm xtz

x=(k/ (vmm xtz - Closing position in xtz ))-vmm usd

new per usd = x / xtz(closing position)

price impact = (new per usd - old per usd)*100/ old per usd

Expected Close Price

Expected close price = market price - ( Price Impact / 100 )

Update VMM

k = constant (x * y = k ) x = usd , y = xtz

Open Long

vmm usd = vmm usd+ Position * Leverage

vmm xtz = VMM Xtz - x ( Refer above section to calculate x)

Closing Long

vmm usd= vmm usd - x

vmm xtz = vmm xtz + closing position

Open Short

vmm usd = vmm USD - position * Leverage

vmm xtz = Vmm xtz + x

Close Short

vmm xtz = vmm xtz - Closing Position

vmm usd = vmm usd + x

PreviousSmart ContractsNextArchitectures

Last updated 2 years ago

Was this helpful?

📈