edgeX 백서

edgeX

원문

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

est succeeded; other values indicate failure. | | data | \[[ContractMultiKline](#schemacontractmultikline)] | Multi-contract K-line payload returned by the server. | | errorParam | object | Structured error details returned by the server. | | requestTime | string(timestamp) | Timestamp when the server received the request. | | responseTime | string(timestamp) | Timestamp when the server returned the response. | | traceId | string | Call trace ID | ### ContractMultiKline | Name | Type | Description | | ---------- | ------------------------ | ------------------------ | | contractId | string(int64) | Perpetual contract ID | | klineList | \[[Kline](#schemakline)] | Collection of kline data | ### TickerResult | Name | Type | Description | | ------------ | -------------------------- | ---------------------------------------------------------------------------------- | | code | string | Status code. `SUCCESS` means the request succeeded; other values indicate failure. | | data | \[[Ticker](#schematicker)] | 24-hour ticker data returned by the server. | | errorParam | object | Structured error details returned by the server. | | requestTime | string(timestamp) | Timestamp when the server received the request. | | responseTime | string(timestamp) | Timestamp when the server returned the response. | | traceId | string | Call trace ID | ### TickerRecord | Name | Type | Description | | ------------------ | --------------- | --------------------------------------------------------- | | contractId | string(int64) | Contract ID | | contractName | string | Contract Name | | priceChange | string(decimal) | Price change | | priceChangePercent | string(decimal) | Price change percentage | | trades | string(int64) | 24-hour number of trades | | size | string(decimal) | 24-hour trading volume | | value | string(decimal) | 24-hour trading value | | high | string(decimal) | 24-hour high price | | low | string(decimal) | 24-hour low price | | open | string(decimal) | 24-hour opening price | | close | string(decimal) | 24-hour closing price | | highTime | string(int64) | 24-hour high price time | | lowTime | string(int64) | 24-hour low price time | | startTime | string(int64) | 24-hour quote start time | | endTime | string(int64) | 24-hour quote end time | | lastPrice | string(decimal) | Latest trade price | | indexPrice | string(decimal) | Current index price | | oraclePrice | string(decimal) | Current oracle price | | markPrice | string(decimal) | Current mark price | | openInterest | string(decimal) | Open Interest | | fundingRate | string | Latest settled funding rate in the current ticker window. | | fundingTime | string(int64) | Timestamp of the latest funding settlement. | | nextFundingTime | string(int64) | Timestamp of the next scheduled funding settlement. | ### GetMarketStatusResult | Name | Type | Description | | ------------ | ----------------------------------------- | ---------------------------------------------------------------------------------- | | code | string | Status code. `SUCCESS` means the request succeeded; other values indicate failure. | | data | [GetMarketStatus](#schemagetmarketstatus) | Market-status payload returned by the server. | | errorParam | object | Structured error details returned by the server. | | requestTime | string(timestamp) | Timestamp when the server received the request. | | responseTime | string(timestamp) | Timestamp when the server returned the response. | | traceId | string | Call trace ID | ### GetMarketStatusPayload | Name | Type | Description | | -------------- | -------------- | ---------------------------------------------------------- | | status | boolean | Whether the market is currently open. `true` means open. | | force | boolean | Whether the status was manually forced by backend control. | | contractId | integer(int64) | Contract ID included in the market-status response. | | markPrice | string | Latest mark price for the contract. | | limitLowPrice | string | Lower limit price | | limitHighPrice | string | Upper limit price | # Funding Rate API **Field naming note**: Some funding responses still expose historical backend field names such as `starkExFundingIndex`. Keep the server field names unchanged in your parser even though V2 signing and integration semantics have moved away from the old StarkEx model. ## When to Use This Page Use funding endpoints when you need the latest funding rate, historical funding records, or funding-related displays in a market-data UI. ## Minimal Calls Get latest funding rate: ```bash curl -X GET "https://<api-domain>/api/v2/public/funding/getLatestFundingRate?contractId=10000001" ``` Get funding rate history: ```bash curl -X GET "https://<api-domain>/api/v2/public/funding/getFundingRatePageByContractId?contractId=10000001&page=1&limit=20" ``` ## Common Notes * Funding endpoints are public and do not require authentication. * Use metadata first if you need contract metadata or display precision before presenting funding data. * Preserve legacy response field names exactly as returned by the server. **Field naming note**: Some funding responses still expose historical backend field names such as `starkExFundingIndex`. Keep the server field names unchanged in your parser even though V2 signing and integration semantics have moved away from the old StarkEx model. ## GET Get Latest Funding Rate by Contract ID GET /api/v2/public/funding/getLatestFundingRate ### Request Parameters | Name | Type | Required | Description | | ---------- | -------------- | -------- | ----------------- | | contractId | array\[string] | No | Contract ID array | > Example Response > 200 Response ```json { "code": "SUCCESS", "data": [ { "contractId": "10000001", "fundingTime": "1734595200000", "fundingTimestamp": "1734597720000", "oraclePrice": "101559.9220921285450458526611328125", "indexPrice": "101522.558968500", "fundingRate": "-0.00005537", "isSettlement": false, "forecastFundingRate": "-0.00012293", "previousFundingRate": "0.00000567", "previousFundingTimestamp": "1734595140000", "premiumIndex": "-0.00036207", "avgPremiumIndex": "-0.00032293", "premiumIndexTimestamp": "1734597720000", "impactMarginNotional": "100", "impactAskPrice": "101485.8", "impactBidPrice": "101484.7", "interestRate": "0.0003", "predictedFundingRate": "0.00005000", "fundingRateIntervalMin": "240", "starkExFundingIndex": "101559.9220921285450458526611328125" } ], "msg": null, "errorParam": null, "requestTime": "1734597737870", "responseTime": "1734597737873", "traceId": "5e27ebfb0ae79f51bbd347d2bf3585f9" } ``` ### Response Codes | Status Code | Status Code Description | Description | Data Model | | ----------- | ------------------------------------------------------- | ------------------- | ------------------------------------- | | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | successful response | [Result](#schemapagedatafundingrate>) | ## GET Get Funding Rate History by Contract ID with Pagination GET /api/v2/public/funding/getFundingRatePage ### Request Parameters | Name | Type | Required | Description | | --------------------------- | ------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | contractId | string | No | Contract ID | | size | integer | No | Number of items to retrieve. Must be greater than 0 and less than or equal to 100. Default: 100 | | offsetData | string | No | Pagination offset. If not provided or empty, retrieves the first page | | filterSettlementFundingRate | boolean | No | If true, only query settlement funding rates (funding rate settlement occurs every 8 hours, with a predicted funding rate calculated every minute). Default: false | | filterBeginTimeInclusive | string | No | Start time in milliseconds. If not provided, retrieves the oldest data | | filterEndTimeExclusive | string | No | End time in milliseconds. If not provided, retrieves the latest data | > Example Response > 200 Response ```json { "code": "SUCCESS", "data": { "dataList": [ { "contractId": "10000001", "fundingTime": "1733702400000", "fundingTimestamp": "1733702400000", "oraclePrice": "101120.888977311551570892333984375", "indexPrice": "101121.681521500", "fundingRate": "0.00005000", "isSettlement": true, "forecastFundingRate": "", "previousFundingRate": "0.00005000", "previousFundingTimestamp": "1733702340000", "premiumIndex": "0.00022566", "avgPremiumIndex": "0.00017953", "premiumIndexTimestamp": "1733702400000", "impactMarginNotional": "500", "impactAskPrice": "101269.6", "impactBidPrice": "101269.1", "interestRate": "0.0003", "predictedFundingRate": "0.00005000", "fundingRateIntervalMin": "240", "starkExFundingIndex": "101120.888977311551570892333984375" } ], "nextPageOffsetData": "0880A08A97B532" }, "msg": null, "errorParam": null, "requestTime": "1734597585432", "responseTime": "1734597586672", "traceId": "02465a59be5d19088ba7e4b5c6b94f6d" } ``` ### Response Codes | Status Code | Status Code Description | Description | Data Model | | ----------- | ------------------------------------------------------- | ------------------- | ------------------------------- | | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | successful response | [Result](#pagedatafundingrate>) | ## Data Models ### FundingRatePage | Name | Type | Description | | ------------ | ------------------------------------------------- | --------------------------------------------------------------- | | code | string | Status code. "SUCCESS" for success, otherwise indicates failure | | data | [PageDataFundingRate](#schemapagedatafundingrate) | General pagination response | | errorParam | object | Parameter information in the error message | | requestTime | string(timestamp) | Server request reception time | | responseTime | string(timestamp) | Server response time | | traceId | string | Call trace ID | ### FundingRatePageSchema | Name | Type | Description | | ------------------ | ------------------------------------ | ---------------------------------------------------------------------------- | | dataList | \[[FundingRate](#schemafundingrate)] | Data list | | nextPageOffsetData | string | Offset data to retrieve the next page. Empty string if there is no next page | ### FundingRateListResult | Name | Type | Description | | ------------ | ------------------------------------ | --------------------------------------------------------------- | | code | string | Status code. "SUCCESS" for success, otherwise indicates failure | | data | \[[FundingRate](#schemafundingrate)] | Successful response data | | errorParam | object | Parameter information in the error message | | requestTime | string(timestamp) | Server request reception time | | responseTime | string(timestamp) | Server response time | | traceId | string | Call trace ID | ### FundingRateItem | Name | Type | Description | | ------------------------ | ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | contractId | string(int64) | Contract ID | | fundingTime | string(int64) | Funding rate settlement time. E.g., the funding rate for the 08:00-09:00 period is calculated from the previous 07:00-08:00 data, finalized at 08:00, and used for settlement at 09:00 | | fundingTimestamp | string(int64) | Funding rate calculation time in milliseconds | | oraclePrice | string | Oracle price | | indexPrice | string | Index price | | fundingRate | string | Funding rate | | isSettlement | boolean | Funding rate settlement flag | | forecastFundingRate | string | Forecast funding rate | | previousFundingRate | string | Previous funding rate | | previousFundingTimestamp | string(int64) | Previous funding rate calculation time in milliseconds | | premiumIndex | string | Premium index | | avgPremiumIndex | string | Average premium index | | premiumIndexTimestamp | string | Premium index calculation time | | impactMarginNotional | string | Quantity required for deep weighted buy/sell price calculation | | impactAskPrice | string | Deep weighted ask price | | impactBidPrice | string | Deep weighted bid price | | interestRate | string | Fixed interest rate | | predictedFundingRate | string | Comprehensive interest rate (interestRate/frequency) | | fundingRateIntervalMin | string(int64) | Funding rate time interval in minutes | | starkExFundingIndex | string | Historical field name for the funding index value returned by the server. | # Private API Private APIs require authentication and provide access to account management, trading operations, asset operations, and personal account data. ## Authentication Required All private REST API endpoints require authentication via HTTP headers: * `X-edgeX-Api-Key`: Your API key * `X-edgeX-Passphrase`: Your API passphrase * `X-edgeX-Timestamp`: Request timestamp in milliseconds * `X-edgeX-Signature`: HMAC-SHA256 request signature For detailed authentication rules, please refer to the [Authentication Documentation](/edgeX-documentation/api-v2/authentication). ## Scope of This Section This documentation section describes the EdgeX V2 private API surface. Platform API capabilities may be broader than the current SDK coverage, and not every platform capability is expanded into a dedicated page in this GitBook yet. ## Available Documented Services ### [Account API](/edgeX-documentation/api-v2/private-api/account-api) Manage trading accounts and query account information. ### [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) Manage unified asset deposits, withdrawals, and asset-flow queries. ### [Transfer API](/edgeX-documentation/api-v2/private-api/transfer-api) Inter-account fund transfers and transfer-out queries. ## Capability Notes The V2 platform includes private API capabilities beyond the pages currently expanded in this section. When a capability is mentioned in higher-level summaries but does not yet have a dedicated page here, treat this GitBook as a staged documentation set rather than a one-to-one index of every backend endpoint. ## L2 Signature Requirements Certain private operations require **EIP-712 L2 signatures** in addition to HTTP authentication, including order creation, `setMarginMode`, withdrawals, and transfer-out operations. For L2 signature implementation details, refer to the [L2 Signature Documentation](/edgeX-documentation/api-v2/sign). ## Usage Example ```bash curl -X GET "https://<api-domain>/api/v2/private/account/getAccountAsset?accountId=123456" \ -H "X-edgeX-Api-Key: your_api_key" \ -H "X-edgeX-Passphrase: your_api_passphrase" \ -H "X-edgeX-Timestamp: 1234567890123" \ -H "X-edgeX-Signature: calculated_signature" ``` ## Response Format All private API responses follow the standard format: ```json { "code": "SUCCESS", "data": { ... }, "msg": null, "errorParam": null, "requestTime": "1234567890123", "responseTime": "1234567890124", "traceId": "abc123..." } ``` ## Base URL * **HTTP REST base URL**: `https://<api-domain>` * Most private REST paths use `/api/v2/private/...` * Unified asset paths currently use `/api/v1/private/unified-asset/...` Replace `<api-domain>` with the production HTTP API domain provided by EdgeX. Internal or non-production domains are not included in this public documentation. ## Navigation * [Back to API V2 Documentation](/edgeX-documentation/api-v2) * [Account API](/edgeX-documentation/api-v2/private-api/account-api) * [Order API](/edgeX-documentation/api-v2/private-api/order-api) * [Asset API](/edgeX-documentation/api-v2/private-api/asset-api) * [Transfer API](/edgeX-documentation/api-v2/private-api/transfer-api) # Account API ## When to Use This Page Use account endpoints after authentication succeeds and you need to read balances, positions, collateral state, leverage-related settings, or account transaction history. ## Minimal Call ```bash curl -X GET "https://<api-domain>/api/v2/private/account/getAccountAsset?accountId=123456" -H "X-edgeX-Api-Key: your_api_key" -H "X-edgeX-Passphrase: your_api_passphrase" -H "X-edgeX-Timestamp: 1234567890123" -H "X-edgeX-Signature: calculated_signature" ``` ## Common Notes * Private account endpoints require REST authentication; see [Authentication](/edgeX-documentation/api-v2/authentication). * Use metadata endpoints first if you need contract precision, coin metadata, or risk-tier context before interpreting balances and positions. * Preserve legacy response field names exactly as returned by the server. ## GET Get Position Transaction Page GET /api/v2/private/account/getPositionTransactionPage ### Request Parameters | Name | Type | Required | Description | | ------------------------------- | ------ | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | | accountId | string | Yes | Account ID | | size | string | No | Number of items to retrieve. Must be greater than 0 and less than or equal to 100 | | offsetData | string | No | Pagination offset. If empty or not provided, the first page is retrieved | | filterCoinIdList | string | No | Filter position transaction records by specified coin IDs. If not provided, all collateral transaction records are retrieved | | filterContractIdList | string | No | Filter position transaction records by specified contract IDs. If not provided, all position transaction records are retrieved | | filterTypeList | string | No | Filter position transaction records by specified types. If not provided, all position transaction records are retrieved | | filterStartCreatedTimeInclusive | string | No | Filter position transaction records created after or at the specified start time (inclusive). If not provided or 0, retrieves records from the earliest time | | filterEndCreatedTimeExclusive | string | No | Filter position transaction records created before the specified end time (exclusive). If not provided or 0, retrieves records up to the latest time | | filterCloseOnly | string | No | Whether to return only position transactions that include closing positions. `true`: only return records with closing; `false`: return all records | | filterOpenOnly | string | No | Whether to return only position transactions that include opening positions. `true`: only return records with opening; `false`: return all records | > Response Example > 200 Response ```json { "code": "SUCCESS", "data": { "dataList": [ { "id": "564809510904923406", "userId": "543429922866069763", "accountId": "543429922991899150", "coinId": "1000", "contractId": "10000001", "type": "SELL_POSITION", "deltaOpenSize": "-0.001", "deltaOpenValue": "-96.813200", "deltaOpenFee": "0.048406", "deltaFundingFee": "0.000000", "beforeOpenSize": "0.001", "beforeOpenValue": "96.813200", "beforeOpenFee": "-0.048406", "beforeFundingFee": "0", "fillCloseSize": "-0.001", "fillCloseValue": "-96.857100", "fillCloseFee": "-0.048428", "fillOpenSize": "0.000", "fillOpenValue": "0.000000", "fillOpenFee": "0.000000", "fillPrice": "96857.1", "liquidateFee": "0", "realizePnl": "-0.004528", "isLiquidate": false, "isDeleverage": false, "fundingTime": "0", "fundingRate": "", "fundingIndexPrice": "", "fundingOraclePrice": "", "fundingPositionSize": "", "orderId": "564809510842007822", "orderFillTransactionId": "564809510875562254", "collateralTransactionId": "564809510904922382", "forceTradeId": "0", "extraType": "", "extraDataJson": "", "censorStatus": "CENSOR_SUCCESS", "censorTxId": "892720", "censorTime": "1734661081049", "censorFailCode": "", "censorFailReason": "", "l2TxI
프로젝트로 돌아가기