Spot Trading
Overview
Spot trading on Frontier Chain provides instant settlement of cryptocurrency trades with the speed of centralized exchanges and the transparency of blockchain technology.
Key Features:
Instant Settlement: Funds available immediately after trade execution
Multiple Trading Pairs: Major cryptocurrencies against USDC
100ms Execution: Near-instant order matching
Self-Trade Prevention: Automatic wash trade protection
Maker/Taker Fees: Competitive fee structure with volume discounts
Order Types
Limit Orders
Place an order at a specific price that enters the order book if not immediately matched.
Use Cases:
Price control: Only buy/sell at your target price
Liquidity provision: Earn maker fees
Large orders: Minimize market impact
Behavior:
Order checked against opposite side of order book
If price matches, execute immediately (taker)
If no match, add to order book (maker)
Remains in book until filled or cancelled
Example:
Market Orders
Execute immediately at the best available price in the order book.
Use Cases:
Immediate execution needed
Guaranteed fill (assuming liquidity)
Time-sensitive trades
Behavior:
Matches against best available prices
Fills multiple levels if needed
Executes at weighted average price
Removes liquidity (always taker)
Example:
Important: Market orders may experience slippage during low liquidity conditions. Consider using limit orders for large trades.
Order Matching
Price-Time Priority
Frontier Chain uses standard price-time priority matching:
Priority Rules:
Best Price First: Orders at better prices match first
Time Priority: Among same-price orders, earlier orders match first
Deterministic: All validators execute identically
Fair: No MEV or front-running possible
Matching Process:
Self-Trade Prevention
Orders from the same user cannot match against each other:
Protection Mechanism:
Incoming order user ID checked against resting orders
If match would occur with same user, order becomes maker
Prevents wash trading automatically
No configuration needed
Example:
Order Lifecycle
1. Order Creation
Client constructs and signs order using EIP-712:
Order Parameters:
Pair ID (1-5)
Side (buy/sell)
Order type (limit/market)
Quantity (6 decimal precision)
Price (6 decimal precision, optional for market)
Timestamp (for nonce)
Signature:
EIP-712 typed structured data
Signed with user's private key
Compatible with MetaMask, Ledger, etc.
2. API Submission
Submit signed order to API server:
Validation Checks:
Signature verification (ECDSA recovery)
Balance availability
Minimum order size
Price tick size compliance
Pair active status
Rejection Reasons:
Invalid signature
Insufficient balance
Below minimum size
Invalid price increment
Inactive trading pair
3. Gossip Propagation
Valid orders broadcast to all validators:
Propagation:
QUIC networking for fast delivery
Broadcast to all validators simultaneously
10-30ms propagation time
Added to validator mempools
Eligibility:
Orders must age 30ms before execution
Prevents leader front-running
Ensures fair ordering
All validators have all orders
4. Consensus Execution
Leader selects and executes eligible orders:
Selection:
Only orders >30ms old
Maximum 20,000 orders per block
Sorted by timestamp then hash
Execution:
Process through matching engine
Update balances
Generate trade records
Compute state root
5. Confirmation
Order fills confirmed via consensus:
Block Commit (100ms):
2f+1 validators vote
Order considered "filled"
Balances updated
Trades recorded
Block Finality (300ms):
3-chain rule satisfied
Irreversible confirmation
Safe for withdrawals
Balance Management
Available Balance
Funds not locked in orders or positions:
Usage:
Can be withdrawn
Can place new orders
Can transfer to other accounts
Calculation:
Locked Balance
Funds reserved for open orders:
Buy Orders:
Lock: Quantity × Price (in USDC)
Example: Buy 1 BTC @ $90,000 → Lock $90,000 USDC
Sell Orders:
Lock: Quantity (in base asset)
Example: Sell 1 BTC @ $90,000 → Lock 1 BTC
Unlock:
On order fill: Locked amount used for trade
On order cancel: Locked amount returned to available
Partial fills: Partial unlock
Precision and Rounding
6 Decimal Standardization:
All assets use exactly 6 decimal places
No conversion overhead
Deterministic calculations
Integer-only arithmetic
Examples:
Fee Structure
Maker vs Taker
Maker Orders:
Add liquidity to order book
Lower fees (rebates at higher tiers)
Limit orders that don't immediately match
Taker Orders:
Remove liquidity from order book
Higher fees
Market orders and immediately-matched limit orders
Fee Calculation
Fees calculated on trade notional value:
Formula:
Example (Tier 0):
Fee Collection
Timing:
Collected at time of trade execution
Deducted from proceeds (sell orders)
Added to cost (buy orders)
Currency:
Always collected in USDC
Simplified accounting
Consistent across all pairs
Trading Strategies
Market Making
Provide liquidity and earn maker fees:
Approach:
Place buy and sell orders around market price
Capture bid-ask spread
Earn maker fees (or pay zero at higher tiers)
Continuously adjust prices
Example:
Limit Order Trading
Control execution price:
Buy Limit Strategy:
Set limit below market price
Wait for price to come to you
Avoid overpaying during volatility
Risk: Order may not fill
Sell Limit Strategy:
Set limit above market price
Capture target profit levels
Avoid panic selling
Risk: Miss better prices
Market Order Trading
Prioritize execution over price:
When to Use:
Urgent trades needed
High liquidity markets
Small order sizes
Exiting positions quickly
Risk Management:
Check order book depth first
Split large orders
Monitor slippage
Consider using limit orders
Order Book Data
L2 Order Book
Full order book depth available via API:
Bid Side (Buy orders):
Price levels in descending order
Quantity available at each level
Number of orders per level
Ask Side (Sell orders):
Price levels in ascending order
Quantity available at each level
Number of orders per level
Example Response:
Recent Trades
Last 1000 trades per pair:
Trade Data:
Price
Quantity
Timestamp
Taker side (buy/sell)
Trade ID
Market Statistics
24-hour rolling statistics:
Metrics:
Open price
High price
Low price
Close price
Total volume
Price change %
Number of trades
WebSocket Updates
Real-time order and trade updates:
Subscription Topics:
Order book updates (L2 snapshots and deltas)
Recent trades stream
User order updates
User fill notifications
Balance changes
Example Subscription:
Conclusion
Spot trading on Frontier Chain combines the best of both worlds: centralized exchange speed with decentralized security and transparency. With 100ms execution, competitive fees, and institutional-grade infrastructure, traders can execute strategies efficiently while maintaining full control of their assets.
Next Steps:
Perpetual FuturesFees and TiersOrder FlowLast updated