edgeX 백서

edgeX

원문

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

r credential requirements and signature generation, see the [Authentication Guide](/edgeX-documentation/api-v2/authentication). ## Connect and Authenticate ### WebSocket URL Use the private WebSocket endpoint: `wss://<ws-domain>/api/v1/private/ws` ### WebSocket Query Parameters The following query parameters **must** be included on the private WebSocket connection URL: * `accountId` (integer, required): EdgeX account identifier * `timestamp` (integer, required): Current millisecond timestamp ### WebSocket Authentication Headers The following headers **must** be included in the private WebSocket handshake request: * `X-edgeX-Api-Key` (string, required): Your API Key obtained from the EdgeX platform * `X-edgeX-Passphrase` (string, required): Your API Passphrase set during API key creation * `X-edgeX-Timestamp` (string, required): Request timestamp in milliseconds * `X-edgeX-Signature` (string, required): HMAC-SHA256 signature of the request Private WebSocket uses the same HMAC credential set and HMAC-SHA256 signing flow as private REST APIs. This page does not repeat the signing algorithm. Use the [Authentication Guide](/edgeX-documentation/api-v2/authentication) to generate `X-edgeX-Signature`. ### Minimal Connection Request ```http GET /api/v1/private/ws?accountId=724625476626153743&timestamp=1705720068228 X-edgeX-Api-Key: your-api-key X-edgeX-Passphrase: your-api-passphrase X-edgeX-Signature: <signature generated as described in the Authentication Guide> X-edgeX-Timestamp: 1705720068228 ``` ## Heartbeat The connection uses a bidirectional ping-pong heartbeat. * The server sends `ping`. * The client should reply with `pong` and echo the same `time`. * The client can also send `ping` proactively to measure latency. Server ping example: ```json { "type": "ping", "time": "1773833240000" } ``` Client pong example: ```json { "type": "pong", "time": "1773833240000" } ``` ## Initial Snapshot After authentication succeeds, the server first confirms the session and then pushes the current full account state. Connection success example from a live session: ```json { "sid": "371619ee-b099-751a-74b1-b46e98606322", "type": "connected", "time": "1773832863182" } ``` Trimmed live snapshot excerpt with representative fields: ```json { "type": "trade-event", "content": { "event": "Snapshot", "version": 907, "time": 1773832863190, "accountId": 0, "data": { "account": [ { "id": "729074578726322703", "userId": "600162890833461506", "clientAccountId": "main", "status": "NORMAL", "createdTime": "1773826958034", "updatedTime": "1773832101293" } ], "collateral": [ { "coinId": "1000", "amount": "83.512690", "cumDepositAmount": "160.000000", "cumWithdrawAmount": "0", "cumTransferInAmount": "0", "cumTransferOutAmount": "0", "updatedTime": "1773832800161" } ], "position": [ { "contractId": "10000002", "openSize": "0.03", "openValue": "69.600200", "fundingFee": "-0.000289", "updatedTime": "1773832690744" } ], "order": [ { "id": "729107150223180559", "contractId": "10000002", "side": "SELL", "type": "STOP_MARKET", "status": "UNTRIGGERED", "updatedTime": "1773832690765" } ] } } } ``` ## Event Updates All business pushes use the same top-level event envelope. This page documents the stable envelope and representative business fields only. It does not attempt to enumerate the complete schema of every nested record under `account`, `collateral`, `position`, `order`, `deposit`, `withdraw`, `transferIn`, or `transferOut`. For complete nested record details, use verified responses together with the corresponding gateway model as the source of truth. ### Message Envelope | Field | Type | Description | | ------------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------ | | `type` | string | Top-level message family. Business pushes use `trade-event`. | | `content.event` | string | Business event name such as `Snapshot`, `ORDER_UPDATE`, or `TRANSFER_OUT_UPDATE`. | | `content.version` | integer | Event version for ordering incremental updates. | | `content.time` | integer | Server timestamp in milliseconds for the business event. | | `content.accountId` | integer | Present in live samples. Current sampled value is `0`, so clients should not treat it as the authoritative account identifier. | | `content.data` | object | Business payload grouped by entity type. | | `sid` | string | Present on the `connected` message, not on `trade-event` payloads. | | `time` | string | Present on `connected`, `ping`, and `pong`. | ### Business Category Mapping | Business Category | `content.event` | | ------------------ | -------------------------------------------------------------------------------- | | Account Snapshot | `Snapshot` | | Trade Updates | `ORDER_UPDATE` | | Asset Updates | `DEPOSIT_UPDATE`, `WITHDRAW_UPDATE`, `TRANSFER_IN_UPDATE`, `TRANSFER_OUT_UPDATE` | | Funding Settlement | `FUNDING_SETTLEMENT` | ### Common `content.data` Groups | Field | Description | | ----------------------- | ----------------------------------------- | | `account` | Account summary records. | | `collateral` | Current collateral balances. | | `collateralTransaction` | Balance movement records. | | `position` | Current position records. | | `positionTransaction` | Position movement records. | | `deposit` | Deposit records. | | `withdraw` | Withdrawal records. | | `transferIn` | Internal transfer-in records. | | `transferOut` | Internal transfer-out records. | | `order` | Order records. | | `orderFillTransaction` | Fill records generated by matched orders. | Not every event populates every group. Unaffected groups may be empty. ## Account Snapshot ### Trigger Scenario The server pushes this message immediately after a successful authenticated connection. Clients should also treat the next `Snapshot` after reconnect as the new local baseline. ### Message Mapping * `type`: `trade-event` * `content.event`: `Snapshot` ### Common `content.data` Fields | Field | Description | | ------------ | ------------------------------------------------------------ | | `account` | Current account-level status and account settings. | | `collateral` | Current collateral balances and cumulative balance counters. | | `position` | Current open positions. | | `order` | Current open or waiting orders. | ### Response Example The example below is a trimmed live snapshot excerpt with representative fields only. ```json { "type": "trade-event", "content": { "event": "Snapshot", "version": 907, "time": 1773832863190, "accountId": 0, "data": { "account": [ { "id": "729074578726322703", "userId": "600162890833461506", "clientAccountId": "main", "status": "NORMAL", "updatedTime": "1773832101293" } ], "collateral": [ { "coinId": "1000", "amount": "83.512690", "cumDepositAmount": "160.000000", "cumTransferOutAmount": "0", "updatedTime": "1773832800161" } ], "position": [ { "contractId": "10000002", "openSize": "0.03", "openValue": "69.600200", "fundingFee": "-0.000289", "updatedTime": "1773832690744" } ], "order": [ { "id": "729107150223180559", "contractId": "10000002", "side": "SELL", "type": "STOP_MARKET", "status": "UNTRIGGERED", "updatedTime": "1773832690765" } ] } } } ``` ## Trade Updates This page uses one trimmed live `ORDER_UPDATE` example as the primary trade update example. ### Trigger Scenario The server pushes this category when an order is created, accepted, triggered, canceled, partially filled, or fully filled, and when that order changes positions or collateral. ### Message Mapping * `type`: `trade-event` * `content.event`: `ORDER_UPDATE` ### Common `content.data` Fields | Field | Description | | ----------------------- | ------------------------------------------------------------------------ | | `order` | The updated order record. | | `orderFillTransaction` | Fill records created by matching. | | `position` | Updated position state after the order changes exposure. | | `positionTransaction` | Position movement records related to the order result. | | `collateral` | Updated collateral balances after realized PnL, fees, or margin changes. | | `collateralTransaction` | Collateral movement records related to the order lifecycle. | | `account` | Optional account summary updates. | ### Response Example The example below is a trimmed live `ORDER_UPDATE` excerpt with representative fields only. ```json { "type": "trade-event", "content": { "event": "ORDER_UPDATE", "version": 916, "time": 1773833120269, "accountId": 0, "data": { "order": [ { "id": "729107150223180559", "contractId": "10000002", "side": "SELL", "type": "STOP_MARKET", "status": "FILLED", "triggerPrice": "2310.00", "cumMatchSize": "0.02", "cumMatchValue": "46.1952", "cumMatchFee": "0.017554", "updatedTime": "1773833120256" } ], "orderFillTransaction": [ { "id": "729108951626416911", "orderId": "729107150223180559", "fillSize": "0.02", "fillValue": "46.1952", "fillFee": "0.017554", "fillPrice": "2309.76", "direction": "TAKER", "matchTime": "1773833120252" } ], "position": [ { "contractId": "10000002", "openSize": "0.01", "openValue": "23.200067", "fundingFee": "-0.000096", "updatedTime": "1773833120269" } ], "collateral": [ { "coinId": "1000", "amount": "129.690336", "cumPositionSellAmount": "46.1952", "cumFillFeeAmount": "-0.046603", "updatedTime": "1773833120269" } ] } } } ``` ## Asset Updates This category groups deposit, withdrawal, and internal transfer state changes under one business-facing section. ### Trigger Scenario The server pushes this category when an asset movement changes account balances or when the related asset-flow record changes status. ### Message Mapping * `type`: `trade-event` * `content.event`: one of `DEPOSIT_UPDATE`, `WITHDRAW_UPDATE`, `TRANSFER_IN_UPDATE`, or `TRANSFER_OUT_UPDATE` | `content.event` | Business Meaning | Primary Record Group | | --------------------- | --------------------------------------------- | -------------------- | | `DEPOSIT_UPDATE` | Deposit state or balance change | `deposit` | | `WITHDRAW_UPDATE` | Withdrawal state or balance change | `withdraw` | | `TRANSFER_IN_UPDATE` | Internal transfer-in state or balance change | `transferIn` | | `TRANSFER_OUT_UPDATE` | Internal transfer-out state or balance change | `transferOut` | ### Common `content.data` Fields | Field | Description | | ----------------------- | ------------------------------------------------------------------- | | `deposit` | Deposit records when `content.event` is `DEPOSIT_UPDATE`. | | `withdraw` | Withdrawal records when `content.event` is `WITHDRAW_UPDATE`. | | `transferIn` | Transfer-in records when `content.event` is `TRANSFER_IN_UPDATE`. | | `transferOut` | Transfer-out records when `content.event` is `TRANSFER_OUT_UPDATE`. | | `collateral` | Updated collateral balances after funds are credited or debited. | | `collateralTransaction` | Balance movement records created by the asset flow. | | `account` | Optional account summary updates. | ### Response Example The example below is a trimmed live `TRANSFER_OUT_UPDATE` excerpt with representative fields only. ```json { "type": "trade-event", "content": { "event": "TRANSFER_OUT_UPDATE", "version": 920, "time": 1773833140579, "accountId": 0, "data": { "transferOut": [ { "id": "729109036640764687", "accountId": "729074578726322703", "coinId": "1000", "amount": "1.000000", "receiverAccountId": "729108352151323326", "clientTransferId": "870080323493747", "transferReason": "USER_TRANSFER", "status": "SUCCESS_CENSOR_SUCCESS", "receiverTransferInId": "729109036745622206", "collateralTransactionId": "729109036863062799", "createdTime": "1773833140526", "updatedTime": "1773833140579" } ], "collateral": [ { "coinId": "1000", "amount": "128.690336", "cumTransferOutAmount": "-1.000000", "updatedTime": "1773833140579" } ], "collateralTransaction": [ { "id": "729109036863062799", "type": "TRANSFER_OUT", "deltaAmount": "-1.000000", "beforeAmount": "129.690336", "transferOutId": "729109036640764687", "censorStatus": "CENSOR_SUCCESS", "createdTime": "1773833140575", "updatedTime": "1773833140579" } ] } } } ``` ## Funding Settlement Funding settlement is a dedicated business category in the private event set. ### Trigger Scenario The server pushes this category when the system settles funding fees for eligible open positions. ### Message Mapping * `type`: `trade-event` * `content.event`: `FUNDING_SETTLEMENT` This page does not attempt to enumerate the nested settlement record model here. Use verified responses and the corresponding gateway model when documenting settlement-specific fields. # Vision & Roadmap ### Vision: The Universal Liquidity Hub for Human and AI *Building the world's first sovereign execution environment optimized for seamless human-AI financial collaboration.*&#x42;y leveraging the EDGE Stack, we are breaking the performance bottlenecks of monolithic blockchains by decoupling high-performance execution from base-layer settlement. Our vision is to provide a high-performance, deterministic, and programmable liquidity layer where AI agents and human traders interact directly with native trading primitives at millisecond speeds, achieving truly autonomous and intelligent asset management across all asset classes. *** ### Technical Roadmap Our technical roadmap focuses on the underlying EDGE Stack evolution to support the next generation of global market structures. By re-engineering the execution layer for deterministic parallelism and modular interoperability, we are building a high-performance foundation capable of anchoring the world's most liquid assets on-chain. #### **Phase 1: Deterministic Parallelism & Scale** * **PTE Engine Optimization**: Refine the Deterministic Parallel Transaction Execution (PTE) engine to achieve near-linear throughput scaling by leveraging market-sharded state access. * **EAL Metadata Enforcement**: Mandate Extended Access Lists (EALs) for all transaction types to gain a pre-execution "god's-eye view" of potential state conflicts, ensuring zero re-execution overhead. #### **Phase 2: Modular Multi-VM & Zero-Copy Interaction** * **Host Function Interface (HFI) Activation**: Deploy the HFI framework to enable synchronous, atomic interoperability between the high-performance edgeVM and the standard edgeEVM. * **Zero-Copy Shared Memory Heap**: Implement data passing via validated pointers within a restricted shared memory heap to eliminate serialization/deserialization costs for cross-VM calls. * **Asynchronous Risk Engine Shifting**: Decouple the Global Risk Engine into an autonomous VM Actor, allowing massive math-heavy portfolio re-evaluations to run on separate physical hardware threads. #### **Phase 3: FlashLane Finality & Economic Security** * **FlashLane QoS Tiering**: Fully integrate protocol-native traffic shaping that actively bifurcates latency-critical trading directives from asynchronous operational tasks. * **Signed Pre-execution Commitments**: Enable the sequencer to issue cryptographically signed FlashLane Commitments, providing traders with "Economic Finality" within milliseconds. * **Pluggable Settlement Evolution:** Evolve beyond initial anchors to establish a versatile interface for diverse Data Availability (DA) and settlement layers, maintaining strategic flexibility for future sovereign network transitions. #### **Phase 4: AI-Native Infrastructure & Privacy Zones** * **AI VM Actor Integration**: Designate specialized execution environments optimized for on-chain machine learning inference, enabling autonomous financial agents to execute data-driven strategies. * **Zero-Knowledge Privacy Zones**: Research and prototype VM Actors utilizing ZKP or TEE technologies to offer encrypted order books and mitigate front-running for institutional participants. * **Programmable Liquidity Backend**: Expose full exchange infrastructure (matching, risk, liquidation) through standardized Liquidity APIs for external terminals and AI brokers. <br> # Brand Kit [Brand Kit Link](https://edgex-brand-kit.notion.site/edgeX-Brand-Kit-23e62ca4b6108070ba51f2120d949bd0) # Audits Platform: [Rigsec Audit Report](https://static.edgex.exchange/audit-reports/rigsec-edgex-audit-report.pdf) [SlowMist Audit Report](https://static.edgex.exchange/audit-reports/edgeX-SlowMist-Audit-Report.pdf) StarkEx: [PeckShield Audit Report](https://github.com/starkware-libs/starkex-contracts/blob/master/audit/StarkEx_v4.5_Audit_Report.pdf) # About # Official Links Homepage: <https://www.edgex.exchange/> Twitter: <https://x.com/edgeX_exchange> Discord: <https://discord.com/invite/edgex> Blog: <https://medium.com/@edgexexchange> # Terms of Use THE edgeX INTERFACE (AS DEFINED BELOW) IS NOT AVAILABLE TO PERSONS OR ENTITIES WHO RESIDE IN, ARE LOCATED IN, ARE INCORPORATED IN, OR HAVE A REGISTERED OFFICE IN THE UNITED STATES OF AMERICA OR CANADA (COLLECTIVELY, “BLOCKED PERSONS”). MOREOVER, NO SERVICES (AS DEFINED BELOW) ARE OFFERED TO PERSONS OR ENTITIES WHO RESIDE IN, ARE CITIZENS OF, ARE LOCATED IN, ARE INCORPORATED IN, OR HAVE A REGISTERED OFFICE IN ANY RESTRICTED TERRITORY (AS DEFINED BELOW, AND ANY SUCH PERSON OR ENTITY FROM A RESTRICTED TERRITORY, A “RESTRICTED PERSON”). WE DO NOT MAKE EXCEPTIONS; THEREFORE, IF YOU ARE A BLOCKED PERSON, THEN DO NOT ATTEMPT TO USE THE edgeX INTERFACE AND IF YOU ARE A RESTRICTED PERSON, THEN DO NOT ATTEMPT TO USE ANY OF THE SERVICES. USE OF A VIRTUAL PRIVATE NETWORK (“VPN”) TO CIRCUMVENT THE RESTRICTIONS SET FORTH HEREIN IS PROHIBITED. These terms of use, together with any documents and additional terms they expressly incorporate by reference, which includes any other terms and conditions or other agreement that edgeX Trading Inc. and its affiliates (“edgeX,” “we,” “us” and “our”) posts publicly or makes available to you or the company or other legal entity you represent (“you” or “your”) (collectively, these “Terms”), are entered into between edgeX and you concerning your use of, and access to: * edgeX’s websites, including edgeX.exchange (and their respective subdomains); web applications; mobile applications; and all associated sites linked thereto by edgeX (collectively with any materials and services available therein, and successor website(s) or application(s) thereto, the “Site”); * all products and features available via the Site, including the order book, matching engine, smart contracts, decentralized applications, APIs and all other software that edgeX or a third party has developed for trading blockchain-based assets (collectively, “Digital Assets”), including entering into perpetual contracts (“Perpetual Contracts”) related to Digital Assets, or exchanging one Digital Asset for another Digital Asset through the 0x API, and the computation and storage scalability service known as “StarkEx” (the “StarkEx Service”) (collectively the “Interface”); and * non-fungible tokens (“NFTs”) available in connection with the Interface, or registration for or attendance at events sponsored or hosted by edgeX (collectively with the Site and the Interface, the “Services”). Please read these Terms carefully, as these Terms govern your use of the Services. These Terms expressly cover your rights and obligations, and our disclaimers and limitations of legal liability, relating to your use of, and access to, the Services. By clicking “I agree” (or a similar language) to these Terms, acknowledging these Terms by other means, or otherwise accessing or using the Services, you accept and agree to be bound by and to comply with these Terms, including the mandatory arbitration provision in Section 15. If you do not agree to these Terms, then you must not access or use the Services.Please carefully review the disclosures and disclaimers set forth in Section 12 in their entire
프로젝트로 돌아가기