edgeX 백서

edgeX

원문

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

margin level. # ADL Rules Auto-Deleveraging (ADL) Rules for Perpetual Contracts #### Overview 1. Auto-Deleveraging (ADL) is a risk control mechanism for perpetual contracts. When a position goes bankrupt and incurs a loss that cannot be covered by its margin, the system auto-deleverage eligible profitable Counterparty Positions to cover the loss of the Bankrupt Position. 2. ADL is a risk management action executed automatically by the Risk Engine under uniform rules. It does not require counterparties to submit close orders. #### Definitions <table><thead><tr><th width="124.875">Term</th><th>Definition</th></tr></thead><tbody><tr><td>Bankrupt Position</td><td>A position that has been liquidated and whose margin is insufficient to cover its losses, resulting in negative equity in the account or position.</td></tr><tr><td>Counterparty Position</td><td>A position in the same contract as the Bankrupt Position, held in the opposite direction, that is eligible to be selected by the Risk Engine for ADL.</td></tr><tr><td>Unrealized Profit</td><td>The unrealized profit of a Counterparty Position at the time ADL is triggered, calculated by the Risk Engine based on the Mark Price and the protocol's settlement rules.</td></tr></tbody></table> #### Trigger Conditions and Execution Principles 1. Once the system confirms that a position is bankrupt, it immediately determines the quantity of the Bankrupt Position to be covered and initiates the ADL process. ADL applies only to profitable opposing positions in the same contract as the Bankrupt Position. The scope of execution is determined by the valid open positions identified by the Risk Engine at the moment ADL is triggered. 2. The objective of ADL is to close out the Bankrupt Position. The system selects Counterparty Positions one at a time in ranking order and recalculates the remaining quantity to be closed after each execution, ensuring that the ADL quantity never exceeds the available position size of either the Bankrupt Position or the Counterparty Position. #### ADL Ranking Rules 1. The protocol uses the Unrealized Profit of Counterparty Positions as the primary ADL ranking metric. The higher the Unrealized Profit, the higher the ADL ranking and the earlier the position is deleveraged. Positions with negative Unrealized Profit, or that otherwise do not meet the eligibility criteria, are excluded from the ADL candidate pool for that event. 2. Where multiple Counterparty Positions have the same Unrealized Profit, the final order is determined by secondary ranking factors preset in the Risk Engine (such as ROI or leverage), ensuring that the ranking is stable and reproducible. #### ADL Quantity and Sequential Execution 1. Let Q\_bankruptcy be the remaining position size of the Bankrupt Position, and Q\_counterparty be the deleverageable position size of the selected Counterparty Position. The quantity of each ADL execution is: `Q_ADL = min(Q_bankruptcy, Q_counterparty)` 2. The system selects the first eligible Counterparty Position, starting from the highest ADL ranking. 3. The ADL quantity is determined using the formula above, and both the Bankrupt Position and the Counterparty Position are reduced by that quantity. 4. If the Bankrupt Position still has a remaining size, the system selects the next Counterparty Position in the ADL ranking and continues deleveraging. 5. The process repeats until the Bankrupt Position is fully closed. #### ADL Price and Settlement 1. Under normal circumstances, ADL is executed at the Bankruptcy Price of the Bankrupt Position. This price is determined by the Risk Engine when ADL is triggered and is used for position changes and PnL settlement for that ADL execution. 2. In extreme market conditions or in the event of large-scale bankruptcies, to maintain protocol stability, ADL is executed at a fair price calculated by the Risk Engine at the time of bankruptcy. The Bankrupt Position then enters a pending ADL queue until it is matched with Counterparty Positions. 3. The deleveraged portion of a Counterparty Position is settled based on the actual ADL quantity, and that portion of the position is closed. Any remaining position that has not been deleveraged stays open under the existing contract rules. Funding fees, trading fees and other settlement items are handled in accordance with the protocol's prevailing perpetual contract rules. #### User Impact and Disclosure 1. For users subject to ADL, the affected position size is forcibly reduced by the system, and unrealized PnL is converted into realized PnL at the Bankruptcy Price. Users do not need to place orders and cannot specify the quantity or price of the reduction during execution. The protocol will disclose the trigger time, contract, ADL quantity, execution price and settlement results in the position history, order history or risk event records. 2. These rules form part of the protocol's risk management rules for perpetual contracts. The protocol may amend these rules based on market risk, product parameters or regulatory requirements. Changes take effect as specified in the relevant announcement. # TradingView edgeX Integrates TradingView to Enhance Trading Experience edgeX is excited to announce its integration with TradingView, bringing more advanced charts and technical analysis tools to our users. Through this collaboration, users will be able to access: 1. **Real-Time Market Analysis** Leverage TradingView’s professional candlestick charts and technical indicators to effortlessly track cryptocurrency price movements and refine trading strategies. For instance, by utilizing the [BTC/USD](https://www.tradingview.com/symbols/BTCUSD/) price trend chart, users can gain a clear understanding of price fluctuations and the market dynamics of various cryptocurrencies, aiding them in making informed strategic trading decisions. 2. **Backtesting Functionality** Simulate trading decisions using historical data, enabling users to refine strategies and enhance their investment returns. 3. **Seamless Experience** In the future, users will have the capability to directly utilize TradingView tools within the edgeX interface, eliminating the need to switch between platforms, thus making operations more efficient and convenient. This successful integration with TradingView allows edgeX to offer even smarter and more convenient trading support to its users.With the integration of TradingView, edgeX is committed to providing a better trading experience, helping users trade more efficiently. # Stock Perpetual Contracts Before you start trading Stock Perpetuals, please read the following trading rules carefully. These contracts are linked to underlying equity assets. During weekends and market holidays when the stock markets are closed, the trading mechanisms will be adjusted as follows: #### 1. Trading Hours & Market Status * 24/7 Trading: The perpetual market remains open 24/7, but price and volatility are significantly influenced by the status of the underlying stock market. * Market Status: The system determines the current status as "Market Open" or "Market Closed" in real-time, based on the official trading schedule of the relevant stock markets. #### 2. Special Rules During Weekends & Holidays **2.1 Order Types** To protect your assets from abnormal price fluctuations caused by low liquidity when the stock market is closed, the following rules apply: * Market Orders Rejected: The system will reject all Market Orders. * Limit Orders Only: Only Limit Orders are supported, and the limit price must fall within the designated price range. * Conditional Orders: All Conditional Orders (including Take Profit & Stop Loss (TP/SL), Conditional Limit Orders, and Conditional Market Orders) triggered during market closed period must follow the same rules: Market orders will be rejected, and Limit orders outside the price range will also be rejected. **2.2 Price Range & Mark Price** Price range Calculation: * Formula: Long price upper limit is Last Closing Index Price × (1 + 1 / Max Leverage of the pair); Short price lower limit is Last Closing Index Price × (1 - 1 / Max Leverage of the pair). * *Example: If the maximum leverage for a perp trading pair is 10x and the last closing Index Price is $100, buy limit orders cannot exceed $110 and sell limit orders cannot be below $90 during market closure.* Mark Price Adjustment: * During market closure, the Mark Price is also restricted within the price range. * Clamping Mechanism: The price change is limited to 0.5% every 3 seconds. #### 3. Risk Disclosure * Order Execution Risk: Orders placed or triggered during weekends or holidays may be rejected if they do not meet the criteria mentioned above. * Price Deviation Risk: During market status transitions or periods of extreme volatility, the contract price may temporarily deviate from the external spot price. * Liquidation Risk: If your margin is insufficient, you may face the risk of forced liquidation # Forex Perpetual Contracts Before you begin trading Forex Perpetual Contracts, please read the following trading rules carefully. These contracts track the price of their underlying forex assets. As the underlying market transi Before you begin trading Forex Perpetual Contracts, please read the following trading rules carefully. These contracts track the price of their underlying forex assets. As the underlying market transitions between trading sessions, the trading mechanism will be adjusted as follows: 1. **Market Hours and Market Status** * **24/7 Trading:** The perpetual market is open 24/7; however, prices and volatility are significantly affected by the conditions of the underlying forex market. * **Forex Market:** Market status is further classified into Underlying Market Hours, Post-Sunday-Open Reduced Liquidity, Daily Rollover Reduced Liquidity, Pre-Friday-Close Reduced Liquidity, and Underlying Market Closed. <table><thead><tr><th width="130.27734375">FX Contract Market Status</th><th width="541.51171875">Corresponding Time Period</th><th width="107.94921875">Liquidity</th></tr></thead><tbody><tr><td>Underlying Market Closed</td><td>Friday 17:00 to Sunday 17:00 New York time, converted to UTC:<br>• Daylight Saving Time (EDT): Friday 21:00 UTC – Sunday 21:00 UTC<br>• Standard Time (EST): Friday 22:00 UTC – Sunday 22:00 UTC</td><td>Low</td></tr><tr><td>Pre-Friday-Close Reduced Liquidity</td><td>Friday 16:00 to 17:00 New York time, converted to UTC:<br>• Daylight Saving Time (EDT): Friday 20:00 – 21:00 UTC<br>• Standard Time (EST): Friday 21:00 – 22:00 UTC</td><td>Medium</td></tr><tr><td>Daily Rollover Reduced Liquidity</td><td>Monday to Thursday 17:00 to 18:00 New York time, converted to UTC:<br>• Daylight Saving Time (EDT): Monday–Thursday 21:00 – 22:00 UTC<br>• Standard Time (EST): Monday–Thursday 22:00 – 23:00 UTC</td><td>Medium</td></tr><tr><td>Post-Sunday-Open Reduced Liquidity</td><td>Sunday 17:00 to 18:00 New York time, converted to UTC:<br>• Daylight Saving Time (EDT): Sunday 21:00 – 22:00 UTC<br>• Standard Time (EST): Sunday 22:00 – 23:00 UTC</td><td>Medium</td></tr><tr><td>Underlying Market Hours</td><td>All times outside the periods listed above</td><td>High</td></tr></tbody></table> **Note:** During certain public holidays that fall within Underlying Market Hours, liquidity will be downgraded from High to Medium. <br> 2. **Trading Rules by Liquidity Level** \ **High** FX contracts trade normally in accordance with the contract specifications. \ **Medium** Risk limits for all tiers are reduced by 50% Market Order Price Cap/Floor Ratio: 0.5% Limit Order Price Cap/Floor Ratio: 0.5% \ **Low** Only Reduce-Only orders are permitted.&#x20; Reduce-Only Market Order Price Cap/Floor Ratio: 0.5% Reduce-Only Limit Order Price Cap/Floor Ratio: 0.5% 3. **Risk Disclosure** * **Order Execution Risk:** Orders placed or triggered during weekends or public holidays may be rejected if they do not meet the criteria set out above. * **Price Deviation Risk:** During market status transitions or periods of extreme volatility, the contract price may temporarily deviate from the underlying spot price. * **Liquidation Risk:** If your margin is insufficient, your position may be subject to forced liquidation. # API Docs V2 Welcome to the EdgeX API V2 documentation. This section provides comprehensive documentation for all V2 REST API endpoints and WebSocket connections. ## Overview EdgeX API V2 offers a complete set of endpoints for interacting with the EdgeX perpetual trading platform, including: > Note: This GitBook documents the V2 platform API surface. SDK coverage may differ from the full platform endpoint set. * **Public APIs**: Market data, metadata, and funding rates (no authentication required) * **Private APIs**: Account management, order operations, asset management, and transfers (authentication required) * **WebSocket APIs**: Real-time market data and account updates ## What's New in V2 * Enhanced parameter validation and error handling * New leverage management endpoints * Client order ID cancellation support * POST method for complex order history queries * Improved WebSocket message documentation * Better support for position-based order queries ## API Categories ### [Public API](/edgeX-documentation/api-v2/public-api) Access public market data without authentication: * [**Metadata API**](/edgeX-documentation/api-v2/public-api/metadata-api) - Server time, coin list, contract list, global configuration * [**Quote API**](/edgeX-documentation/api-v2/public-api/quote-api) - Market depth, K-line data, 24h ticker, market status * [**Funding Rate API**](/edgeX-documentation/api-v2/public-api/funding-api) - Current and historical funding rates ### [Private API](/edgeX-documentation/api-v2/private-api) Manage accounts and execute trades (authentication required): * [**Account API**](/edgeX-documentation/api-v2/private-api/account-api) - Account assets, positions, collateral, leverage settings * [**Order API**](/edgeX-documentation/api-v2/private-api/order-api) - Create, cancel, and query orders * [**Asset API**](/edgeX-documentation/api-v2/private-api/asset-api) - Deposits, withdrawals, cross-chain transfers * [**Transfer API**](/edgeX-documentation/api-v2/private-api/transfer-api) - Inter-account fund transfers ### [WebSocket API](/edgeX-documentation/api-v2/websocket-api) Real-time data streaming: * [**Public WebSocket**](/edgeX-documentation/api-v2/websocket-api/public-websocket) - Market data subscriptions (ticker, depth, trades, K-line) * [**Private WebSocket**](/edgeX-documentation/api-v2/websocket-api/private-websocket) - Account updates, order updates, position changes ## Authentication Private API endpoints and private WebSocket connections require authentication. EdgeX uses a signature-based authentication mechanism. * [**Authentication Guide**](/edgeX-documentation/api-v2/authentication) - HTTP header authentication for REST APIs * [**L2 Signature Guide**](/edgeX-documentation/api-v2/sign) - EIP-712 Layer 2 signature requirements for trading operations ## SDKs Use the official SDKs for V2 API integration: * [**EdgeX Golang SDK**](https://github.com/edgex-Tech/edgex-golang-sdk) - Go client for V2 REST, signing, and WebSocket flows * [**EdgeX Python SDK**](https://github.com/edgex-Tech/edgex-python-sdk) - Python client for V2 REST, signing, asset, and bridge flows ## Access Domains Use the following production access domains when integrating with EdgeX: * **HTTP REST production domain**: `https://edgex-prod-v2.edgex.exchange` * **Asset API production domain**: `https://spot.edgex.exchange` * **WebSocket production domain**: `wss://edgex-quote-prod-v2.edgex.exchange` All examples in this documentation use placeholders to keep endpoint examples consistent: * Replace `<api-domain>` with `edgex-prod-v2.edgex.exchange` for all REST APIs except Asset API * Replace Asset API requests with `spot.edgex.exchange` * Replace `<ws-domain>` with `edgex-quote-prod-v2.edgex.exchange` * Internal, non-production, and test-only domains are not part of the public documentation ## API Conventions ### Request Format * **HTTP REST base URL**: `https://<api-domain>` for all REST APIs except Asset API * **Asset API base URL**: `https://spot.edgex.exchange` * **WebSocket base URL**: `wss://<ws-domain>` * **Content-Type**: `application/json` * **Character Encoding**: UTF-8 ### Response Format All API responses follow this structure: ```json { "code": "SUCCESS", "data": { ... }, "msg": null, "errorParam": null, "requestTime": "1234567890123", "responseTime": "1234567890124", "traceId": "abc123..." } ``` **Response Fields:** * `code`: Result code (`SUCCESS` or error code) * `data`: Response payload (structure varies by endpoint) * `msg`: Error message (null on success) * `errorParam`: Error parameter details (null on success) * `requestTime`: Request timestamp (milliseconds) * `responseTime`: Response timestamp (milliseconds) * `traceId`: Request trace ID for debugging ### Common HTTP Status Codes * `200 OK`: Request successful * `400 Bad Request`: Invalid request parameters * `401 Unauthorized`: Authentication failed * `403 Forbidden`: Access denied * `429 Too Many Requests`: Rate limit exceeded * `500 Internal Server Error`: Server error ### Pagination Paginated endpoints return data in this format: ```json { "code": "SUCCESS", "data": { "dataList": [ ... ], "nextPageOffsetData": "..." } } ``` * `dataList`: Array of result items * `nextPageOffsetData`: Offset token for next page (empty string indicates last page) ### Timestamps * All timestamps are in milliseconds (Unix epoch time) * Server time can be obtained via `/api/v2/public/meta/getServerTime` ### Number Precision * All numeric values are returned as strings to preserve precision * Always use string comparison for numeric fields in critical operations ## Rate Limits To ensure service stability, API requests are subject to rate limiting: * Public API: Higher rate limits * Private API: Rate limits based on API key tier * WebSocket: Connection and subscription limits apply Exceeding rate limits will result in HTTP 429 responses. ## Error Handling ### Error Response Structure ```json { "code": "ERROR_CODE", "data": null, "msg": "Error description", "errorParam": { "field": "value" }, "requestTime": "1234567890123", "responseTime": "1234567890124", "traceId": "abc123..." } ``` ### Common Error Codes * `INVALID_PARAMETER`: Invalid request parameter * `ACCOUNT_NOT_FOUND`: Account does not exist * `INSUFFICIENT_BALANCE`: Insufficient account balance * `ORDER_NOT_FOUND`: Order does not exist * `SIGNATURE_ERROR`: Signature verification failed * `RATE_LIMIT_EXCEEDED`: Rate limit exceeded ## Support For API support and questions: * Check the specific endpoint documentation for detailed parameter descriptions * Review error messages and `errorParam` for troubleshooting * Use `traceId` when reporting issues ## Version History * **V2** (Current): Enhanced features, improved validation, new endpoints * **V1** (Legacy): Previous API version (see [V1 Documentation](https://github.com/edgex-org/edgex-gitbook/blob/main/api/README.md)) *** **Last Updated**: 2026-06-11\ **API Version**: V2 # Authentication Authentication is crucial for ensuring that only authorized users can access private APIs. This document outlines the authentication mechanisms used for EdgeX V2 public and private APIs, based on the official Golang SDK implementation. *** ## Public API Public APIs do not require authentication. These interfaces are accessible to anyone without the need for any credentials. ``` No authentication is required for public endpoints such as: - /api/v2/public/meta/* - /api/v2/public/quote/* - /api/v2/public/funding/* ``` *** ## Private API Authentication Private APIs require **HMAC-SHA256 signature authentication** to ensure that only authorized use
프로젝트로 돌아가기