Lighter 백서

Lighter

원문

bitpro가 원문에서 글자만 모은 내용이에요. 표·그림·수식은 빠지거나 깨질 수 있어요. 전체 8쪽 중 1쪽

# Introduction Lighter is a decentralized trading platform designed for security, scale, and performance in a zero-fee trading environment. It is the first exchange to offer verifiable order matching and liquidations while delivering performance comparable to traditional exchanges. The Lighter platform is available at: * <https://app.lighter.xyz/> * [https://lighter.exchange/](https://lighter.exchange/trade/ETH) # Technical Architecture: Lighter Core Read the Whitepaper: <https://assets.lighter.xyz/whitepaper.pdf> ### Background Lighter Core is built on the following principles: * Users always maintain custody of their assets. * Operations must be verifiable and strictly adhere to a publicly predefined set of rules. * The system must scale seamlessly in both latency and throughput. * Users must always be able to exit securely and independently. Achieving this requires a **publicly verifiable compute engine** that prevents operator misbehavior and guarantees execution strictly according to publicly defined rules. A few existing solutions for verifiable computation exist, each with trade-offs: * **Blockchains with Decentralized Consensus**: Achieve verifiability via redundant execution across network nodes. While secure, they face latency and throughput limitations due to consensus mechanisms and network coordination. Additionally, common approaches lack flexibility around data privacy since data must be public to provide redundancy. The Ethereum blockchain is an example of a blockchain with decentralized consensus. * **Trusted Execution Environments (TEEs)**: Provide hardware-level verification but depend on vendor trust and are vulnerable to side-channel attacks. They require some level of trust since users cannot independently verify execution. * **Succinct Proofs (ZK-Proofs)**: Historically costly and challenging to develop, succinct proofs offer strong security and scale both horizontally and vertically. They also provide modularity for data privacy, unlike consensus-based systems. Additionally, secure exits require asset storage in a robust non-custodial environment. However, the security of the environment users exit to is equally critical. Isolated blockchains connected via bridges offer no non-custodial fallback if compromised. Despite inherent scalability limitations, Ethereum is the most battle-tested verifiable execution platform, providing a neutral, secure settlement layer ideal for user exits. ### Lighter Core Lighter Core combines succinct execution proofs with Ethereum as the anchoring layer for both proofs and system state. Users can securely enter or exit directly through Ethereum, with all proofs verified publicly before any state updates occur. Scalability is achieved through Lighter Core’s novel proving engine, purpose-built from scratch for exchange-specific workloads. It leverages new algorithms and optimized data structures for efficient exchange-operation proof generation. All exchange operations are executed deterministically via user-signed transactions. A batch of these transactions produces a new post-execution state along with a succinct cryptographic proof. <figure><img src="https://1186887628-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXuISSHTfjHCg60BNss6v%2Fuploads%2FKpB5ZGDlaQH6k213BQwz%2Fimage%20(5).png?alt=media&amp;token=786ede76-0295-4389-9197-0495edf70b6c" alt="" width="563"><figcaption></figcaption></figure> Simplified diagram of the described architecture Smart contracts on Ethereum hold deposited assets and the canonical Lighter state root, which encapsulates user assets and positions, public pools, order books, and other critical system components. While processing exchange operations, Lighter Core periodically publishes state update proposals to Ethereum. Each proposal transaction is accompanied by data blobs containing the details of the state transition (e.g., per-account changes), allowing users to independently reconstruct and verify their state. The posted data is highly compressed, enabling Lighter Core to publish state data directly to Ethereum at high scale without relying on third parties. A Sequencer coordinates first-in–first-out transaction ordering and provides soft finality, executing exchange operations and generating data consumed by other system components. This data is fed to API servers, which provide ultra-low-latency data to end users, and to horizontally and vertically scalable Witness Generator services, which transform it into circuit-friendly inputs for the Lighter Prover. The Prover generates proofs in parallel across Lighter transactions. Hundreds of thousands of these execution proofs are then fed into a multi-layer aggregation engine, where they are combined into a single batch proof. This enables efficient and cost-effective verification on Ethereum. Once the proof for a state-update proposal is verified on Ethereum, the contracts update the exchange state. These proofs also attest to the validity and sufficiency of the data posted in Ethereum’s data blobs—demonstrating that the posted data alone is enough to reconstruct all user states using only censorship-resistant and immutable on-chain data. #### Escape Hatch To guarantee liveness and censorship resistance, Lighter Core introduces a **priority request queue** directly on Ethereum. Users can submit critical exit operations—such as withdrawals, public pool exits, or reduce-only IOC orders—on-chain, ensuring that the Sequencer must process them within a predefined timeframe. If the Sequencer fails to process these priority requests in time, the system automatically triggers **Escape Hatch mode**. In this state, the Lighter Core smart contract freezes entirely. Users can then leverage Ethereum-posted data blobs to reconstruct their account state and generate succinct proofs of ownership (balances, positions, pool shares). These proofs allow users to withdraw the full value of their assets directly on Ethereum, with no reliance on off-chain coordination—ensuring complete asset security and independence. # LIT Utility Lighter Infrastructure Token (LIT) is the native infrastructure token supporting access, incentives, and alignment across the Lighter ecosystem. ### Staking The **LIT Staking Pool** (<https://app.lighter.xyz/staking>) is designed to align long-term participants with the core economics of the protocol. By staking LIT, participants gain access to platform benefits aligned with how they interact with the exchange. Unstaking is subject to a 3-day lockup period. Active Staking Programs: * LLP Access * Staking APR #### LLP Access As part of our approach to offering access to niche financial products, the Lighter Liquidity Pool (LLP) is now exclusively accessible to LIT stakers. For every 1 LIT staked, participants may deposit up to 10 USDC into the LLP. #### Staking APR Staking participants currently earn a fixed 6% APR through staking rewards. LIT is bought from `0xADbE1265C0df1B623A56d324De494Bcb8e8914Ff` for these rewards.&#x20; ### Buybacks LIT is bought back by the protocol using trading fee revenue. Buybacks are executed via daily 24-hour TWAPs, with the flexibility to use shorter timeframes depending on market conditions. The treasury account that conducts these is `0x0000000000000000000000000000000000000000`&#x20; # Trading Fees For both perpetual futures and spot markets, Lighter currently charges no maker or taker fees for Standard Accounts, allowing all participants to trade across all markets free of charge. Plus and Premium Accounts are subject to maker and taker fees. Premium Accounts can receive fee discounts by staking LIT. ### Account Types #### Standard Account (Default) — Trade for free.&#x20; * Fees: 0 maker / 0 taker * Taker latency: 300ms * Maker latency: 0ms * Cancel/Modify latency: 300ms * Sub-accounts: create up to 4 * Sub accounts cannot be deleted.&#x20; #### Premium Accounts (Opt-In) — **Subject to Staking-based Fee Tiers** For Premium Accounts, all order cancelations and Post Only order placements are not subject to any additional latency. For this account type, please consider the [volume quota program](https://apidocs.lighter.xyz/docs/volume-quota-program).&#x20; <table><thead><tr><th width="126.85546875">Staked LIT</th><th width="136.8671875">Maker/Taker Fee Discount</th><th width="111.671875">Maker Fee</th><th width="105.89453125">Taker Fee</th><th width="140.15234375">Taker Latency</th></tr></thead><tbody><tr><td>0</td><td></td><td>0.0040%</td><td>0.0280%</td><td>140 ms</td></tr><tr><td>1,000</td><td>2.5%</td><td>0.0039%</td><td>0.0273%</td><td>140 ms</td></tr><tr><td>3,000</td><td>5%</td><td>0.0038%</td><td>0.0266%</td><td>140 ms</td></tr><tr><td>10,000</td><td>10%</td><td>0.0036%</td><td>0.0252%</td><td>140 ms</td></tr><tr><td>30,000</td><td>15%</td><td>0.0034%</td><td>0.0238%</td><td>140 ms</td></tr><tr><td>100,000</td><td>20%</td><td>0.0032%</td><td>0.0224%</td><td>140 ms</td></tr><tr><td>300,000</td><td>25%</td><td>0.0030%</td><td>0.0210%</td><td>140 ms</td></tr><tr><td>500,000</td><td>30%</td><td>0.0028%</td><td>0.0196%</td><td>140 ms</td></tr></tbody></table> #### Plus Accounts (Opt-In) — Suitable for latency-insensitive users, looking to get increased rate limits. This tier can be enabled using the `changeAccountTier` endpoint via API or switched to via account type on the app.&#x20; | Maker/Taker Fee | Taker Latency | Maker/Cancel Latency | sendTx/sendTxBatch per minute | Read-only weighted requests per minute | | --------------- | ------------- | -------------------- | ----------------------------- | -------------------------------------- | | 0.5bps | 300 ms | 200 ms | 4000 | 24000 | *** ### Fee Discounts for Premium Accounts via Staking All Premium Account fees will be eligible for staking discounts. Staking discounts will be applied at the L1 address level, where the total staked LIT is calculated as the combined stake across the main account and all associated sub-accounts. As a result, the main account and its sub-accounts will share the same staking tier, determined by the aggregated LIT stake. #### Rate Limits Considerations We’ll adjust rate limits so users can consolidate activity through subaccounts without downside. Users can also link addresses through contacting the Lighter team to share a single tier based on total staked LIT. In-app wallet linking is coming soon. # LIT Fee Credits The LIT Fee Credits program is designed to support market participants making use of Premium Accounts that have not yet committed to staking. Instead of staking the full amount required for a higher discount tier, users will be able to buy Credits, which will count toward a desired fee and latency tier.&#x20; For example, a participant with 100,000 LIT staked may use an additional 200,000 staked LIT via LIT Fee Credits to qualify for the next staking tier. #### How it Works Participants must acquire LIT if they do not already hold it and navigate to the LIT Fee Credits section on the Staking page. There, they can select the desired credit amount and duration, which determine the applicable trading tier. Upon confirming an L1 signature and completing the upfront LIT payment, the selected tier is activated. All proceeds from the LIT Fee Credits program are distributed to LIT stakers. The upfront fee is streamed as daily rewards over the full duration of the access period. # Unified Trading Accounts Available to be enabled only on web for now. <figure><img src="https://1186887628-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXuISSHTfjHCg60BNss6v%2Fuploads%2FivSDmtDOvErQNQ2kTXGl%2Fcollateral-docs-header.png?alt=media&amp;token=36147d68-0707-4b82-9121-8d472885b2da" alt=""><figcaption></figcaption></figure> #### Unified Trading Account (UTA) Unified Trading Accounts (UTA) enables unified margin on Spot and Perpetuals USDC balances. This functionality represents the first step toward supporting additional Spot assets as collateral in perpetual markets. #### Simple Trading Account Simple Trading Account&#x73;**,** perpetual and spot balances are maintained separately. Perpetual positions may only use settlement assets as collateral. Cross-margining applies exclusively within perpetual markets and does not extend to spot balances. # Order Types & Matching ## Order Types & Matching Lighter supports a variety of order types for entering positions, managing risk, and executing advanced trading strategies. ## Standard Orders ### Market Order A Market Order executes immediately against the best available prices in the order book. #### Characteristics * Prioritizes execution over price. * Takes liquidity from the order book. * May experience slippage during periods of low liquidity or high volatility. #### Execution options * The **Reduce-Only** execution option ensures that changes to the position only move it closer to zero, regardless of whether the position is positive or negative. ### **Limit Orders** A limit order is a buy or sell order that executes at the limit price user sets or better. Limit orders also support enhanced order options like expiration and execution instructions. #### Execution options * The **Post-Only** execution option ensures that a limit order is placed only as a maker order. If there are crossing orders on the opposite side of the order book at the time of placement, the exchange automatically cancels the post-only order to prevent it from becoming a taker order. If no crossing orders are present, the order is inserted into the order book. This guarantees that the order acts only as a maker and will pay maker fees for any trades. * The **Reduce-Only** limit order reduces the position size towards zero, executing partially if the order size exceeds the position, with any remaining portion canceled once the position reaches zero. #### Time in Force Time-in-force options allow users specify the lifetime of an order.&#x20; * **Good ‘Til Time** option allows users to specify a time until which the order remains valid. If the expiry time of an active order in the order book passes, the exchange automatically cancels the order. * **The Immediate or Cancel** option automatically cancels an order if it is not immediately filled. These orders are not placed into the order book as maker orders. ### Stop-loss and Take-profit Orders A stop-loss (SL) order is an instruction to sell (or buy) an asset when its price hits a **trigger price**, with the goal of limiting potential losses. On the other hand, a take-profit (TP) order specifies a trigger price at which an asset will be sold (or bought) to lock in gains. Both orders are automatically triggered. In addition, there are **stop-loss limit orders** and **take-profit limit orders**. A **stop-loss limit order** combines the stop-loss trigger with a limit order, ensuring the asset will be sold (or bought) only at the specified price or better once the mark price reaches the trigger price. Similarly, a **take-profit limit order** sets a price at which the asset will be sold (or bought) to secure profits, but only if the market price meets or exceeds the trigger price. These limit orders offer more control over the execution price compared to standard stop-loss or take-profit orders. #### Trigger Conditions Stop-Loss Sell Order & Take-Profit Buy Order: &#x20; $$\text{markPrice} \le \text{triggerPrice}$$ Stop-Loss Buy Order & Take-Profit Sell Order: &#x20; $$\text{markPrice} \ge \text{triggerPrice}$$ #### Time in Force * The **Good ‘Til Time** option is available for SL/TP limit orders and it allows users to set an expiration time, after which the order is automatically canceled if not triggered. #### Execution options * The **Reduce-Only** option works the same way as for Limit Orders, ensuring the position size decreases towards zero and canceling the order if further fills would cause the position to exceed zero. ### TWAP&#x20; TWAP (Time-Weighted Average Price) Orders are a type of order designed to execute a large order over a specified time period at an average price, aiming to minimize the market impact of the order. The goal is to match the average price of the asset over the execution period, rather than executing all at once at a specific price. #### Running Time The running time option for a TWAP order defines the total time over which the order will be filled. Every 30 seconds, a new market order will be placed with a size of: &#x20; $$\text{order size} = \frac{\text{total amount}}{\text{#orders}}$$ where **#orders** is calculated as: &#x20; $$\text{#orders} = \frac{\text{execution duration}}{30\text{s}} + 1$$ #### Execution options * The **Reduce-Only** option ensures that a trade is executed only if it reduces the position towards 0. The TWAP order will not be canceled when the position reaches 0; it will continue attempting to execute until it expires, but a trade will only happen if the position moves closer to 0. Partial fills may occur during this process. ## Advanced Orders Advanced Orders provide additional flexibility and execution controls for larger or more sophisticated trading strategies. ### TWAP A Time-Weighted Average Price (TWAP) order divides a larger order into smaller executions over a specified period of time. #### Characteristics * Reduces market impact. * Distributes execution across time. * Useful for larger position sizes. * Designed to achieve a more consistent average execution price. *** ### Advanced TWAP Advanced TWAP extends the standard TWAP order with additional execution controls and customization options. #### Characteristics * Supports execution randomization. * Configurable slice frequency. * Configurable execution behavior. * Designed to reduce market impact while maintaining execution flexibility. #### Execution Styles #### Passive Prioritizes minimizing market impact and posting liquidity whenever possible. #### Neutral Balances execution speed and market impact. #### Aggressive Prioritizes execution speed and completion probability. *** ### Chase Limit Orders Chase Limit Orders automatically adjust their limit price to maintain a competitive position in the order book. #### Characteristics * Dynamically updates the order price as market conditions change. * Helps maintain queue position near the best bid or ask. * Reduces the need for manual order modifications. * Remains subject to configured execution limits. *** ### Atomic Orders Atomic Orders allow traders to build a basket of positions across multiple markets and execute the entire trade in a single transaction. #### Characteristics * Supports multiple markets within a single order. * Executes all components together. * Prevents partial execution across the basket. * Useful for portfolio rebalancing, hedging, and multi-market strategies. *** ### Order Margin The Matching Engine performs risk checks after every trade to ensure that the health of trading accounts is maintained: 1. Healthy Accounts: A trade must not cause a currently healthy account to become unhealthy. 2. Unhealthy Accounts: If an account is unhealthy prior to a trade, the trade must improve the account's health. If a trade violates these rules, the Matching Engine auto-cancels the corresponding order(s) that violates the risk checks. To ensure the order book accurately reflects orders that are likely to be executable (i.e., orders that wouldn't trigger an auto-cancellation upon trade execution), the Risk Engine employs a margining system for limit orders placed onto the book. Each limit order consumes a certain amount of Order Margin. Margin consumed by these orders does not affect the position margin; it is merely a checking mechanism used only when placing new orders. Order margin usage does not affect liquidations, etc. Available order margin is calculated as follows: $$ \begin{align\*} \text{orderValue}*{\text{ask/bid}} &= \sum*{i \in \text{acti
프로젝트로 돌아가기