Core Concepts

Introduction to Perpetual Futures

Perpetual futures, often simply called "perps," are a type of derivative contract that allows traders to speculate on the future price of an asset without an expiration date. Unlike traditional futures contracts, perps can be held indefinitely.

Key features of perpetual futures:

  • No expiration date

  • Ability to go long or short

  • Use of leverage

  • Funding rate mechanism to keep the contract price close to the spot price

The Sudo protocol implements perpetual futures on the Sui blockchain, allowing for decentralized trading of these instruments.

Key Components of the Sudo Protocol

The Sudo protocol consists of several key components:

  1. Market: The core contract that manages positions, orders, and trades.

  2. Vault: Stores and manages collateral for positions.

  3. Oracle: Provides price feeds for the underlying assets.

  4. Fee Models: Determine various fees including trading fees and funding rates.

The Sudo SDK provides an interface to interact with these components, allowing developers to build applications on top of the Sudo protocol.

Position Types: Long and Short

In perpetual futures trading, there are two types of positions:

  1. Long Position: Traders open a long position when they believe the price of the asset will increase. They profit if the price goes up and lose if it goes down.

  2. Short Position: Traders open a short position when they believe the price of the asset will decrease. They profit if the price goes down and lose if it goes up.

The Sudo SDK provides functions to open, modify, and close both long and short positions.

Collateral and Leverage

Collateral is the asset that traders deposit to open and maintain positions. In the Sudo protocol, this is typically SUI or a stablecoin like USDC.

Leverage allows traders to open positions larger than their collateral. For example, 10x leverage means a trader can open a $10,000 position with only $1,000 of collateral.

Key concepts:

  • Initial Margin: The minimum amount of collateral required to open a position.

  • Maintenance Margin: The minimum amount of collateral required to keep a position open.

  • Effective Leverage: The actual leverage of a position, which changes as the market moves.

The Sudo SDK includes functions to deposit and withdraw collateral.

Funding Rate

The funding rate is a mechanism used in perpetual futures to keep the contract price close to the spot price of the underlying asset. It's a periodic payment between long and short position holders.

  • If the contract price is higher than the spot price, longs pay shorts.

  • If the contract price is lower than the spot price, shorts pay longs.

Liquidation

Liquidation occurs when a trader's position doesn't have enough collateral to cover potential losses. To protect the protocol and other traders, the position is forcibly closed.

Key points about liquidation:

  • Triggered when a position's collateral falls below the maintenance margin

  • The position is closed at the current market price

  • Any remaining collateral after closing the position and paying fees is returned to the trader

Order Types

The Sudo protocol supports various order types to give traders flexibility:

  1. Market Orders: Executed immediately at the best available price.

  2. Limit Orders: Executed only at a specified price or better.

  3. Stop Orders: Triggered when the market price reaches a specified level.

  4. Take Profit Orders: Similar to stop orders, but used to lock in profits.

The SDK provides functions to place, modify, and cancel these different order types.

Price Oracles

Price oracles are crucial for the functioning of the Sudo protocol. They provide reliable price feeds for the assets traded on the platform.

The Sudo protocol uses Pyth Network as its primary oracle solution. This ensures:

  • Real-time price updates

  • High reliability and accuracy

  • Resistance to manipulation

Last updated