Menu

Post image 1
Post image 2
1 / 2
0

Perpetual Engine Series Part 3: Funding Rates

DEV Community·Sumana·about 1 month ago
#AzWYP16C
Reading 0:00
15s threshold

In Part 2 , we built the "heartbeat" of our engine: PnL Calculation . We ensured that every price tick accurately updates a trader’s equity with decimal precision. But a market cannot survive on price action alone. Without an anchor, the price of a perpetual contract would drift aimlessly away from the actual value of the underlying asset. That anchor is Funding Rates . It is the regulatory mechanism that ensures the perpetual market remains fair, balanced, and tethered to reality. Here is how I implemented this "incentive engine" in Rust. 1. What are Funding Rates? (The Market’s Anchor) In perpetual futures, there is no expiration date. To prevent the contract price from deviating too far from the Spot Price , the system uses a peer-to-peer payment exchange. When Longs dominate (Bullish): Perpetual Price > Spot Price. Longs pay Shorts. When Shorts dominate (Bearish): Perpetual Price < Spot Price. Shorts pay Longs. This is a zero-sum game .…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.

Read More