TON Hedge Docs
  • Overview
  • Perps
    • How it works
    • Trading
  • Fees
  • Providing Liquidity
  • Options
    • Overview
    • Trading Options
    • Providing Liquidity
    • Option Pricing
    • Referral System
  • User Manual
    • Trading
    • Glossary
  • Terms of Use
Powered by GitBook
On this page
  • Types of Positions
  • Opening the Position
  • Profit and Losses
  • Price Spread
  • Liquidations
  • Asset Selection
  • Isolated Margin Trading
  • Price Oracle
  1. Perps

Trading

PreviousHow it worksNextFees

Last updated 1 month ago

Note!

TON Hedge perpetual DEX is currently in its testnet phase. Its functionality is a subject of change.

Types of Positions

Perpetual futures trading consists of two main position types:

  • Long Position: A trader takes a long position when they anticipate the price of the underlying asset will rise. Essentially, they are betting on an increase and aim to profit from the upward movement.

  • Short Position: A short position is taken when a trader expects the asset’s price to fall. This involves speculating on a decline, seeking to profit as the asset loses value.

Opening the Position

When creating a position, you select the collateral amount (which you will pay) and choose the leverage size. These two factors define the position size in USD:

PositionSizeUSD=Collateral∗LeveragePositionSizeUSD = Collateral * LeveragePositionSizeUSD=Collateral∗Leverage

is deducted from the collateral together with opening the position. The average execution price and position size then determine the position size in base asset:

SizeInTokens=PositionSizeUSD/ExecutionPriceSizeInTokens = PositionSizeUSD / ExecutionPriceSizeInTokens=PositionSizeUSD/ExecutionPrice

For example, if you open a new position with 10x leverage and $500 collateral in ETH/USDT at $2000, their net value will be $5000 USDT, and their position size in base asset will be 2.50 ETH.

Profit and Losses

The main goal of opening a position is to profit from accurately predicting price movements. If the market moves as expected, the trader can close the position and earn a profit from the price difference between entry and exit points.

PnL for Long positions:

PnL for Short positions:

Price Spread

Price spread is the gap between the position entry price and the current market price, affected by liquidity and position size. When user makes a trade, it executes at a price based on the asset's market value. Execution price varies with market sentiment due to price spread mechanics. If long open interest exceeds short interest, short positions get a slightly better price, and vice versa. If the position results in maximum open interest exposure, the price spread will also be at its maximum. Price spread is capped with 0.8% of the market asset price got from the oracle.

Closing position is spread-free.

Execution price for opening a Short positions is calculated as:

And for Longs:

Liquidations

Liquidation occurs when a trader’s position is forcibly closed due to insufficient margin, meaning losses have depleted the collateral.

The liquidation price depends on leverage — the higher the leverage, the closer it is to the execution price. It is displayed in the interface before opening a position.

For Long positions, it is calculated using the following formula:

For Short positions:

Where

  • MarginRatio = 1 / Leverage. Leverage can increase over time due to funding fees, which are deducted from profits or the position's collateral if it’s unprofitable. As a result, liquidation may gradually move closer to the entry price.

  • HealthFactor = 0.01

Asset Selection

At mainnet launch, traders can access TON/USD, BTC/USD, and ETH/USD pairs. As liquidity expands, more pairs and higher volume limits will be added. The platform will support a diverse range of assets, including Crypto, Forex, Equities, and Precious Metals.

Isolated Margin Trading

At TON Hedge, we offer isolated margin trading, a widely recognized standard in DeFi. This approach allows traders to allocate margin to a specific position separately from their overall account balance. By isolating margin, losses from one position do not affect the entire account, reducing the risk of significant losses.

Price Oracle

The execution price is the asset's market price adjusted for .

PnL=SizeInTokens∗MarketPrice−SizeInUSDPnL = SizeInTokens * MarketPrice - SizeInUSDPnL=SizeInTokens∗MarketPrice−SizeInUSD
PnL=SizeInUSD−SizeInTokens∗MarketPricePnL = SizeInUSD - SizeInTokens * MarketPricePnL=SizeInUSD−SizeInTokens∗MarketPrice

When you close the position, you receive your collateral back together with PnL. Meanwhile, and fees are deducted from profits or the position's collateral if it’s unprofitable, and total received amount can be calculated using formula:

ReceiveUSD=Collateral+PnL−FeesReceiveUSD = Collateral + PnL - FeesReceiveUSD=Collateral+PnL−Fees
ExecutionPrice=MarketPrice∗(1−PriceSpread)ExecutionPrice = MarketPrice * (1 - PriceSpread)ExecutionPrice=MarketPrice∗(1−PriceSpread)
ExecutionPrice=MarketPrice∗(1+PriceSpread)ExecutionPrice = MarketPrice * (1 + PriceSpread)ExecutionPrice=MarketPrice∗(1+PriceSpread)
LiquidationPrice=EntryPrice∗(1−MarginRatio+HealthFactor)LiquidationPrice = Entry Price * (1 - MarginRatio + HealthFactor)LiquidationPrice=EntryPrice∗(1−MarginRatio+HealthFactor)
LiquidationPrice=EntryPrice∗(1+MarginRatio−HealthFactor)LiquidationPrice = Entry Price * (1 + MarginRatio- HealthFactor)LiquidationPrice=EntryPrice∗(1+MarginRatio−HealthFactor)

We use to get realtime asset prices. Stork delivers ultra-low latency with sub-millisecond updates, aggregating off-chain price data from top exchanges and validating it via digital signatures and websockets. The data is then sent to TON Blockchain, enabling high-frequency trading in volatile markets.

Stork Oracle
Position fee
position
funding
price impact