bitpro가 원문에서 글자만 모은 내용이에요. 표·그림·수식은 빠지거나 깨질 수 있어요. 전체 15쪽 중 6쪽
pply/demand dynamics, visible to all participants via exchange order books.
### How to Spot Trading on SoDEX <a href="#how-to-spot-trading-on-sodex" id="how-to-spot-trading-on-sodex"></a>
1. Walk Through the SoDEX onboarding process
2. Click **\[Trade]** to the Spot trading interface
3. For example, we are buying BTC. Select a BTC trading pair, such as BTC/USDC.

4. Click **\[Spot]** on the top right and select **\[Buy]**. Then, choose between \[Limit] and \[Market], and enter the price and amount you wish to purchase. You may also drag the bar below the \[Amount] field to customize the percentage of the Spot Account balance to use for the order.
5. Click **\[Buy]** to place the order.
\*Notice: Please note that, by default, the source of funds is your Spot Account. You might need to transfer funds from other accounts, if your Spot account is not enough for Spot trading.
## Futures Trading
Futures trading is a financial practice where parties enter standardized contracts to buy or sell assets (like commodities, currencies, or indices) at a predetermined price and future date, enabling risk hedging or speculative profits. In SoDEX, we are now offering perpetual futures, which are cryptocurrency derivatives without expiry dates that use a periodic funding rate mechanism to anchor their prices to the underlying spot market, enabling leveraged long/short positions with crypto-native settlement.
### How to Futures Trading on SoDEX <a href="#how-to-futures-trading-on-sodex" id="how-to-futures-trading-on-sodex"></a>
1. For example, we are trading BTC perpetual contracts. Start by selecting the **\[Futures]** category in the menu, then choose **\[BTC/USDC]**.

1. Click **\[Futures]** on the top right and select **\[Buy/Long]**. Then, choose between \[Limit] and \[Market], and enter the price and amount you wish to purchase. You may also drag the bar below the \[Amount] field to customize the percentage of the Futures Account balance to use for the order.
2. Click **\[Buy]** to place the order.
## Fees
For now, the fees on Testnet for Spot Trading are 0.1% for Taker orders, and 0.05% for Maker orders. For Futures Trading, 0.05% for Takers orders, and 0.02% for Maker orders. In future updates, tiered fee discounts will be introduced based on users' recent trading volume. Additionally, staking mechanisms and referral programs will be implemented to further reduce fee burdens. During the current Testnet phase, our team remains dedicated to implementing these core functionalities.
### Order types: <a href="#order-types" id="order-types"></a>
* Market: An order that executes immediately at the current market price
* Limit: An order that executes at the selected limit price
* Stop Market: A market order that is activated when the price reaches the selected stop price. Stop orders are generally used to help limit losses and lock in profits
* Stop Limit: A limit order that is activated when the price reaches the selected stop price
### Order options: <a href="#order-options" id="order-options"></a>
* Reduce Only: An order type that decreases an existing position without initiating a new one in the opposite direction.
* Good Till Cancel (GTC): An order that remains active on the order book until it is either executed or manually canceled by the trader.
* Immediate or Cancel (IOC): An order that attempts immediate execution of all or part of the order, with any unfilled portion automatically canceled.
* Take Profit (TP): An order that is automatically executed when the market price reaches the predetermined Take Profit level, closing the position to lock in gains.
* Stop Loss (SL): An order that activates immediately when the market price hits the preset Stop Loss level, liquidating the position to limit potential losses.
* Traders often use TP and SL orders to set targets and protect profits or minimize losses on positions. TP and SL are automatically market orders. You can set a limit price and configure the amount of the position to have a TP or SL.
## Take profit and stop loss orders (TP/SL)
TP/SL orders automatically close positions upon reaching predefined profit (TP) or loss (SL) thresholds.
The mark price serves as the triggering benchmark for TP/SL activation.
Users can configure TP/SL as either market orders (default slippage tolerance: 5%) or limit orders.
* Limit price control: Setting a limit price adjusts slippage tolerance. Aggressive limits (e.g., closer to trigger price) increase fill likelihood but may exacerbate slippage.
* Execution example:
* A SL limit order (trigger: $10, limit: $10) for a long position enters the order book when the mark price breaches $10. If the price gap is from $11 to $9, the order may rest at $10 without filling.
* A SL limit order with a limit $8 would likely fill between $9 to $8 during rapid declines.
TP/SL orders initiated via the position form default to the full position size, attempting complete closure upon trigger.
## Margining
Margin calculations closely mirror the formulas utilized by centralized derivatives exchanges.
Margin Mode
When opening a position, a margin mode must be selected. Cross margin (default) utilizes shared collateral across all cross-margin positions for maximum capital efficiency. Isolated margin restricts collateral allocation to the specific asset, ensuring liquidation:
* In isolated positions, the margin doesn't affect cross/other isolated positions
* In cross/other isolated positions, the margin doesn't affect this isolated position
### Initial Margin and Leverage
Users may select leverage as any integer between 1 and the asset-specific maximum leverage. Position margin requirements are calculated as: `Initial Margin = Position Size × Mark Price ÷ Leverage`
* Cross Margin:
* Initial margin is locked and non-withdrawable
* Unrealized PNL automatically serves as available margin for new positions
* Isolated Margin:
* Supports post-opening margin adjustments (add/remove)
* Unrealized PNL applies as an additional margin to the open position
### Unrealized PNL and transfer margin
Unrealized PNL withdrawal from isolated positions or cross accounts follows the following formulas:
* initialMargin = entryPrice \* positionSize / leverage
* floatingMargin = isolatedMargin - initialMargin
* floatingProfit = calculateFloatingProfitAndLoss(...)
* availableSubtractMargin = max(0, min(floatingMargin, floatingMargin + floatingProfit))
'Transfer' encompasses any non-trading margin removal, including:
* External withdrawals
* Transfers to spot wallets
* Isolated margin position transfers
### Maintenance Margin & Liquidation Mechanics
Cross positions trigger liquidation when: `Account Value (incl. unrealized PNL) < Maintenance Margin × Total Open Notional Position`Maintenance Margin = Position value \* mainMarginRateThe value of mainMarginRate in various symbols is different. For example, when you open a position below maxNominalValue of 12,500,000 USDC under BTC\_USDC, then the mainMarginRate is 0.004. The current Maintenance Margin Rate (mainMarginRate) on SoDEX Testnet for different symbols is consistent, as follows (Updated on 2025.08.01):
| Bracket | Max Nominal Value (USDC) | Maint Margin Rate | Start Margin Rate | Max Leverage | Min Leverage |
| ------- | ------------------------ | ----------------- | ----------------- | ------------ | ------------ |
| 1 | 10,000,000 | 0.30% | 0.50% | 200x | 1x |
| 2 | 12,500,000 | 0.40% | 0.80% | 125x | 1x |
| 3 | 20,000,000 | 0.50% | 1.00% | 100x | 1x |
| 4 | 25,000,000 | 1.00% | 2.00% | 50x | 1x |
| 5 | 50,000,000 | 2.50% | 5.00% | 20x | 1x |
| 6 | 100,000,000 | 5.00% | 10.00% | 10x | 1x |
| 7 | 200,000,000 | 10.00% | 20.00% | 5x | 1x |
| 8 | 400,000,000 | 12.50% | 25.00% | 4x | 1x |
| 9 | 1,500,000,000 | 15.00% | 33.30% | 3x | 1x |
| 10 | 2,000,000,000 | 25.00% | 50.00% | 2x | 1x |
| 11 | 5,000,000,000 | 50.00% | 100.00% | 1x | 1x |
Isolated positions follow identical liquidation logic, with computation inputs solely comprising:
* Isolated margin balance
* The isolated position's notional value
## Liquidations
A liquidation event occurs when a trader's account equity falls below the maintenance margin due to adverse price movements. The maintenance margin equals position value times mainMarginRate.
### Liquidation Process Flow <a href="#liquidation-process-flow" id="liquidation-process-flow"></a>
#### **Initial Liquidation Attempt**: <a href="#initial-liquidation-attempt" id="initial-liquidation-attempt"></a>
* When account equity < maintenance margin, the system sends **market orders** to close the full position size.
* If partially/fully closed, restoring margin above requirements, the remaining collateral stays with the trader.
#### **Backstop Liquidation Trigger**: <a href="#backstop-liquidation-trigger" id="backstop-liquidation-trigger"></a>
* Activates if account equity drops below **2/3 of the maintenance margin** after a failed book liquidation.
* Positions transfer to the **SoDEX Vault and Liquidator Strategy Account.**
#### **Margin Handling in Backstop**: <a href="#margin-handling-in-backstop" id="margin-handling-in-backstop"></a>
* **Cross positions**: All cross positions and margin transfer to the liquidator; account equity resets to zero if no isolated positions exist.
* **Isolated positions**: Only the affected isolated position and its margin transfer; cross assets remain untouched.
* Maintenance margin is **not returned** to users, as it provides the vault's profitability buffer.
#### Price Mechanism <a href="#price-mechanism" id="price-mechanism"></a>
Liquidations use the mark price (synthesizing external CEX prices and SoDEX book state) for robustness. During high volatility, the mark price may diverge significantly from book prices.
**For Cross Margin**
* Maintenance Margin = Quantity (contracts) × Contract Face Value per Contract × Entry Price × Maintenance Margin Rate
**For Isolated Margin**
* Liquidation Price = (Entry Value + Side × (Maintenance Margin - Isolated Margin)) / (Position Size × Contract Face Value)
* Maintenance Margin = Position Size × Contract Face Value × Entry Price × Maintenance Margin Rate
*Mark Price* is calculated in real-time by using the Black-Scholes model. The implied volatility used to calculate Options Mark Price is derived from the best bid and best ask price for the Options contract, along with the volatility cap and volatility floor set in the system. *Implied Volatility = {max\[min(implied volatility of best bid, volatility cap), volatility floor] + max\[min(implied volatility of best ask, volatility cap), volatility floor]} \* 0.5*The volatility cap and volatility floor might be adjusted without notification during severe market volatility. Mark price provides an unbiased, robust estimate of the fair price of perpetual contracts (perp). It is utilized for:
* Calculating margin requirements (`margining`)
* Triggering liquidation events (`liquidations`)
* Activating Take Profit and Stop Loss orders (`TP/SL`)
* Determining unrealized profit and loss (`unrealized PnL`).
The mark price updates whenever validators submit new oracle price updates. Consequently, both mark and oracle prices refresh approximately every 3 seconds.
## Entry price and pnl
### Perpetuals (Perps) Mechanics <a href="#perpetuals-perps-mechanics" id="perpetuals-perps-mechanics"></a>
#### **Position Opening/Closing** <a href="#position-opening-closing" id="position-opening-closing"></a>
* Opening trade: Absolute position size increases (e.g., increase when long/short positions)
* Closing trade: Reduces position exposure
#### **Entry Price Calculation** <a href="#entry-price-calculation" id="entry-price-calculation"></a>
* Opening trades: `New Entry Price = Weighted Average(Current Entry Price, Trade Price)`
* Closing trades: Entry price remains unchanged
#### **PNL Formulas** <a href="#pnl-formulas" id="pnl-formulas"></a>
* Unrealized PNL = side × (mark\_price - entry\_price) × position\_size(side = 1 for long, -1 for short)
* Closed PNL = fees + \[side × (exit\_price - entry\_price) × position\_size]
{% hint style="info" %}
 Closing trade: Full formula
 Opening trade: fee only
{% endhint %}
## Funding
Funding Rates are periodic fees exchanged between long and short positions in perpetual futures contracts to align contract prices with the underlying asset's spot price.
### Payment Calculation <a href="#payment-calculation" id="payment-calculation"></a>
The funding payment is calculated as: Funding Amount = Nominal Value of Positions × Funding Rate
* Nominal Value of Positions = Mark Price \* Size of a Contract
### Payment Settlement Rules <a href="#payment-settlement-rules" id="payment-settlement-rules"></a>
* Position Timing:
* Traders only pay/receive funding if they hold open positions at the exact funding time (e.g., 08:00:00 UTC).
* Closing a position before settlement exempts traders from funding payments, regardless of direction.
* Settlement Latency:
* System processing may take up to 1 minute to complete all settlements.
* New orders placed during settlement may experience high latency (e.g., opening a position at 08:00:59 UTC could still incur funding fees).
### Funding Rate Calculation <a href="#funding-rate-calculation" id="funding-rate-calculation"></a>
The funding rate (`F`) combines two elements:
* Premium Index (`P`): Measures the deviation between the futures price and spot price.
* Interest Rate (`I`): A fixed component set by exchanges. In SoDEX, the interest rate is 0.01%.
* Funding Rate (`F`) = Average Premium Index (P) + clamp(Interest Rate (I) - P, -0.05%, 0.05%)
### **Calculation Steps** <a href="#calculation-steps" id="calculation-steps"></a>
#### **Step 1: Compute Impact Bid/Ask Prices** <a href="#step-1-compute-impact-bid-ask-prices" id="step-1-compute-impact-bid-ask-prices"></a>
* Impact Margin Notional (IMN): The notional value tradable with a fixed collateral (e.g., 25,000 USDT for BTC-USDT at 125x leverage).
* Impact Bid Price: Derived from the order book depth required to reach IMN.
* Impact Bid Price = IMN / \[(IMN - ∑px-1\*qx-1)/px + ∑qx-1]
#### **Step 2: Calculate Premium Index Series** <a href="#step-2-calculate-premium-index-series" id="step-2-calculate-premium-index-series"></a>
* Updated every 5 seconds (5,760 times per 8-hour interval).
* Premium Index (P) = \[Max(0, Impact Bid Price - Index Price) - Max(0, Index Price - Impact Ask Price)] / Index Price
#### **Step 3: Compute Time-Weighted Average Premium Index** <a href="#step-3-compute-time-weighted-average-premium-index" id="step-3-compute-time-weighted-average-premium-index"></a>
* Average Premium Index = (1\*P1 + 2\*P2 + ... + n\*Pn) / (1 + 2 + ... + n)
#### **Step 4: Apply Funding Rate Formula** <a href="#step-4-apply-funding-rate-formula" id="step-4-apply-funding-rate-formula"></a>
Funding Rate (F) = Premium Index (P) + clamp(interest rate - Premium Index (P), -0.05%, 0.05%)
#### **Step 5: Capped Funding Rate** <a href="#step-5-capped-funding-rate" id="step-5-capped-funding-rate"></a>
Enforce caps/floors to limit extreme rates: Capped Funding Rate = clamp(Funding Rate, Floor, Cap)
* The function clamp (x, min, max) means that if (x < min), then x = min; if (x > max), then x = max; if max ≥ a ≥ min, then return x.
* Floor = 0.75 \* Maintenance Margin Ratio
* Cap = 0.75 \* Maintenance Margin Ratio
# 7.1 Why We Have to Build ValueChain
As we began designing SoDex, we quickly hit a wall.Even the most advanced existing blockchain infrastructures were not built for the demands of high-frequency, low-latency, and fully on-chain trading at a global scale. Especially not with the levels of security, modularity, and composability SoDex requires.SoDex needs:
* Infrastructure capable of supporting **Nasdaq-grade throughput** for order book transactions
* Settlement layer that could handle **Visa-level transaction concurrency** for end users
* Native support for onchain order books and modular execution environments
* Seamless composability with EVM-based smart contracts and future DeFi primitives
* Decentralization, transparency, and accessibility
**No existing chain could deliver all of that. So we build one and call it ValueChain.**
# 7.2 Solution: From Application to Infrastructure - introducing ValueChain
## **Overview**
**ValueChain** is the infrastructure behind SoDex, a foundation for a broader financial transformation. Designed from the ground up for performance, scalability, and modular execution, it delivers:
* **High-performance architecture** - including global trading platforms with complex matching requirements and transaction systems with massive concurrent volumes
* **Containerized Blockchain Architecture** - In ValueChain’s design, the HostChain, produced by the consensus algorithm, serves as the foundational host layer. The HostChain accommodates multiple guest chains, including an EVM-compatible system chain (syschain) and several application chains (appchains).
* **EVM syschain as unified account system:** The EVM system manages the overall system state of ValueChain and provides full support for all EVM-compatible dApps. Beyond that, it also acts as the unified account system for other appchains, ensuring that every appchain remains interoperable with the broader EVM ecosystem. Each appchain, in turn, maintains the transactions and state of its dedicated application, enabling deterministic and high-performance execution.
* **Interoperable guest-chains** - while each guest-chain in ValueChain is **logically independent**, their data are all stored **physically colocated** within blocks of the HostChain. This design allows us to implement fast, reliable message passing channels within HostChain to achieve instant interoperability between guest-chains.
\
ValueChain currently consists of:
* **A spot order-book appchain** powering **SoDEX Spot**
* **A perpetual order-book appchain** powering **SoDEX Perpetuals**
* **An EVM System Chain**, serving as the unified account for all app chains
* **Future customized appchains** — including but not limited to RWA, stablecoins, lending protocols, and other emerging financial applications
\
**SoDex** is ValueChain’s first application and its initial two appchains - powering the spot and perpetual trading respectively. SoDex gives us a glimpse of what ValueChain could do and the limitless possibilities.
***
In past generations of public blockchain design, the pursuit of performance - without compromising decentralization - has been the community’s holy grail. For applications like onchain orderbook trading or high-frequency financial systems, developers sought ways to overcome the inherent limitations of legacy architectures. Many projects chose to push the boundaries of existing virtual machine layers (EVM/VM), iterating on performance to reconcile decentralization with scalability.
But after years of iteration, it became increasingly clear that an EVM-centered architecture - originally designed by Ethereum with decentralization and security as its primary goals - was fundamentally not optimized for high-throughput financial computation. As even Vitalik Buterin reaffirmed in recent speeches, the EVM prioritizes reliability and프로젝트로 돌아가기