What is Mark Price & Index Price
Perps implementations vary a lot from centralized exchanges to dexes, but in general, they have two important fundamental elements in common: Mark Price and Index Price.
Mark price represents a perp's value at any given time. It is based on the trading price of the perp. It is also used to calculate profit and loss and trigger liquidations.
Index price represents the underlier's value, usually calculated from a basket of trading prices on external exchanges.
Ideally, the perp should be worth about the same as its underlying asset. The mark price should be equal to the index price. In traditional finance, as the expiration date approaches, the value of futures contracts gradually converges to the spot price. However, perpetual contracts are different because they do not have an expiration date. Additionally, due to the supply and demand dynamics of futures contracts themselves, the mark price of a perpetual contract can deviate significantly from the index price of its underlying asset.
Hence, we need a mechanism to pull the mark price back and keep its value near the index price. This mechanism is known as the funding rate.
What else do you want to learn?