diff --git a/CHANGELOG.md b/CHANGELOG.md index f50edc9..05a1e62 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,122 @@ # Changelog +## 1.21.0 - 2024-06-06 +### Added +- `GET /api/v3/account/commission` +- `GET /api/v3/ticker/tradingDay` + +**Convert** +- `POST /sapi/v1/convert/limit/placeOrder` +- `POST /sapi/v1/convert/limit/cancelOrder` +- `GET /sapi/v1/convert/limit/queryOpenOrders` + +**Dual Investment** +- `GET /sapi/v1/dci/product/list` +- `POST /sapi/v1/dci/product/subscribe` +- `GET /sapi/v1/dci/product/positions` +- `GET /sapi/v1/dci/product/accounts` +- `POST /sapi/v1/dci/product/auto_compound/edit-status` + +**Margin** +- `POST /sapi/v1/margin/borrow-repay` +- `GET /sapi/v1/margin/borrow-repay` +- `GET /sapi/v1/spot/delist-schedule` + +**Staking** +- `POST /sapi/v2/eth-staking/eth/stake` +- `POST /sapi/v1/eth-staking/eth/redeem` +- `GET /sapi/v1/eth-staking/eth/history/stakingHistory` +- `GET /sapi/v1/eth-staking/eth/history/redemptionHistory` +- `GET /sapi/v1/eth-staking/eth/history/rewardsHistory` +- `GET /sapi/v1/eth-staking/eth/quota` +- `GET /sapi/v1/eth-staking/eth/history/rateHistory` +- `GET /sapi/v2/eth-staking/account` +- `POST /sapi/v1/eth-staking/wbeth/wrap` +- `GET /sapi/v1/eth-staking/wbeth/history/wrapHistory` +- `GET /sapi/v1/eth-staking/wbeth/history/unwrapHistory` +- `GET /sapi/v1/eth-staking/eth/history/wbethRewardsHistory` + +**Wallet** +- `GET /sapi/v1/capital/withdraw/address/list` +- `GET /sapi/v1/account/info` + +### Changed +**Gift Card** +- `POST /sapi/v1/giftcard/createCode`: add response field `expiredTime` +- `POST /sapi/v1/giftcard/buyCode`: add response field `expiredTime` + +**Loan** +- Updated `POST /sapi/v1/loan/flexible/borrow` to `POST /sapi/v2/loan/flexible/borrow` +- Updated `GET /sapi/v1/loan/flexible/loanable/data` to `GET /sapi/v2/loan/flexible/loanable/data` +- Updated `GET /sapi/v1/loan/flexible/collateral/data` to `GET /sapi/v2/loan/flexible/collateral/data` +- Updated `GET /sapi/v1/loan/flexible/ongoing/orders` to `GET /sapi/v2/loan/flexible/ongoing/orders` +- Updated `POST /sapi/v1/loan/flexible/repay` to `POST /sapi/v2/loan/flexible/repay` +- Updated `POST /sapi/v1/loan/flexible/adjust/ltv` to `POST /sapi/v2/loan/flexible/adjust/ltv` +- Updated `GET /sapi/v1/loan/flexible/borrow/history` to `GET /sapi/v2/loan/flexible/borrow/history` +- Updated `GET /sapi/v1/loan/flexible/repay/history` to `GET /sapi/v2/loan/flexible/repay/history` +- Updated `GET /sapi/v1/loan/flexible/ltv/adjustment/history` to `GET /sapi/v2/loan/flexible/ltv/adjustment/history` + +**Market** +- `GET /api/v3/avgPrice`: response has a new field `closeTime` +- `GET /api/v3/klines` and `GET /api/v3/uiKlines` have a new optional parameter `timeZone` +- `GET /api/v3/exchangeInfo`: add `otoAllowed`, `cancelReplaceAllowed` and `permissionSets` in response + +**Margin** +- `GET /sapi/v1/margin/transfer`: add parameter `isolatedSymbol` +- `GET /sapi/v1/margin/allAssets`: add parameter `asset` +- `GET /sapi/v1/margin/allPairs`: add parameter `symbol` +- `GET /sapi/v1/margin/isolated/allPairs`: add parameter `symbol` + +**Trade** +- `POST /api/v3/order/test` and POST `/api/v3/sor/order/test` have a new optional parameter `computeCommissionRates` + +**Wallet** +- `GET /sapi/v1/asset/dribblet`: add parameter `accountType` +- `POST /sapi/v1/asset/dust-btc`: add parameter `accountType` +- `POST /sapi/v1/asset/dust`: add parameter `accountType` +- `GET /sapi/v1/capital/config/getall`: remove response field `resetAddressStatus` + +### Deleted +**Bswap** +- `GET /sapi/v1/bswap/pools` +- `GET /sapi/v1/bswap/liquidity` +- `POST /sapi/v1/bswap/liquidityAdd` +- `POST /sapi/v1/bswap/liquidityRemove` +- `GET /sapi/v1/bswap/liquidityOps` +- `GET /sapi/v1/bswap/quote` +- `POST /sapi/v1/bswap/swap` +- `GET /sapi/v1/bswap/swap` +- `GET /sapi/v1/bswap/poolConfigure` +- `GET /sapi/v1/bswap/addLiquidityPreview` +- `GET /sapi/v1/bswap/removeLiquidityPreview` +- `GET /sapi/v1/bswap/unclaimedRewards` +- `POST /sapi/v1/bswap/claimRewards` +- `GET /sapi/v1/bswap/claimedHistory` + +**Margin** +- `POST /sapi/v1/margin/transfer` +- `POST /sapi/v1/margin/isolated/transfer` +- `POST /sapi/v1/margin/loan` +- `POST /sapi/v1/margin/repay` +- `GET /sapi/v1/margin/isolated/transfer` +- `GET /sapi/v1/margin/asset` +- `GET /sapi/v1/margin/pair` +- `GET /sapi/v1/margin/isolated/pair` +- `GET /sapi/v1/margin/loan` +- `GET /sapi/v1/margin/repay` +- `GET /sapi/v1/margin/dribblet` +- `GET /sapi/v1/margin/dust` +- `POST /sapi/v1/margin/dust` + +**Staking** +- `GET /sapi/v1/staking/productList` +- `POST /sapi/v1/staking/purchase` +- `POST /sapi/v1/staking/redeem` +- `GET /sapi/v1/staking/position` +- `GET /sapi/v1/staking/stakingRecord` +- `POST /sapi/v1/staking/setAutoStaking` +- `GET /sapi/v1/staking/personalLeftQuota` + ## 1.20.1 - 2023-12-07 - Minor updates diff --git a/spot_api.yaml b/spot_api.yaml index f9cdc78..f3bf834 100644 --- a/spot_api.yaml +++ b/spot_api.yaml @@ -32,8 +32,6 @@ tags: description: Isolated User Data Stream - name: Savings description: Savings Endpoints - - name: Staking - description: Staking Endpoints - name: Mining description: Mining Endpoints - name: Futures @@ -46,8 +44,6 @@ tags: description: Portfolio Margin Endpoints - name: BLVT description: Binance Leveraged Tokens Endpoints - - name: BSwap - description: Binance Swap Endpoints - name: Fiat description: Fiat Endpoints - name: C2C @@ -117,6 +113,15 @@ paths: Current exchange trading rules and symbol information - If any symbol provided in either symbol or symbols do not exist, the endpoint will throw an error. + - All parameters are optional. + - permissions can support single or multiple values (e.g. SPOT, ["MARGIN","LEVERAGED"]) + - If permissions parameter not provided, the default values will be ["SPOT","MARGIN","LEVERAGED"]. + - To display all permissions you need to specify them explicitly. (e.g. SPOT, MARGIN,...) + + Examples of Symbol Permissions Interpretation from the Response: + - [["A","B"]] means you may place an order if your account has either permission "A" or permission "B". + - [["A"],["B"]] means you can place an order if your account has permission "A" and permission "B". + - [["A"],["B","C"]] means you can place an order if your account has permission "A" and permission "B" or permission "C". (Inclusive or is applied here, not exclusive or, so your account may have both permission "B" and permission "C".) Weight(IP): 10 tags: @@ -208,17 +213,28 @@ paths: example: "LIMIT" icebergAllowed: type: boolean + example: true ocoAllowed: type: boolean + example: true + otoAllowed: + type: boolean + example: false quoteOrderQtyMarketAllowed: type: boolean + example: true allowTrailingStop: type: boolean example: false + cancelReplaceAllowed: + type: boolean + example: true isSpotTradingAllowed: type: boolean + example: true isMarginTradingAllowed: type: boolean + example: true filters: type: array items: @@ -246,6 +262,15 @@ paths: items: type: string example: "SPOT" + permissionSets: + type: array + items: + type: array + items: + type: string + example: + - "SPOT" + - "MARGIN" defaultSelfTradePreventionMode: type: string example: "NONE" @@ -266,12 +291,15 @@ paths: - orderTypes - icebergAllowed - ocoAllowed + - otoAllowed - quoteOrderQtyMarketAllowed - allowTrailingStop + - cancelReplaceAllowed - isSpotTradingAllowed - isMarginTradingAllowed - filters - permissions + - permissionSets - defaultSelfTradePreventionMode - allowedSelfTradePreventionModes required: @@ -469,6 +497,13 @@ paths: example: '"1m"' - $ref: '#/components/parameters/startTime' - $ref: '#/components/parameters/endTime' + - name: timeZone + in: query + required: false + description: |- + Default: 0 (UTC) + schema: + type: string - $ref: '#/components/parameters/limit' responses: '200': @@ -528,6 +563,13 @@ paths: example: '"1m"' - $ref: '#/components/parameters/startTime' - $ref: '#/components/parameters/endTime' + - name: timeZone + in: query + required: false + description: |- + Default: 0 (UTC) + schema: + type: string - $ref: '#/components/parameters/limit' responses: '200': @@ -587,12 +629,20 @@ paths: type: integer format: int64 example: 5 + description: Average price interval (in minutes) price: type: string example: "9.35751834" + description: Average price + closeTime: + type: integer + format: int64 + example: 1694061154503 + description: Last trade time required: - mins - price + - closeTime '400': description: Bad Request content: @@ -616,22 +666,58 @@ paths: parameters: - $ref: '#/components/parameters/optionalSymbol' - $ref: '#/components/parameters/arraySymbols' - - name: type + - $ref: '#/components/parameters/tickerType' + responses: + '200': + description: 24hr ticker + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/ticker' + - $ref: '#/components/schemas/tickerList' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/error' + /api/v3/ticker/tradingDay: + get: + summary: Trading Day Ticker + description: |- + Price change statistics for a trading day. + + Notes: + - Supported values for timeZone: + - Hours and minutes (e.g. -1:00, 05:45) + - Only hours (e.g. 0, 8, 4) + + Weight: + - `4` for each requested symbol. + - The weight for this request will cap at `200` once the number of symbols in the request is more than `50`. + tags: + - Market + parameters: + - $ref: '#/components/parameters/optionalSymbol' + - $ref: '#/components/parameters/arraySymbols' + - name: timeZone in: query + required: false description: |- - Supported values: FULL or MINI. - If none provided, the default is FULL + Default: 0 (UTC) schema: type: string + - $ref: '#/components/parameters/tickerType' responses: '200': - description: 24hr ticker + description: Trading day ticker content: application/json: schema: oneOf: - - $ref: '#/components/schemas/ticker' - - $ref: '#/components/schemas/tickerList' + - $ref: '#/components/schemas/dayTicker' + - $ref: '#/components/schemas/dayTickerList' '400': description: Bad Request content: @@ -824,7 +910,9 @@ paths: Test new order creation and signature/recvWindow long. Creates and validates a new order but does not send it into the matching engine. - Weight(IP): 1 + Weight(IP): + - Without computeCommissionRates: `1` + - With computeCommissionRates: `20` tags: - Trade parameters: @@ -843,6 +931,14 @@ paths: - $ref: '#/components/parameters/icebergQty' - $ref: '#/components/parameters/newOrderRespType' - $ref: '#/components/parameters/recvWindow' + - name: computeCommissionRates + in: query + required: false + description: |- + Default: false + schema: + type: boolean + example: false - $ref: '#/components/parameters/timestamp' - $ref: '#/components/parameters/signature' security: @@ -2063,6 +2159,10 @@ paths: description: |- Test new order creation and signature/recvWindow using smart order routing (SOR). Creates and validates a new order but does not send it into the matching engine. + + Weight(IP): + - Without computeCommissionRates: `1` + - With computeCommissionRates: `20` tags: - Trade parameters: @@ -2083,6 +2183,14 @@ paths: - $ref: '#/components/parameters/icebergQty' - $ref: '#/components/parameters/newOrderRespType' - $ref: '#/components/parameters/selfTradePreventionMode' + - name: computeCommissionRates + in: query + required: false + description: |- + Default: false + schema: + type: boolean + example: false - $ref: '#/components/parameters/recvWindow' - $ref: '#/components/parameters/timestamp' - $ref: '#/components/parameters/signature' @@ -2499,30 +2607,192 @@ paths: application/json: schema: $ref: '#/components/schemas/error' + /api/v3/account/commission: + get: + summary: Query Commission Rates (USER_DATA) + description: |- + Get current account commission rates. - /sapi/v1/margin/transfer: + Weight: 20 + tags: + - Trade + parameters: + - $ref: '#/components/parameters/symbol' + - $ref: '#/components/parameters/timestamp' + - $ref: '#/components/parameters/signature' + security: + - ApiKeyAuth: [] + responses: + '200': + description: Current account commission rates. + content: + application/json: + schema: + type: object + properties: + symbol: + type: string + example: "BTCUSDT" + standardCommission: + type: object + description: Standard commission rates on trades from the order. + properties: + maker: + type: string + example: "0.00000010" + taker: + type: string + example: "0.00000020" + buyer: + type: string + example: "0.00000030" + seller: + type: string + example: "0.00000040" + required: + - maker + - taker + - buyer + - seller + taxCommission: + type: object + description: Tax commission rates for trades from the order. + properties: + maker: + type: string + example: "0.00000112" + taker: + type: string + example: "0.00000114" + buyer: + type: string + example: "0.00000118" + seller: + type: string + example: "0.00000116" + required: + - maker + - taker + - buyer + - seller + discount: + type: object + description: Discount commission when paying in BNB. + properties: + enabledForAccount: + type: boolean + example: true + enabledForSymbol: + type: boolean + example: true + discountAsset: + type: string + example: "BNB" + discount: + type: string + description: Standard commission is reduced by this rate when paying commission in BNB. + example: "0.25000000" + required: + - symbol + - standardCommission + - taxCommission + - discount + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/error' + '401': + description: Unauthorized Request + content: + application/json: + schema: + $ref: '#/components/schemas/error' + + /sapi/v1/margin/borrow-repay: post: - summary: Cross Margin Account Transfer (MARGIN) + summary: Margin account borrow/repay(MARGIN) description: |- - Execute transfer between spot account and cross margin account. + Margin account borrow/repay(MARGIN) - Weight(IP): 600 + Weight(UID): 3000 tags: - Margin parameters: - $ref: '#/components/parameters/asset' + - name: isIsolated + in: query + required: true + description: "TRUE for isolated margin, FALSE for crossed margin" + schema: + type: string + - $ref: '#/components/parameters/symbol' - $ref: '#/components/parameters/amount' - name: type in: query required: true - description: |- - * `1` - transfer from main account to margin account - * `2` - transfer from margin account to main account + description: BORROW or REPAY + schema: + type: string + - $ref: '#/components/parameters/recvWindow' + - $ref: '#/components/parameters/timestamp' + - $ref: '#/components/parameters/signature' + security: + - ApiKeyAuth: [] + responses: + '200': + description: Margin account borrow/repay + content: + application/json: + schema: + type: object + properties: + tranId: + type: integer + format: int64 + example: 100000001 + required: + - tranId + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/error' + get: + summary: Query borrow/repay records in Margin account(USER_DATA) + description: |- + Query borrow/repay records in Margin account + + - txId or startTime must be sent. txId takes precedence. Response in descending order + - If an asset is sent, data within 30 days before endTime; If an asset is not sent, data within 7 days before endTime + - If neither startTime nor endTime is sent, the recent 7-day data will be returned. + - startTime set as endTime - 7 days by default, endTime set as current time by default + + Weight(IP): 10 + tags: + - Margin + parameters: + - $ref: '#/components/parameters/asset' + - $ref: '#/components/parameters/isolatedSymbol' + - name: txId + in: query + required: false + description: tranId in POST /sapi/v1/margin/loan schema: type: integer - format: int32 - minimum: 1 - maximum: 2 + format: int64 + - $ref: '#/components/parameters/startTime' + - $ref: '#/components/parameters/endTime' + - $ref: '#/components/parameters/current' + - $ref: '#/components/parameters/size' + - name: type + in: query + required: true + description: BORROW or REPAY + schema: + type: string - $ref: '#/components/parameters/recvWindow' - $ref: '#/components/parameters/timestamp' - $ref: '#/components/parameters/signature' @@ -2530,23 +2800,71 @@ paths: - ApiKeyAuth: [] responses: '200': - description: Transfer Id + description: Margin account borrow/repay content: application/json: schema: - $ref: '#/components/schemas/transaction' + type: object + properties: + rows: + type: array + items: + type: object + properties: + isolatedSymbol: + type: string + description: Isolated symbol, will not be returned for crossed margin + amount: + type: string + description: Total amount borrowed/repaid + asset: + type: string + interest: + type: string + description: Interest repaid + principal: + type: string + description: Principal repaid + status: + type: string + description: one of PENDING (pending execution), CONFIRMED (successfully execution), FAILED (execution failed, nothing happened to your account) + timestamp: + type: integer + format: int64 + txId: + type: integer + format: int64 + required: + - asset + - principal + - status + - timestamp + - txId + total: + type: integer + format: int32 + required: + - rows + - total + example: + rows: + - + isolatedSymbol: "BNBUSDT" + amount: "14.00000000" + asset: "BNB" + interest: "0.01866667" + principal: "13.98133333" + status: "CONFIRMED" + timestamp: 1563438204000 + txId: 2970933056 + total: 1 '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/error' - '401': - description: Unauthorized Request - content: - application/json: - schema: - $ref: '#/components/schemas/error' + /sapi/v1/margin/transfer: get: summary: Get Cross Margin Transfer History (USER_DATA) description: |- @@ -2564,7 +2882,7 @@ paths: - $ref: '#/components/parameters/endTime' - $ref: '#/components/parameters/current' - $ref: '#/components/parameters/size' - - $ref: '#/components/parameters/archived' + - $ref: '#/components/parameters/isolatedSymbol' - $ref: '#/components/parameters/recvWindow' - $ref: '#/components/parameters/timestamp' - $ref: '#/components/parameters/signature' @@ -2628,162 +2946,166 @@ paths: schema: $ref: '#/components/schemas/error' '401': - description: Unauthorized Request - content: - application/json: - schema: - $ref: '#/components/schemas/error' - /sapi/v1/margin/loan: - post: - summary: Margin Account Borrow (MARGIN) - description: |- - Apply for a loan. - - - If "isIsolated" = "TRUE", "symbol" must be sent - - "isIsolated" = "FALSE" for crossed margin loan - - Weight(UID): 3000 + description: Unauthorized Request + content: + application/json: + schema: + $ref: '#/components/schemas/error' + /sapi/v1/margin/allAssets: + get: + summary: Get All Margin Assets (MARKET_DATA) + description: 'Weight(IP): 1' tags: - Margin parameters: - $ref: '#/components/parameters/asset' - - $ref: '#/components/parameters/isIsolatedMargin' - - $ref: '#/components/parameters/optionalSymbol' - - $ref: '#/components/parameters/amount' - - $ref: '#/components/parameters/recvWindow' - - $ref: '#/components/parameters/timestamp' - - $ref: '#/components/parameters/signature' security: - ApiKeyAuth: [] responses: '200': - description: Transaction id + description: Assets details content: application/json: schema: - $ref: '#/components/schemas/transaction' + type: array + items: + type: object + properties: + assetFullName: + type: string + example: "Binance coin" + assetName: + type: string + example: "BNB" + isBorrowable: + type: boolean + isMortgageable: + type: boolean + userMinBorrow: + type: string + example: "0.00000000" + userMinRepay: + type: string + example: "0.00000000" + required: + - assetFullName + - assetName + - isBorrowable + - isMortgageable + - userMinBorrow + - userMinRepay '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/error' - '401': - description: Unauthorized Request - content: - application/json: - schema: - $ref: '#/components/schemas/error' + /sapi/v1/margin/allPairs: get: - summary: Query Loan Record (USER_DATA) - description: |- - - `txId` or `startTime` must be sent. `txId` takes precedence. - - Response in descending order - - If `isolatedSymbol` is not sent, crossed margin data will be returned - - Set `archived` to `true` to query data from 6 months ago - - Weight(IP): 10 + summary: Get All Cross Margin Pairs (MARKET_DATA) + description: 'Weight(IP): 1' tags: - Margin parameters: - - $ref: '#/components/parameters/asset' - - $ref: '#/components/parameters/isolatedSymbol' - - name: txId - in: query - description: the tranId in `POST /sapi/v1/margin/loan` - schema: - type: integer - format: int64 - example: 123456789 - - $ref: '#/components/parameters/startTime' - - $ref: '#/components/parameters/endTime' - - $ref: '#/components/parameters/current' - - $ref: '#/components/parameters/size' - - $ref: '#/components/parameters/archived' - - $ref: '#/components/parameters/recvWindow' - - $ref: '#/components/parameters/timestamp' - - $ref: '#/components/parameters/signature' + - $ref: '#/components/parameters/symbol' + security: + - ApiKeyAuth: [] + responses: + '200': + description: Margin pairs + content: + application/json: + schema: + type: array + items: + type: object + properties: + base: + type: string + example: "BNB" + id: + type: integer + format: int64 + example: 351637150141315861 + isBuyAllowed: + type: boolean + isMarginTrade: + type: boolean + isSellAllowed: + type: boolean + quote: + type: string + example: "BTC" + symbol: + type: string + example: "BNBBTC" + required: + - base + - id + - isBuyAllowed + - isMarginTrade + - isSellAllowed + - quote + - symbol + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/error' + /sapi/v1/margin/priceIndex: + get: + summary: Query Margin PriceIndex (MARKET_DATA) + description: 'Weight(IP): 10' + tags: + - Margin + parameters: + - $ref: '#/components/parameters/symbol' security: - ApiKeyAuth: [] responses: '200': - description: Loan records + description: Price index content: application/json: schema: type: object properties: - rows: - type: array - items: - type: object - properties: - isolatedSymbol: - type: string - txId: - type: integer - format: int64 - asset: - type: string - principal: - type: string - timestamp: - type: integer - format: int64 - status: - type: string - required: - - isolatedSymbol - - txId - - asset - - principal - - timestamp - - status - total: + calcTime: type: integer - format: int32 + format: int64 + example: 1562046418000 + price: + type: string + example: "0.00333930" + symbol: + type: string + example: "BNBBTC" required: - - rows - - total - example: - rows: - - - isolatedSymbol: "BNBUSDT" - txId: 12807067523 - asset: "BNB" - principal: "0.84624403" - timestamp: 1555056425000 - status: "CONFIRMED" - total: 1 + - calcTime + - price + - symbol '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/error' - '401': - description: Unauthorized Request - content: - application/json: - schema: - $ref: '#/components/schemas/error' - /sapi/v1/margin/repay: - post: - summary: Margin Account Repay (MARGIN) + /sapi/v1/margin/order: + get: + summary: Query Margin Account's Order (USER_DATA) description: |- - Repay loan for margin account. - - - If "isIsolated" = "TRUE", "symbol" must be sent - - "isIsolated" = "FALSE" for crossed margin repay + - Either `orderId` or `origClientOrderId` must be sent. + - For some historical orders `cummulativeQuoteQty` will be < 0, meaning the data is not available at this time. - Weight(IP): 3000 + Weight(IP): 10 tags: - Margin parameters: - - $ref: '#/components/parameters/asset' + - $ref: '#/components/parameters/symbol' - $ref: '#/components/parameters/isIsolatedMargin' - - $ref: '#/components/parameters/optionalSymbol' - - $ref: '#/components/parameters/amount' + - $ref: '#/components/parameters/orderId' + - $ref: '#/components/parameters/origClientOrderId' - $ref: '#/components/parameters/recvWindow' - $ref: '#/components/parameters/timestamp' - $ref: '#/components/parameters/signature' @@ -2791,11 +3113,11 @@ paths: - ApiKeyAuth: [] responses: '200': - description: Transaction id + description: Interest History, response in descending order content: application/json: schema: - $ref: '#/components/schemas/transaction' + $ref: "#/components/schemas/marginOrderDetail" '400': description: Bad Request content: @@ -2803,37 +3125,40 @@ paths: schema: $ref: '#/components/schemas/error' '401': - description: Unauthorized Request - content: - application/json: - schema: - $ref: '#/components/schemas/error' - get: - summary: Query Repay Record (USER_DATA) + description: Unauthorized Request + content: + application/json: + schema: + $ref: '#/components/schemas/error' + post: + summary: Margin Account New Order (TRADE) description: |- - - `txId` or `startTime` must be sent. `txId` takes precedence. - - Response in descending order - - If `isolatedSymbol` is not sent, crossed margin data will be returned - - Set `archived` to `true` to query data from 6 months ago + Post a new order for margin account. - Weight(IP): 10 + Weight(UID): 6 tags: - Margin parameters: - - $ref: '#/components/parameters/asset' - - $ref: '#/components/parameters/isolatedSymbol' - - name: txId + - $ref: '#/components/parameters/symbol' + - $ref: '#/components/parameters/isIsolatedMargin' + - $ref: '#/components/parameters/side' + - $ref: '#/components/parameters/orderType' + - $ref: '#/components/parameters/quantity' + - $ref: '#/components/parameters/quoteOrderQty' + - $ref: '#/components/parameters/optionalPrice' + - $ref: '#/components/parameters/stopPrice' + - $ref: '#/components/parameters/newClientOrderId' + - $ref: '#/components/parameters/icebergQty' + - $ref: '#/components/parameters/ocoNewOrderRespType' + - $ref: '#/components/parameters/sideEffectType' + - $ref: '#/components/parameters/timeInForce' + - name: autoRepayAtCancel in: query - description: the tranId in `POST /sapi/v1/margin/repay` + required: true schema: - type: integer - format: int64 - example: 2970933056 - - $ref: '#/components/parameters/startTime' - - $ref: '#/components/parameters/endTime' - - $ref: '#/components/parameters/current' - - $ref: '#/components/parameters/size' - - $ref: '#/components/parameters/archived' + type: boolean + example: true + - $ref: '#/components/parameters/selfTradePreventionMode' - $ref: '#/components/parameters/recvWindow' - $ref: '#/components/parameters/timestamp' - $ref: '#/components/parameters/signature' @@ -2841,57 +3166,138 @@ paths: - ApiKeyAuth: [] responses: '200': - description: Load records + description: Margin order info content: application/json: schema: - type: object - properties: - rows: - type: array - items: + oneOf: + - $ref: '#/components/schemas/marginOrderResponseAck' + - $ref: '#/components/schemas/marginOrderResponseResult' + - $ref: '#/components/schemas/marginOrderResponseFull' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/error' + '401': + description: Unauthorized Request + content: + application/json: + schema: + $ref: '#/components/schemas/error' + delete: + summary: Margin Account Cancel Order (TRADE) + description: |- + Cancel an active order for margin account. + + Either `orderId` or `origClientOrderId` must be sent. + + Weight(IP): 10 + tags: + - Margin + parameters: + - $ref: '#/components/parameters/symbol' + - $ref: '#/components/parameters/isIsolatedMargin' + - $ref: '#/components/parameters/orderId' + - $ref: '#/components/parameters/origClientOrderId' + - $ref: '#/components/parameters/newClientOrderId' + - $ref: '#/components/parameters/recvWindow' + - $ref: '#/components/parameters/timestamp' + - $ref: '#/components/parameters/signature' + security: + - ApiKeyAuth: [] + responses: + '200': + description: Cancelled margin order details + content: + application/json: + schema: + $ref: '#/components/schemas/marginOrder' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/error' + '401': + description: Unauthorized Request + content: + application/json: + schema: + $ref: '#/components/schemas/error' + /sapi/v1/margin/interestHistory: + get: + summary: Get Interest History (USER_DATA) + description: |- + - Response in descending order + - If `isolatedSymbol` is not sent, crossed margin data will be returned + - Set `archived` to `true` to query data from 6 months ago + - `type` in response has 4 enums: + - `PERIODIC` interest charged per hour + - `ON_BORROW` first interest charged on borrow + - `PERIODIC_CONVERTED` interest charged per hour converted into BNB + - `ON_BORROW_CONVERTED` first interest charged on borrow converted into BNB + + Weight(IP): 1 + tags: + - Margin + parameters: + - $ref: '#/components/parameters/optionalAsset' + - $ref: '#/components/parameters/isolatedSymbol' + - $ref: '#/components/parameters/startTime' + - $ref: '#/components/parameters/endTime' + - $ref: '#/components/parameters/current' + - $ref: '#/components/parameters/size' + - $ref: '#/components/parameters/archived' + - $ref: '#/components/parameters/recvWindow' + - $ref: '#/components/parameters/timestamp' + - $ref: '#/components/parameters/signature' + security: + - ApiKeyAuth: [] + responses: + '200': + description: Interest History, response in descending order + content: + application/json: + schema: + type: object + properties: + rows: + type: array + items: type: object properties: isolatedSymbol: type: string example: "BNBUSDT" - description: Isolated symbol, will not be returned for crossed margin - amount: - type: string - example: "14.00000000" - description: Total amount repaid asset: type: string example: "BNB" interest: type: string example: "0.01866667" - description: Interest repaid + interestAccuredTime: + type: integer + format: int64 + example: 1566813600 + interestRate: + type: string + example: "0.01600000" principal: type: string - example: "13.98133333" - description: Principal repaid - status: + example: "36.22000000" + type: type: string - example: "CONFIRMED" - description: One of PENDING (pending execution), CONFIRMED (successfully execution), FAILED (execution failed, nothing happened to your account) - timestamp: - type: integer - format: int64 - example: 1563438204000 - txId: - type: integer - format: int64 - example: 2970933056 + example: "ON_BORROW" required: - isolatedSymbol - - amount - asset - interest + - interestAccuredTime + - interestRate - principal - - status - - timestamp - - txId + - type total: type: integer format: int32 @@ -2906,261 +3312,298 @@ paths: schema: $ref: '#/components/schemas/error' '401': - description: Unauthorized Request - content: - application/json: - schema: - $ref: '#/components/schemas/error' - /sapi/v1/margin/asset: + description: Unauthorized Request + content: + application/json: + schema: + $ref: '#/components/schemas/error' + /sapi/v1/margin/forceLiquidationRec: get: - summary: Query Margin Asset (MARKET_DATA) - description: 'Weight(IP): 10' + summary: Get Force Liquidation Record (USER_DATA) + description: |- + - Response in descending order + + Weight(IP): 1 tags: - Margin parameters: - - $ref: '#/components/parameters/asset' + - $ref: '#/components/parameters/startTime' + - $ref: '#/components/parameters/endTime' + - $ref: '#/components/parameters/isolatedSymbol' + - $ref: '#/components/parameters/current' + - $ref: '#/components/parameters/size' + - $ref: '#/components/parameters/recvWindow' + - $ref: '#/components/parameters/timestamp' + - $ref: '#/components/parameters/signature' security: - ApiKeyAuth: [] responses: '200': - description: Asset details + description: Force Liquidation History, response in descending order content: application/json: schema: type: object properties: - assetFullName: - type: string - example: "Binance Coin" - assetName: - type: string - example: "BNB" - isBorrowable: - type: boolean - example: false - isMortgageable: - type: boolean - userMinBorrow: - type: string - example: "0.00000000" - userMinRepay: - type: string - example: "0.00000000" + rows: + type: array + items: + type: object + properties: + avgPrice: + type: string + executedQty: + type: string + orderId: + type: integer + format: int64 + price: + type: string + qty: + type: string + side: + type: string + symbol: + type: string + timeInForce: + type: string + isIsolated: + type: boolean + updatedTime: + type: integer + format: int64 + required: + - avgPrice + - executedQty + - orderId + - price + - qty + - side + - symbol + - timeInForce + - isIsolated + - updatedTime + total: + type: integer + format: int32 + example: 1 required: - - assetFullName - - assetName - - isBorrowable - - isMortgageable - - userMinBorrow - - userMinRepay + - rows + - total + example: + rows: + - + avgPrice: "0.00388359" + executedQty: "31.39000000" + orderId: 180015097 + price: "0.00388110" + qty: "31.39000000" + side: "SELL" + symbol: "BNBBTC" + timeInForce: "GTC" + isIsolated: true + updatedTime: 1558941374745 + total: 1 '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/margin/pair: + '401': + description: Unauthorized Request + content: + application/json: + schema: + $ref: '#/components/schemas/error' + /sapi/v1/margin/account: get: - summary: Query Cross Margin Pair (MARKET_DATA) + summary: Query Cross Margin Account Details (USER_DATA) description: 'Weight(IP): 10' tags: - Margin parameters: - - $ref: '#/components/parameters/symbol' + - $ref: '#/components/parameters/recvWindow' + - $ref: '#/components/parameters/timestamp' + - $ref: '#/components/parameters/signature' security: - ApiKeyAuth: [] responses: '200': - description: Margin pair details + description: Margin account details content: application/json: schema: type: object properties: - id: - type: integer - format: int64 - example: 323355778339572400 - symbol: + borrowEnabled: + type: boolean + marginLevel: type: string - example: "BNBUSDT" - base: + example: "11.64405625" + totalAssetOfBtc: type: string - example: "BTC" - quote: + example: "6.82728457" + totalLiabilityOfBtc: type: string - example: "USDT" - isMarginTrade: - type: boolean - isBuyAllowed: + example: "0.58633215" + totalNetAssetOfBtc: + type: string + example: "6.24095242" + tradeEnabled: type: boolean - isSellAllowed: + transferEnabled: type: boolean - required: - - id - - symbol - - base - - quote - - isMarginTrade - - isBuyAllowed - - isSellAllowed + userAssets: + type: array + items: + type: object + properties: + asset: + type: string + example: "BTC" + borrowed: + type: string + example: "0.00000000" + free: + type: string + example: "0.00499500" + interest: + type: string + example: "0.00000000" + locked: + type: string + example: "0.00000000" + netAsset: + type: string + example: "0.00499500" + required: + - asset + - borrowed + - free + - interest + - locked + - netAsset + required: + - borrowEnabled + - marginLevel + - totalAssetOfBtc + - totalLiabilityOfBtc + - totalNetAssetOfBtc + - tradeEnabled + - transferEnabled + - userAssets '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/margin/allAssets: - get: - summary: Get All Margin Assets (MARKET_DATA) - description: 'Weight(IP): 1' - tags: - - Margin - security: - - ApiKeyAuth: [] - responses: - '200': - description: Assets details - content: - application/json: - schema: - type: array - items: - type: object - properties: - assetFullName: - type: string - example: "Binance coin" - assetName: - type: string - example: "BNB" - isBorrowable: - type: boolean - isMortgageable: - type: boolean - userMinBorrow: - type: string - example: "0.00000000" - userMinRepay: - type: string - example: "0.00000000" - required: - - assetFullName - - assetName - - isBorrowable - - isMortgageable - - userMinBorrow - - userMinRepay - '400': - description: Bad Request + '401': + description: Unauthorized Request content: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/margin/allPairs: + /sapi/v1/margin/openOrders: get: - summary: Get All Cross Margin Pairs (MARKET_DATA) - description: 'Weight(IP): 1' + summary: Query Margin Account's Open Orders (USER_DATA) + description: |- + - If the `symbol` is not sent, orders for all symbols will be returned in an array. + - When all symbols are returned, the number of requests counted against the rate limiter is equal to the number of symbols currently trading on the exchange + - If isIsolated ="TRUE", symbol must be sent. + + Weight(IP): 10 tags: - Margin + parameters: + - $ref: '#/components/parameters/optionalSymbol' + - $ref: '#/components/parameters/isIsolatedMargin' + - $ref: '#/components/parameters/recvWindow' + - $ref: '#/components/parameters/timestamp' + - $ref: '#/components/parameters/signature' security: - ApiKeyAuth: [] responses: '200': - description: Margin pairs + description: Margin open orders list content: application/json: schema: type: array items: - type: object - properties: - base: - type: string - example: "BNB" - id: - type: integer - format: int64 - example: 351637150141315861 - isBuyAllowed: - type: boolean - isMarginTrade: - type: boolean - isSellAllowed: - type: boolean - quote: - type: string - example: "BTC" - symbol: - type: string - example: "BNBBTC" - required: - - base - - id - - isBuyAllowed - - isMarginTrade - - isSellAllowed - - quote - - symbol + $ref: '#/components/schemas/marginOrderDetail' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/margin/priceIndex: - get: - summary: Query Margin PriceIndex (MARKET_DATA) - description: 'Weight(IP): 10' + '401': + description: Unauthorized Request + content: + application/json: + schema: + $ref: '#/components/schemas/error' + delete: + summary: Margin Account Cancel all Open Orders on a Symbol (TRADE) + description: | + - Cancels all active orders on a symbol for margin account. + - This includes OCO orders. + + Weight(IP): 1 tags: - Margin parameters: - $ref: '#/components/parameters/symbol' + - $ref: "#/components/parameters/isIsolatedMargin" + - $ref: '#/components/parameters/recvWindow' + - $ref: '#/components/parameters/timestamp' + - $ref: '#/components/parameters/signature' security: - ApiKeyAuth: [] responses: '200': - description: Price index + description: Cancelled margin orders content: application/json: schema: - type: object - properties: - calcTime: - type: integer - format: int64 - example: 1562046418000 - price: - type: string - example: "0.00333930" - symbol: - type: string - example: "BNBBTC" - required: - - calcTime - - price - - symbol + type: array + items: + anyOf: + - $ref: '#/components/schemas/canceledMarginOrderDetail' + - $ref: '#/components/schemas/marginOcoOrder' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/margin/order: + '401': + description: Unauthorized Request + content: + application/json: + schema: + $ref: '#/components/schemas/error' + /sapi/v1/margin/allOrders: get: - summary: Query Margin Account's Order (USER_DATA) + summary: Query Margin Account's All Orders (USER_DATA) description: |- - - Either `orderId` or `origClientOrderId` must be sent. + - If `orderId` is set, it will get orders >= that orderId. Otherwise most recent orders are returned. - For some historical orders `cummulativeQuoteQty` will be < 0, meaning the data is not available at this time. - Weight(IP): 10 + Weight(IP): 200 + + Request Limit: 60 times/min per IP tags: - Margin parameters: - $ref: '#/components/parameters/symbol' - $ref: '#/components/parameters/isIsolatedMargin' - $ref: '#/components/parameters/orderId' - - $ref: '#/components/parameters/origClientOrderId' + - $ref: '#/components/parameters/startTime' + - $ref: '#/components/parameters/endTime' + - $ref: '#/components/parameters/limit' - $ref: '#/components/parameters/recvWindow' - $ref: '#/components/parameters/timestamp' - $ref: '#/components/parameters/signature' @@ -3168,11 +3611,13 @@ paths: - ApiKeyAuth: [] responses: '200': - description: Interest History, response in descending order + description: Margin order list content: application/json: schema: - $ref: "#/components/schemas/marginOrderDetail" + type: array + items: + $ref: '#/components/schemas/marginOrderDetail' '400': description: Bad Request content: @@ -3185,10 +3630,20 @@ paths: application/json: schema: $ref: '#/components/schemas/error' + /sapi/v1/margin/order/oco: post: - summary: Margin Account New Order (TRADE) + summary: Margin Account New OCO (TRADE) description: |- - Post a new order for margin account. + Send in a new OCO for a margin account + + - Price Restrictions: + - SELL: Limit Price > Last Price > Stop Price + - BUY: Limit Price < Last Price < Stop Price + - Quantity Restrictions: + - Both legs must have the same quantity + - ICEBERG quantities however do not have to be the same. + - Order Rate Limit + - OCO counts as 2 orders against the order rate limit. Weight(UID): 6 tags: @@ -3196,23 +3651,19 @@ paths: parameters: - $ref: '#/components/parameters/symbol' - $ref: '#/components/parameters/isIsolatedMargin' + - $ref: '#/components/parameters/listClientOrderId' - $ref: '#/components/parameters/side' - - $ref: '#/components/parameters/orderType' - $ref: '#/components/parameters/quantity' - - $ref: '#/components/parameters/quoteOrderQty' - - $ref: '#/components/parameters/optionalPrice' - - $ref: '#/components/parameters/stopPrice' - - $ref: '#/components/parameters/newClientOrderId' - - $ref: '#/components/parameters/icebergQty' + - $ref: '#/components/parameters/limitClientOrderId' + - $ref: '#/components/parameters/price' + - $ref: '#/components/parameters/limitIcebergQty' + - $ref: '#/components/parameters/stopClientOrderId' + - $ref: '#/components/parameters/ocoStopPrice' + - $ref: '#/components/parameters/stopLimitPrice' + - $ref: '#/components/parameters/stopIcebergQty' + - $ref: '#/components/parameters/stopLimitTimeInForce' - $ref: '#/components/parameters/ocoNewOrderRespType' - $ref: '#/components/parameters/sideEffectType' - - $ref: '#/components/parameters/timeInForce' - - name: autoRepayAtCancel - in: query - required: true - schema: - type: boolean - example: true - $ref: '#/components/parameters/selfTradePreventionMode' - $ref: '#/components/parameters/recvWindow' - $ref: '#/components/parameters/timestamp' @@ -3221,54 +3672,161 @@ paths: - ApiKeyAuth: [] responses: '200': - description: Margin order info - content: - application/json: - schema: - oneOf: - - $ref: '#/components/schemas/marginOrderResponseAck' - - $ref: '#/components/schemas/marginOrderResponseResult' - - $ref: '#/components/schemas/marginOrderResponseFull' - '400': - description: Bad Request + description: New Margin OCO details content: application/json: schema: - $ref: '#/components/schemas/error' - '401': - description: Unauthorized Request - content: - application/json: - schema: - $ref: '#/components/schemas/error' - delete: - summary: Margin Account Cancel Order (TRADE) - description: |- - Cancel an active order for margin account. - - Either `orderId` or `origClientOrderId` must be sent. - - Weight(IP): 10 - tags: - - Margin - parameters: - - $ref: '#/components/parameters/symbol' - - $ref: '#/components/parameters/isIsolatedMargin' - - $ref: '#/components/parameters/orderId' - - $ref: '#/components/parameters/origClientOrderId' - - $ref: '#/components/parameters/newClientOrderId' - - $ref: '#/components/parameters/recvWindow' - - $ref: '#/components/parameters/timestamp' - - $ref: '#/components/parameters/signature' - security: - - ApiKeyAuth: [] - responses: - '200': - description: Cancelled margin order details - content: - application/json: - schema: - $ref: '#/components/schemas/marginOrder' + type: object + properties: + orderListId: + type: integer + format: int64 + example: 0 + contingencyType: + type: string + example: "OCO" + listStatusType: + type: string + example: "EXEC_STARTED" + listOrderStatus: + type: string + example: "EXECUTING" + listClientOrderId: + type: string + example: "JYVpp3F0f5CAG15DhtrqLp" + transactionTime: + type: integer + format: int64 + example: 1563417480525 + symbol: + type: string + example: "LTCBTC" + marginBuyBorrowAmount: + type: string + example: "5" + description: will not return if no margin trade happens + marginBuyBorrowAsset: + type: string + example: "BTC" + description: will not return if no margin trade happens + isIsolated: + type: boolean + example: false + orders: + type: array + items: + type: object + properties: + symbol: + type: string + orderId: + type: integer + format: int64 + clientOrderId: + type: string + required: + - symbol + - orderId + - clientOrderId + example: + - symbol: "LTCBTC" + orderId: 2 + clientOrderId: "Kk7sqHb9J6mJWTMDVW7Vos" + - symbol: "LTCBTC" + orderId: 3 + clientOrderId: "xTXKaGYd4bluPVp78IVRvl" + orderReports: + type: array + items: + type: object + properties: + symbol: + type: string + orderId: + type: integer + format: int64 + orderListId: + type: integer + format: int64 + clientOrderId: + type: string + transactTime: + type: integer + format: int64 + price: + type: string + origQty: + type: string + executedQty: + type: string + cummulativeQuoteQty: + type: string + status: + type: string + timeInForce: + type: string + type: + type: string + side: + type: string + stopPrice: + type: string + required: + - symbol + - orderId + - orderListId + - clientOrderId + - transactTime + - price + - origQty + - executedQty + - cummulativeQuoteQty + - status + - timeInForce + - type + - side + - stopPrice + example: + - symbol: "LTCBTC" + orderId: 2 + orderListId: 0 + clientOrderId: "Kk7sqHb9J6mJWTMDVW7Vos" + transactTime: 1563417480525 + price: "0.000000" + origQty: "0.624363" + executedQty: "0.000000" + cummulativeQuoteQty: "0.000000" + status: "NEW" + timeInForce: "GTC" + type: "STOP_LOSS" + side: "BUY" + stopPrice: "0.960664" + - symbol: "LTCBTC" + orderId: 3 + orderListId: 0 + clientOrderId: "xTXKaGYd4bluPVp78IVRvl" + transactTime: 1563417480525 + price: "0.036435" + origQty: "0.624363" + executedQty: "0.000000" + cummulativeQuoteQty: "0.000000" + status: "NEW" + timeInForce: "GTC" + type: "LIMIT_MAKER" + side: "BUY" + required: + - orderListId + - contingencyType + - listStatusType + - listOrderStatus + - listClientOrderId + - transactionTime + - symbol + - marginBuyBorrowAmount + - marginBuyBorrowAsset + - isIsolated + - orders + - orderReports '400': description: Bad Request content: @@ -3281,30 +3839,26 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/margin/interestHistory: + /sapi/v1/margin/orderList: get: - summary: Get Interest History (USER_DATA) + summary: Query Margin Account's OCO (USER_DATA) description: |- - - Response in descending order - - If `isolatedSymbol` is not sent, crossed margin data will be returned - - Set `archived` to `true` to query data from 6 months ago - - `type` in response has 4 enums: - - `PERIODIC` interest charged per hour - - `ON_BORROW` first interest charged on borrow - - `PERIODIC_CONVERTED` interest charged per hour converted into BNB - - `ON_BORROW_CONVERTED` first interest charged on borrow converted into BNB + Retrieves a specific OCO based on provided optional parameters - Weight(IP): 1 + - Either `orderListId` or `origClientOrderId` must be provided + + Weight(IP): 10 tags: - Margin parameters: - - $ref: '#/components/parameters/optionalAsset' - - $ref: '#/components/parameters/isolatedSymbol' - - $ref: '#/components/parameters/startTime' - - $ref: '#/components/parameters/endTime' - - $ref: '#/components/parameters/current' - - $ref: '#/components/parameters/size' - - $ref: '#/components/parameters/archived' + - $ref: '#/components/parameters/isIsolatedMargin' + - name: symbol + in: query + description: 'Mandatory for isolated margin, not supported for cross margin' + schema: + type: string + - $ref: '#/components/parameters/orderListId' + - $ref: '#/components/parameters/origClientOrderId' - $ref: '#/components/parameters/recvWindow' - $ref: '#/components/parameters/timestamp' - $ref: '#/components/parameters/signature' @@ -3312,54 +3866,71 @@ paths: - ApiKeyAuth: [] responses: '200': - description: Interest History, response in descending order + description: Margin OCO details content: application/json: schema: type: object properties: - rows: + orderListId: + type: integer + format: int64 + example: 27 + contingencyType: + type: string + example: "OCO" + listStatusType: + type: string + example: "EXEC_STARTED" + listOrderStatus: + type: string + example: "EXECUTING" + listClientOrderId: + type: string + example: "h2USkA5YQpaXHPIrkd96xE" + transactionTime: + type: integer + format: int64 + example: 1565245656253 + symbol: + type: string + example: "LTCBTC" + isIsolated: + type: boolean + example: false + orders: type: array items: type: object properties: - isolatedSymbol: - type: string - example: "BNBUSDT" - asset: - type: string - example: "BNB" - interest: + symbol: type: string - example: "0.01866667" - interestAccuredTime: + orderId: type: integer format: int64 - example: 1566813600 - interestRate: - type: string - example: "0.01600000" - principal: - type: string - example: "36.22000000" - type: + clientOrderId: type: string - example: "ON_BORROW" + example: + - symbol: "LTCBTC" + orderId: 4 + clientOrderId: "qD1gy3kc3Gx0rihm9Y3xwS" + - symbol: "LTCBTC" + orderId: 5 + clientOrderId: "ARzZ9I00CPM8i3NhmU9Ega" required: - - isolatedSymbol - - asset - - interest - - interestAccuredTime - - interestRate - - principal - - type - total: - type: integer - format: int32 - example: 1 + - symbol + - orderId + - clientOrderId required: - - rows - - total + - orderListId + - contingencyType + - listStatusType + - listOrderStatus + - listClientOrderId + - transactionTime + - symbol + - isIsolated + - orders '400': description: Bad Request content: @@ -3372,112 +3943,23 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/margin/forceLiquidationRec: - get: - summary: Get Force Liquidation Record (USER_DATA) + delete: + summary: Margin Account Cancel OCO (TRADE) description: |- - - Response in descending order + Cancel an entire Order List for a margin account - Weight(IP): 1 - tags: - - Margin - parameters: - - $ref: '#/components/parameters/startTime' - - $ref: '#/components/parameters/endTime' - - $ref: '#/components/parameters/isolatedSymbol' - - $ref: '#/components/parameters/current' - - $ref: '#/components/parameters/size' - - $ref: '#/components/parameters/recvWindow' - - $ref: '#/components/parameters/timestamp' - - $ref: '#/components/parameters/signature' - security: - - ApiKeyAuth: [] - responses: - '200': - description: Force Liquidation History, response in descending order - content: - application/json: - schema: - type: object - properties: - rows: - type: array - items: - type: object - properties: - avgPrice: - type: string - executedQty: - type: string - orderId: - type: integer - format: int64 - price: - type: string - qty: - type: string - side: - type: string - symbol: - type: string - timeInForce: - type: string - isIsolated: - type: boolean - updatedTime: - type: integer - format: int64 - required: - - avgPrice - - executedQty - - orderId - - price - - qty - - side - - symbol - - timeInForce - - isIsolated - - updatedTime - total: - type: integer - format: int32 - example: 1 - required: - - rows - - total - example: - rows: - - - avgPrice: "0.00388359" - executedQty: "31.39000000" - orderId: 180015097 - price: "0.00388110" - qty: "31.39000000" - side: "SELL" - symbol: "BNBBTC" - timeInForce: "GTC" - isIsolated: true - updatedTime: 1558941374745 - total: 1 - '400': - description: Bad Request - content: - application/json: - schema: - $ref: '#/components/schemas/error' - '401': - description: Unauthorized Request - content: - application/json: - schema: - $ref: '#/components/schemas/error' - /sapi/v1/margin/account: - get: - summary: Query Cross Margin Account Details (USER_DATA) - description: 'Weight(IP): 10' + - Canceling an individual leg will cancel the entire OCO + - Either `orderListId` or `listClientOrderId` must be provided + + Weight(UID): 1 tags: - Margin parameters: + - $ref: '#/components/parameters/symbol' + - $ref: '#/components/parameters/isIsolatedMargin' + - $ref: '#/components/parameters/orderListId' + - $ref: '#/components/parameters/listClientOrderId' + - $ref: '#/components/parameters/newClientOrderId' - $ref: '#/components/parameters/recvWindow' - $ref: '#/components/parameters/timestamp' - $ref: '#/components/parameters/signature' @@ -3485,69 +3967,11 @@ paths: - ApiKeyAuth: [] responses: '200': - description: Margin account details + description: Margin OCO details content: application/json: schema: - type: object - properties: - borrowEnabled: - type: boolean - marginLevel: - type: string - example: "11.64405625" - totalAssetOfBtc: - type: string - example: "6.82728457" - totalLiabilityOfBtc: - type: string - example: "0.58633215" - totalNetAssetOfBtc: - type: string - example: "6.24095242" - tradeEnabled: - type: boolean - transferEnabled: - type: boolean - userAssets: - type: array - items: - type: object - properties: - asset: - type: string - example: "BTC" - borrowed: - type: string - example: "0.00000000" - free: - type: string - example: "0.00499500" - interest: - type: string - example: "0.00000000" - locked: - type: string - example: "0.00000000" - netAsset: - type: string - example: "0.00499500" - required: - - asset - - borrowed - - free - - interest - - locked - - netAsset - required: - - borrowEnabled - - marginLevel - - totalAssetOfBtc - - totalLiabilityOfBtc - - totalNetAssetOfBtc - - tradeEnabled - - transferEnabled - - userAssets + $ref: '#/components/schemas/marginOcoOrder' '400': description: Bad Request content: @@ -3560,20 +3984,35 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/margin/openOrders: + /sapi/v1/margin/allOrderList: get: - summary: Query Margin Account's Open Orders (USER_DATA) + summary: Query Margin Account's all OCO (USER_DATA) description: |- - - If the `symbol` is not sent, orders for all symbols will be returned in an array. - - When all symbols are returned, the number of requests counted against the rate limiter is equal to the number of symbols currently trading on the exchange - - If isIsolated ="TRUE", symbol must be sent. + Retrieves all OCO for a specific margin account based on provided optional parameters - Weight(IP): 10 + Weight(IP): 200 tags: - Margin parameters: - - $ref: '#/components/parameters/optionalSymbol' - $ref: '#/components/parameters/isIsolatedMargin' + - name: symbol + in: query + description: 'Mandatory for isolated margin, not supported for cross margin' + schema: + type: string + - name: fromId + in: query + description: 'If supplied, neither `startTime` or `endTime` can be provided' + schema: + type: string + - $ref: '#/components/parameters/startTime' + - $ref: '#/components/parameters/endTime' + - name: limit + in: query + description: 'Default Value: 500; Max Value: 1000' + schema: + type: integer + format: int32 - $ref: '#/components/parameters/recvWindow' - $ref: '#/components/parameters/timestamp' - $ref: '#/components/parameters/signature' @@ -3581,37 +4020,97 @@ paths: - ApiKeyAuth: [] responses: '200': - description: Margin open orders list + description: List of Margin OCO orders content: application/json: schema: type: array items: - $ref: '#/components/schemas/marginOrderDetail' - '400': - description: Bad Request - content: - application/json: - schema: - $ref: '#/components/schemas/error' - '401': - description: Unauthorized Request - content: + type: object + properties: + orderListId: + type: integer + format: int64 + example: 29 + contingencyType: + type: string + example: "OCO" + listStatusType: + type: string + example: "EXEC_STARTED" + listOrderStatus: + type: string + example: "EXECUTING" + listClientOrderId: + type: string + example: "amEEAXryFzFwYF1FeRpUoZ" + transactionTime: + type: integer + format: int64 + example: 1565245913483 + symbol: + type: string + example: "LTCBTC" + isIsolated: + type: boolean + orders: + type: array + items: + type: object + properties: + symbol: + type: string + orderId: + type: integer + format: int64 + clientOrderId: + type: string + required: + - symbol + - orderId + - clientOrderId + example: + - symbol: "LTCBTC" + orderId: 4 + clientOrderId: "oD7aesZqjEGlZrbtRpy5zB" + - symbol: "LTCBTC" + orderId: 5 + clientOrderId: "Jr1h6xirOxgeJOUuYQS7V3" + required: + - orderListId + - contingencyType + - listStatusType + - listOrderStatus + - listClientOrderId + - transactionTime + - symbol + - isIsolated + - orders + '400': + description: Bad Request + content: application/json: schema: $ref: '#/components/schemas/error' - delete: - summary: Margin Account Cancel all Open Orders on a Symbol (TRADE) - description: | - - Cancels all active orders on a symbol for margin account. - - This includes OCO orders. - - Weight(IP): 1 + '401': + description: Unauthorized Request + content: + application/json: + schema: + $ref: '#/components/schemas/error' + /sapi/v1/margin/openOrderList: + get: + summary: Query Margin Account's Open OCO (USER_DATA) + description: 'Weight(IP): 10' tags: - Margin parameters: - - $ref: '#/components/parameters/symbol' - - $ref: "#/components/parameters/isIsolatedMargin" + - $ref: '#/components/parameters/isIsolatedMargin' + - name: symbol + in: query + description: 'Mandatory for isolated margin, not supported for cross margin' + schema: + type: string - $ref: '#/components/parameters/recvWindow' - $ref: '#/components/parameters/timestamp' - $ref: '#/components/parameters/signature' @@ -3619,15 +4118,73 @@ paths: - ApiKeyAuth: [] responses: '200': - description: Cancelled margin orders + description: List of Open Margin OCO orders content: application/json: schema: type: array items: - anyOf: - - $ref: '#/components/schemas/canceledMarginOrderDetail' - - $ref: '#/components/schemas/marginOcoOrder' + type: object + properties: + orderListId: + type: integer + format: int64 + example: 31 + contingencyType: + type: string + example: "OCO" + listStatusType: + type: string + example: "EXEC_STARTED" + listOrderStatus: + type: string + example: "EXECUTING" + listClientOrderId: + type: string + example: "wuB13fmulKj3YjdqWEcsnp" + transactionTime: + type: integer + format: int64 + example: 1565246080644 + symbol: + type: string + example: "LTCBTC" + isIsolated: + type: boolean + example: false + orders: + type: array + items: + type: object + properties: + symbol: + type: string + orderId: + type: integer + format: int64 + clientOrderId: + type: string + required: + - symbol + - orderId + - clientOrderId + example: + - symbol: "LTCBTC" + orderId: 4 + clientOrderId: "r3EH2N76dHfLoSZWIUw1bT" + - symbol: "LTCBTC" + orderId: 5 + clientOrderId: "Cv1SnyPD3qhqpbjpYEHbd2" + required: + - orderListId + - contingencyType + - listStatusType + - listOrderStatus + - listClientOrderId + - transactionTime + - symbol + - isIsolated + - orders '400': description: Bad Request content: @@ -3640,24 +4197,22 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/margin/allOrders: + /sapi/v1/margin/myTrades: get: - summary: Query Margin Account's All Orders (USER_DATA) + summary: Query Margin Account's Trade List (USER_DATA) description: |- - - If `orderId` is set, it will get orders >= that orderId. Otherwise most recent orders are returned. - - For some historical orders `cummulativeQuoteQty` will be < 0, meaning the data is not available at this time. + - If `fromId` is set, it will get orders >= that `fromId`. Otherwise most recent trades are returned. - Weight(IP): 200 + Weight(IP): 10 - Request Limit: 60 times/min per IP tags: - Margin parameters: - $ref: '#/components/parameters/symbol' - $ref: '#/components/parameters/isIsolatedMargin' - - $ref: '#/components/parameters/orderId' - $ref: '#/components/parameters/startTime' - $ref: '#/components/parameters/endTime' + - $ref: '#/components/parameters/fromId' - $ref: '#/components/parameters/limit' - $ref: '#/components/parameters/recvWindow' - $ref: '#/components/parameters/timestamp' @@ -3666,13 +4221,13 @@ paths: - ApiKeyAuth: [] responses: '200': - description: Margin order list + description: List of margin trades content: application/json: schema: type: array items: - $ref: '#/components/schemas/marginOrderDetail' + $ref: '#/components/schemas/marginTrade' '400': description: Bad Request content: @@ -3685,41 +4240,19 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/margin/order/oco: - post: - summary: Margin Account New OCO (TRADE) + /sapi/v1/margin/maxBorrowable: + get: + summary: Query Max Borrow (USER_DATA) description: |- - Send in a new OCO for a margin account - - - Price Restrictions: - - SELL: Limit Price > Last Price > Stop Price - - BUY: Limit Price < Last Price < Stop Price - - Quantity Restrictions: - - Both legs must have the same quantity - - ICEBERG quantities however do not have to be the same. - - Order Rate Limit - - OCO counts as 2 orders against the order rate limit. + - If `isolatedSymbol` is not sent, crossed margin data will be sent. + - `borrowLimit` is also available from https://www.binance.com/en/margin-fee - Weight(UID): 6 + Weight(IP): 50 tags: - Margin parameters: - - $ref: '#/components/parameters/symbol' - - $ref: '#/components/parameters/isIsolatedMargin' - - $ref: '#/components/parameters/listClientOrderId' - - $ref: '#/components/parameters/side' - - $ref: '#/components/parameters/quantity' - - $ref: '#/components/parameters/limitClientOrderId' - - $ref: '#/components/parameters/price' - - $ref: '#/components/parameters/limitIcebergQty' - - $ref: '#/components/parameters/stopClientOrderId' - - $ref: '#/components/parameters/ocoStopPrice' - - $ref: '#/components/parameters/stopLimitPrice' - - $ref: '#/components/parameters/stopIcebergQty' - - $ref: '#/components/parameters/stopLimitTimeInForce' - - $ref: '#/components/parameters/ocoNewOrderRespType' - - $ref: '#/components/parameters/sideEffectType' - - $ref: '#/components/parameters/selfTradePreventionMode' + - $ref: '#/components/parameters/asset' + - $ref: '#/components/parameters/isolatedSymbol' - $ref: '#/components/parameters/recvWindow' - $ref: '#/components/parameters/timestamp' - $ref: '#/components/parameters/signature' @@ -3727,161 +4260,23 @@ paths: - ApiKeyAuth: [] responses: '200': - description: New Margin OCO details + description: Details on max borrow amount content: application/json: schema: type: object properties: - orderListId: - type: integer - format: int64 - example: 0 - contingencyType: - type: string - example: "OCO" - listStatusType: - type: string - example: "EXEC_STARTED" - listOrderStatus: - type: string - example: "EXECUTING" - listClientOrderId: - type: string - example: "JYVpp3F0f5CAG15DhtrqLp" - transactionTime: - type: integer - format: int64 - example: 1563417480525 - symbol: - type: string - example: "LTCBTC" - marginBuyBorrowAmount: + amount: type: string - example: "5" - description: will not return if no margin trade happens - marginBuyBorrowAsset: + example: "1.69248805" + description: account's currently max borrowable amount with sufficient system availability + borrowLimit: type: string - example: "BTC" - description: will not return if no margin trade happens - isIsolated: - type: boolean - example: false - orders: - type: array - items: - type: object - properties: - symbol: - type: string - orderId: - type: integer - format: int64 - clientOrderId: - type: string - required: - - symbol - - orderId - - clientOrderId - example: - - symbol: "LTCBTC" - orderId: 2 - clientOrderId: "Kk7sqHb9J6mJWTMDVW7Vos" - - symbol: "LTCBTC" - orderId: 3 - clientOrderId: "xTXKaGYd4bluPVp78IVRvl" - orderReports: - type: array - items: - type: object - properties: - symbol: - type: string - orderId: - type: integer - format: int64 - orderListId: - type: integer - format: int64 - clientOrderId: - type: string - transactTime: - type: integer - format: int64 - price: - type: string - origQty: - type: string - executedQty: - type: string - cummulativeQuoteQty: - type: string - status: - type: string - timeInForce: - type: string - type: - type: string - side: - type: string - stopPrice: - type: string - required: - - symbol - - orderId - - orderListId - - clientOrderId - - transactTime - - price - - origQty - - executedQty - - cummulativeQuoteQty - - status - - timeInForce - - type - - side - - stopPrice - example: - - symbol: "LTCBTC" - orderId: 2 - orderListId: 0 - clientOrderId: "Kk7sqHb9J6mJWTMDVW7Vos" - transactTime: 1563417480525 - price: "0.000000" - origQty: "0.624363" - executedQty: "0.000000" - cummulativeQuoteQty: "0.000000" - status: "NEW" - timeInForce: "GTC" - type: "STOP_LOSS" - side: "BUY" - stopPrice: "0.960664" - - symbol: "LTCBTC" - orderId: 3 - orderListId: 0 - clientOrderId: "xTXKaGYd4bluPVp78IVRvl" - transactTime: 1563417480525 - price: "0.036435" - origQty: "0.624363" - executedQty: "0.000000" - cummulativeQuoteQty: "0.000000" - status: "NEW" - timeInForce: "GTC" - type: "LIMIT_MAKER" - side: "BUY" + example: "60" + description: max borrowable amount limited by the account level required: - - orderListId - - contingencyType - - listStatusType - - listOrderStatus - - listClientOrderId - - transactionTime - - symbol - - marginBuyBorrowAmount - - marginBuyBorrowAsset - - isIsolated - - orders - - orderReports + - amount + - borrowLimit '400': description: Bad Request content: @@ -3894,26 +4289,18 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/margin/orderList: + /sapi/v1/margin/maxTransferable: get: - summary: Query Margin Account's OCO (USER_DATA) + summary: Query Max Transfer-Out Amount (USER_DATA) description: |- - Retrieves a specific OCO based on provided optional parameters - - - Either `orderListId` or `origClientOrderId` must be provided + - If `isolatedSymbol` is not sent, crossed margin data will be sent. - Weight(IP): 10 + Weight(IP): 50 tags: - Margin parameters: - - $ref: '#/components/parameters/isIsolatedMargin' - - name: symbol - in: query - description: 'Mandatory for isolated margin, not supported for cross margin' - schema: - type: string - - $ref: '#/components/parameters/orderListId' - - $ref: '#/components/parameters/origClientOrderId' + - $ref: '#/components/parameters/asset' + - $ref: '#/components/parameters/isolatedSymbol' - $ref: '#/components/parameters/recvWindow' - $ref: '#/components/parameters/timestamp' - $ref: '#/components/parameters/signature' @@ -3921,71 +4308,24 @@ paths: - ApiKeyAuth: [] responses: '200': - description: Margin OCO details + description: Details on max transferable amount content: application/json: schema: type: object properties: - orderListId: - type: integer - format: int64 - example: 27 - contingencyType: - type: string - example: "OCO" - listStatusType: - type: string - example: "EXEC_STARTED" - listOrderStatus: - type: string - example: "EXECUTING" - listClientOrderId: + amount: type: string - example: "h2USkA5YQpaXHPIrkd96xE" - transactionTime: - type: integer - format: int64 - example: 1565245656253 - symbol: + description: "Account's currently max borrowable amount with sufficient system availability" + borrowLimit: type: string - example: "LTCBTC" - isIsolated: - type: boolean - example: false - orders: - type: array - items: - type: object - properties: - symbol: - type: string - orderId: - type: integer - format: int64 - clientOrderId: - type: string - example: - - symbol: "LTCBTC" - orderId: 4 - clientOrderId: "qD1gy3kc3Gx0rihm9Y3xwS" - - symbol: "LTCBTC" - orderId: 5 - clientOrderId: "ARzZ9I00CPM8i3NhmU9Ega" - required: - - symbol - - orderId - - clientOrderId + description: "Max borrowable amount limited by the account level" + example: + amount: "1.69248805" + borrowLimit: "60" required: - - orderListId - - contingencyType - - listStatusType - - listOrderStatus - - listClientOrderId - - transactionTime - - symbol - - isIsolated - - orders + - amount + - borrowLimit '400': description: Bad Request content: @@ -3998,23 +4338,23 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - delete: - summary: Margin Account Cancel OCO (TRADE) + /sapi/v1/margin/tradeCoeff: + get: + summary: Get Summary of Margin account (USER_DATA) description: |- - Cancel an entire Order List for a margin account - - - Canceling an individual leg will cancel the entire OCO - - Either `orderListId` or `listClientOrderId` must be provided + Get personal margin level information - Weight(UID): 1 + Weight(IP): 10 tags: - Margin parameters: - - $ref: '#/components/parameters/symbol' - - $ref: '#/components/parameters/isIsolatedMargin' - - $ref: '#/components/parameters/orderListId' - - $ref: '#/components/parameters/listClientOrderId' - - $ref: '#/components/parameters/newClientOrderId' + - name: email + in: query + description: Email Address + required: true + schema: + type: string + example: 'me@email.com' - $ref: '#/components/parameters/recvWindow' - $ref: '#/components/parameters/timestamp' - $ref: '#/components/parameters/signature' @@ -4022,11 +4362,27 @@ paths: - ApiKeyAuth: [] responses: '200': - description: Margin OCO details + description: Summary of Margin Account content: application/json: schema: - $ref: '#/components/schemas/marginOcoOrder' + type: object + properties: + normalBar: + type: string + description: "Account's currently max borrowable amount with sufficient system availability" + example: "1.5" + marginCallBar: + type: string + description: "Max borrowable amount limited by the account level" + example: "1.3" + forceLiquidationBar: + type: string + description: "Liquidation Margin Ratio" + example: "1.1" + required: + - amount + - borrowLimit '400': description: Bad Request content: @@ -4039,35 +4395,18 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/margin/allOrderList: + /sapi/v1/margin/isolated/account: get: - summary: Query Margin Account's all OCO (USER_DATA) + summary: Query Isolated Margin Account Info (USER_DATA) description: |- - Retrieves all OCO for a specific margin account based on provided optional parameters + - If "symbols" is not sent, all isolated assets will be returned. + - If "symbols" is sent, only the isolated assets of the sent symbols will be returned. - Weight(IP): 200 + Weight(IP): 10 tags: - Margin parameters: - - $ref: '#/components/parameters/isIsolatedMargin' - - name: symbol - in: query - description: 'Mandatory for isolated margin, not supported for cross margin' - schema: - type: string - - name: fromId - in: query - description: 'If supplied, neither `startTime` or `endTime` can be provided' - schema: - type: string - - $ref: '#/components/parameters/startTime' - - $ref: '#/components/parameters/endTime' - - name: limit - in: query - description: 'Default Value: 500; Max Value: 1000' - schema: - type: integer - format: int32 + - $ref: '#/components/parameters/symbols' - $ref: '#/components/parameters/recvWindow' - $ref: '#/components/parameters/timestamp' - $ref: '#/components/parameters/signature' @@ -4075,72 +4414,11 @@ paths: - ApiKeyAuth: [] responses: '200': - description: List of Margin OCO orders + description: Isolated Margin Account Info when "symbols" is not sent content: application/json: schema: - type: array - items: - type: object - properties: - orderListId: - type: integer - format: int64 - example: 29 - contingencyType: - type: string - example: "OCO" - listStatusType: - type: string - example: "EXEC_STARTED" - listOrderStatus: - type: string - example: "EXECUTING" - listClientOrderId: - type: string - example: "amEEAXryFzFwYF1FeRpUoZ" - transactionTime: - type: integer - format: int64 - example: 1565245913483 - symbol: - type: string - example: "LTCBTC" - isIsolated: - type: boolean - orders: - type: array - items: - type: object - properties: - symbol: - type: string - orderId: - type: integer - format: int64 - clientOrderId: - type: string - required: - - symbol - - orderId - - clientOrderId - example: - - symbol: "LTCBTC" - orderId: 4 - clientOrderId: "oD7aesZqjEGlZrbtRpy5zB" - - symbol: "LTCBTC" - orderId: 5 - clientOrderId: "Jr1h6xirOxgeJOUuYQS7V3" - required: - - orderListId - - contingencyType - - listStatusType - - listOrderStatus - - listClientOrderId - - transactionTime - - symbol - - isIsolated - - orders + $ref: '#/components/schemas/isolatedMarginAccountInfo' '400': description: Bad Request content: @@ -4153,19 +4431,16 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/margin/openOrderList: - get: - summary: Query Margin Account's Open OCO (USER_DATA) - description: 'Weight(IP): 10' + delete: + summary: Disable Isolated Margin Account (TRADE) + description: |- + Disable isolated margin account for a specific symbol. Each trading pair can only be deactivated once every 24 hours . + + Weight(UID): 300 tags: - Margin parameters: - - $ref: '#/components/parameters/isIsolatedMargin' - - name: symbol - in: query - description: 'Mandatory for isolated margin, not supported for cross margin' - schema: - type: string + - $ref: '#/components/parameters/symbol' - $ref: '#/components/parameters/recvWindow' - $ref: '#/components/parameters/timestamp' - $ref: '#/components/parameters/signature' @@ -4173,73 +4448,20 @@ paths: - ApiKeyAuth: [] responses: '200': - description: List of Open Margin OCO orders + description: Isolated Margin Account status content: application/json: schema: - type: array - items: - type: object - properties: - orderListId: - type: integer - format: int64 - example: 31 - contingencyType: - type: string - example: "OCO" - listStatusType: - type: string - example: "EXEC_STARTED" - listOrderStatus: - type: string - example: "EXECUTING" - listClientOrderId: - type: string - example: "wuB13fmulKj3YjdqWEcsnp" - transactionTime: - type: integer - format: int64 - example: 1565246080644 - symbol: - type: string - example: "LTCBTC" - isIsolated: - type: boolean - example: false - orders: - type: array - items: - type: object - properties: - symbol: - type: string - orderId: - type: integer - format: int64 - clientOrderId: - type: string - required: - - symbol - - orderId - - clientOrderId - example: - - symbol: "LTCBTC" - orderId: 4 - clientOrderId: "r3EH2N76dHfLoSZWIUw1bT" - - symbol: "LTCBTC" - orderId: 5 - clientOrderId: "Cv1SnyPD3qhqpbjpYEHbd2" - required: - - orderListId - - contingencyType - - listStatusType - - listOrderStatus - - listClientOrderId - - transactionTime - - symbol - - isIsolated - - orders + type: object + properties: + success: + type: boolean + symbol: + type: string + example: "BTCUSDT" + required: + - success + - symbol '400': description: Bad Request content: @@ -4252,23 +4474,16 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/margin/myTrades: - get: - summary: Query Margin Account's Trade List (USER_DATA) + post: + summary: Enable Isolated Margin Account (TRADE) description: |- - - If `fromId` is set, it will get orders >= that `fromId`. Otherwise most recent trades are returned. - - Weight(IP): 10 + Enable isolated margin account for a specific symbol. + Weight(UID): 300 tags: - Margin parameters: - $ref: '#/components/parameters/symbol' - - $ref: '#/components/parameters/isIsolatedMargin' - - $ref: '#/components/parameters/startTime' - - $ref: '#/components/parameters/endTime' - - $ref: '#/components/parameters/fromId' - - $ref: '#/components/parameters/limit' - $ref: '#/components/parameters/recvWindow' - $ref: '#/components/parameters/timestamp' - $ref: '#/components/parameters/signature' @@ -4276,13 +4491,20 @@ paths: - ApiKeyAuth: [] responses: '200': - description: List of margin trades + description: Isolated Margin Account status content: application/json: schema: - type: array - items: - $ref: '#/components/schemas/marginTrade' + type: object + properties: + success: + type: boolean + symbol: + type: string + example: "BTCUSDT" + required: + - success + - symbol '400': description: Bad Request content: @@ -4295,19 +4517,16 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/margin/maxBorrowable: + /sapi/v1/margin/isolated/accountLimit: get: - summary: Query Max Borrow (USER_DATA) + summary: Query Enabled Isolated Margin Account Limit (USER_DATA) description: |- - - If `isolatedSymbol` is not sent, crossed margin data will be sent. - - `borrowLimit` is also available from https://www.binance.com/en/margin-fee + Query enabled isolated margin account limit. - Weight(IP): 50 + Weight(IP): 1 tags: - Margin parameters: - - $ref: '#/components/parameters/asset' - - $ref: '#/components/parameters/isolatedSymbol' - $ref: '#/components/parameters/recvWindow' - $ref: '#/components/parameters/timestamp' - $ref: '#/components/parameters/signature' @@ -4315,23 +4534,23 @@ paths: - ApiKeyAuth: [] responses: '200': - description: Details on max borrow amount + description: Number of enabled Isolated Margin Account and its limit content: application/json: schema: type: object properties: - amount: - type: string - example: "1.69248805" - description: account's currently max borrowable amount with sufficient system availability - borrowLimit: - type: string - example: "60" - description: max borrowable amount limited by the account level + enabledAccount: + type: integer + format: int64 + example: 5 + maxAccount: + type: integer + format: int64 + example: 20 required: - - amount - - borrowLimit + - enabledAccount + - maxAccount '400': description: Bad Request content: @@ -4344,18 +4563,14 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/margin/maxTransferable: + /sapi/v1/margin/isolated/allPairs: get: - summary: Query Max Transfer-Out Amount (USER_DATA) - description: |- - - If `isolatedSymbol` is not sent, crossed margin data will be sent. - - Weight(IP): 50 + summary: Get All Isolated Margin Symbol(USER_DATA) + description: 'Weight(IP): 10' tags: - Margin parameters: - - $ref: '#/components/parameters/asset' - - $ref: '#/components/parameters/isolatedSymbol' + - $ref: '#/components/parameters/symbol' - $ref: '#/components/parameters/recvWindow' - $ref: '#/components/parameters/timestamp' - $ref: '#/components/parameters/signature' @@ -4363,24 +4578,36 @@ paths: - ApiKeyAuth: [] responses: '200': - description: Details on max transferable amount + description: All Isolated Margin Symbols content: application/json: schema: - type: object - properties: - amount: - type: string - description: "Account's currently max borrowable amount with sufficient system availability" - borrowLimit: - type: string - description: "Max borrowable amount limited by the account level" - example: - amount: "1.69248805" - borrowLimit: "60" - required: - - amount - - borrowLimit + type: array + items: + type: object + properties: + symbol: + type: string + example: 'BTCUSDT' + base: + type: string + example: 'BTC' + quote: + type: string + example: 'USDT' + isMarginTrade: + type: boolean + isBuyAllowed: + type: boolean + isSellAllowed: + type: boolean + required: + - symbol + - base + - quote + - isMarginTrade + - isBuyAllowed + - isSellAllowed '400': description: Bad Request content: @@ -4393,23 +4620,30 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/margin/tradeCoeff: - get: - summary: Get Summary of Margin account (USER_DATA) + /sapi/v1/bnbBurn: + post: + summary: Toggle BNB Burn On Spot Trade And Margin Interest (USER_DATA) description: |- - Get personal margin level information + - "spotBNBBurn" and "interestBNBBurn" should be sent at least one. - Weight(IP): 10 + Weight(IP): 1 tags: - Margin parameters: - - name: email + - name: spotBNBBurn in: query - description: Email Address - required: true + description: Determines whether to use BNB to pay for trading fees on SPOT schema: type: string - example: 'me@email.com' + enum: ['true','false'] + example: 'true' + - name: interestBNBBurn + in: query + description: Determines whether to use BNB to pay for margin loan's interest + schema: + type: string + enum: ['true','false'] + example: 'false' - $ref: '#/components/parameters/recvWindow' - $ref: '#/components/parameters/timestamp' - $ref: '#/components/parameters/signature' @@ -4417,27 +4651,11 @@ paths: - ApiKeyAuth: [] responses: '200': - description: Summary of Margin Account + description: Status on BNB to pay for trading fees content: application/json: schema: - type: object - properties: - normalBar: - type: string - description: "Account's currently max borrowable amount with sufficient system availability" - example: "1.5" - marginCallBar: - type: string - description: "Max borrowable amount limited by the account level" - example: "1.3" - forceLiquidationBar: - type: string - description: "Liquidation Margin Ratio" - example: "1.1" - required: - - amount - - borrowLimit + $ref: '#/components/schemas/bnbBurnStatus' '400': description: Bad Request content: @@ -4450,20 +4668,12 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/margin/isolated/transfer: get: - summary: Get Isolated Margin Transfer History (USER_DATA) + summary: Get BNB Burn Status(USER_DATA) description: 'Weight(IP): 1' tags: - Margin parameters: - - $ref: '#/components/parameters/optionalAsset' - - $ref: '#/components/parameters/symbol' - - $ref: '#/components/parameters/getCrossMargingTransferHistoryType' - - $ref: '#/components/parameters/startTime' - - $ref: '#/components/parameters/endTime' - - $ref: '#/components/parameters/current' - - $ref: '#/components/parameters/size' - $ref: '#/components/parameters/recvWindow' - $ref: '#/components/parameters/timestamp' - $ref: '#/components/parameters/signature' @@ -4471,11 +4681,11 @@ paths: - ApiKeyAuth: [] responses: '200': - description: Isolated Margin Transfer History + description: Status on BNB to pay for trading fees content: application/json: schema: - $ref: '#/components/schemas/marginTransferDetails' + $ref: '#/components/schemas/bnbBurnStatus' '400': description: Bad Request content: @@ -4488,17 +4698,20 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - post: - summary: Isolated Margin Account Transfer (MARGIN) - description: 'Weight(UID): 600' + /sapi/v1/margin/interestRateHistory: + get: + summary: Margin Interest Rate History (USER_DATA) + description: |- + The max interval between startTime and endTime is 30 days. + + Weight(IP): 1 tags: - Margin parameters: - $ref: '#/components/parameters/asset' - - $ref: '#/components/parameters/symbol' - - $ref: '#/components/parameters/transFrom' - - $ref: '#/components/parameters/transTo' - - $ref: '#/components/parameters/amount' + - $ref: '#/components/parameters/vipLevel' + - $ref: '#/components/parameters/startTime' + - $ref: '#/components/parameters/endTime' - $ref: '#/components/parameters/recvWindow' - $ref: '#/components/parameters/timestamp' - $ref: '#/components/parameters/signature' @@ -4506,13 +4719,33 @@ paths: - ApiKeyAuth: [] responses: '200': - description: Transaction Id + description: Margin Interest Rate History content: application/json: schema: - type: object - example: - tranId: 100000001 + type: array + items: + type: object + properties: + asset: + type: string + example: 'BTC' + dailyInterestRate: + type: string + example: '0.00025000' + timestamp: + type: integer + format: int64 + example: 1611544731000 + vipLevel: + type: integer + format: int32 + example: 1 + required: + - asset + - dailyInterestRate + - timestamp + - vipLevel '400': description: Bad Request content: @@ -4525,18 +4758,18 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/margin/isolated/account: + /sapi/v1/margin/crossMarginData: get: - summary: Query Isolated Margin Account Info (USER_DATA) + summary: Query Cross Margin Fee Data (USER_DATA) description: |- - - If "symbols" is not sent, all isolated assets will be returned. - - If "symbols" is sent, only the isolated assets of the sent symbols will be returned. + Get cross margin fee data collection with any vip level or user's current specific data as https://www.binance.com/en/margin-fee - Weight(IP): 10 + Weight(IP): 1 when coin is specified; 5 when the coin parameter is omitted tags: - Margin parameters: - - $ref: '#/components/parameters/symbols' + - $ref: '#/components/parameters/vipLevel' + - $ref: '#/components/parameters/optionalCoin' - $ref: '#/components/parameters/recvWindow' - $ref: '#/components/parameters/timestamp' - $ref: '#/components/parameters/signature' @@ -4544,11 +4777,52 @@ paths: - ApiKeyAuth: [] responses: '200': - description: Isolated Margin Account Info when "symbols" is not sent + description: Cross Margin Fee Data content: application/json: schema: - $ref: '#/components/schemas/isolatedMarginAccountInfo' + type: array + items: + type: object + properties: + vipLevel: + type: integer + format: int32 + example: 0 + coin: + type: string + example: "BTC" + transferIn: + type: boolean + borrowable: + type: boolean + dailyInterest: + type: string + example: "0.00026125" + yearlyInterest: + type: string + example: "0.0953" + borrowLimit: + type: string + example: "180" + marginablePairs: + type: array + items: + type: string + example: + - "BNBBTC" + - "TRXBTC" + - "ETHBTC" + - "BTCUSDT" + required: + - vipLevel + - coin + - transferIn + - borrowable + - dailyInterest + - yearlyInterest + - borrowLimit + - marginablePairs '400': description: Bad Request content: @@ -4561,16 +4835,18 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - delete: - summary: Disable Isolated Margin Account (TRADE) + /sapi/v1/margin/isolatedMarginData: + get: + summary: Query Isolated Margin Fee Data (USER_DATA) description: |- - Disable isolated margin account for a specific symbol. Each trading pair can only be deactivated once every 24 hours . + Get isolated margin fee data collection with any vip level or user's current specific data as https://www.binance.com/en/margin-fee - Weight(UID): 300 + Weight(IP): 1 when a single is specified; 10 when the symbol parameter is omitted tags: - Margin parameters: - - $ref: '#/components/parameters/symbol' + - $ref: '#/components/parameters/vipLevel' + - $ref: '#/components/parameters/optionalSymbol' - $ref: '#/components/parameters/recvWindow' - $ref: '#/components/parameters/timestamp' - $ref: '#/components/parameters/signature' @@ -4578,20 +4854,42 @@ paths: - ApiKeyAuth: [] responses: '200': - description: Isolated Margin Account status + description: Isolated Margin Fee Data content: application/json: schema: - type: object - properties: - success: - type: boolean - symbol: - type: string - example: "BTCUSDT" - required: - - success - - symbol + type: array + items: + type: object + properties: + vipLevel: + type: integer + format: int32 + example: 0 + symbol: + type: string + example: "BTCUSDT" + leverage: + type: string + example: "10" + data: + type: array + items: + type: object + properties: + coin: + type: string + dailyInterest: + type: string + borrowLimit: + type: string + example: + - coin: "BTC" + dailyInterest: "0.00026125" + borrowLimit: "270" + - coin: "USDT" + dailyInterest: "0.000475" + borrowLimit: "2100000" '400': description: Bad Request content: @@ -4604,16 +4902,23 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - post: - summary: Enable Isolated Margin Account (TRADE) + /sapi/v1/margin/isolatedMarginTier: + get: + summary: Query Isolated Margin Tier Data (USER_DATA) description: |- - Enable isolated margin account for a specific symbol. + Get isolated margin tier data collection with any tier as https://www.binance.com/en/margin-data - Weight(UID): 300 + Weight(IP): 1 tags: - Margin parameters: - $ref: '#/components/parameters/symbol' + - name: tier + in: query + description: All margin tier data will be returned if tier is omitted + schema: + type: string + example: 1 - $ref: '#/components/parameters/recvWindow' - $ref: '#/components/parameters/timestamp' - $ref: '#/components/parameters/signature' @@ -4621,20 +4926,36 @@ paths: - ApiKeyAuth: [] responses: '200': - description: Isolated Margin Account status + description: Isolated Margin Tier Data content: application/json: schema: - type: object - properties: - success: - type: boolean - symbol: - type: string - example: "BTCUSDT" - required: - - success - - symbol + type: array + items: + type: object + properties: + symbol: + type: string + example: "BTCUSDT" + tier: + type: integer + format: int32 + example: 1 + effectiveMultiple: + type: string + example: "10" + initialRiskRatio: + type: string + example: "1.111" + liquidationRiskRatio: + type: string + example: "1.05" + baseAssetMaxBorrowable: + type: string + example: "9" + quoteAssetMaxBorrowable: + type: string + example: "70000" '400': description: Bad Request content: @@ -4647,16 +4968,22 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/margin/isolated/accountLimit: + /sapi/v1/margin/rateLimit/order: get: - summary: Query Enabled Isolated Margin Account Limit (USER_DATA) + summary: Query Current Margin Order Count Usage (TRADE) description: |- - Query enabled isolated margin account limit. + Displays the user's current margin order count usage for all intervals. - Weight(IP): 1 + Weight(IP): 20 tags: - Margin parameters: + - $ref: '#/components/parameters/optionalIsIsolated' + - name: symbol + in: query + description: isolated symbol, mandatory for isolated margin + schema: + type: string - $ref: '#/components/parameters/recvWindow' - $ref: '#/components/parameters/timestamp' - $ref: '#/components/parameters/signature' @@ -4664,23 +4991,38 @@ paths: - ApiKeyAuth: [] responses: '200': - description: Number of enabled Isolated Margin Account and its limit + description: Usage. content: application/json: schema: - type: object - properties: - enabledAccount: - type: integer - format: int64 - example: 5 - maxAccount: - type: integer - format: int64 - example: 20 - required: - - enabledAccount - - maxAccount + type: array + items: + type: object + properties: + rateLimitType: + type: string + example: ORDERS + interval: + type: string + example: SECOND + intervalNum: + type: integer + format: int64 + example: 10 + limit: + type: integer + format: int64 + example: 10000 + count: + type: integer + format: int64 + example: 0 + required: + - rateLimitType + - interval + - intervalNum + - limit + - count '400': description: Bad Request content: @@ -4693,65 +5035,65 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/margin/isolated/pair: + /sapi/v1/margin/crossMarginCollateralRatio: get: - summary: Query Isolated Margin Symbol (USER_DATA) - description: 'Weight(IP): 10' + summary: Cross margin collateral ratio (MARKET_DATA) + description: |- + + Weight(IP): 100 tags: - Margin - parameters: - - $ref: '#/components/parameters/symbol' - - $ref: '#/components/parameters/recvWindow' - - $ref: '#/components/parameters/timestamp' - - $ref: '#/components/parameters/signature' security: - ApiKeyAuth: [] responses: '200': - description: Isolated Margin Symbol + description: Margin collateral ratio content: application/json: schema: - type: object - properties: - symbol: - type: string - example: 'BTCUSDT' - base: - type: string - example: 'BTC' - quote: - type: string - example: 'USDT' - isMarginTrade: - type: boolean - isBuyAllowed: - type: boolean - isSellAllowed: - type: boolean - required: - - symbol - - base - - quote - - isMarginTrade - - isBuyAllowed - - isSellAllowed + type: array + items: + type: object + properties: + collaterals: + type: array + items: + type: object + properties: + minUsdValue: + type: string + example: "0" + maxUsdValue: + type: string + example: "13000000" + discountRate: + type: string + example: "1" + required: + - minUsdValue + - maxUsdValue + - discountRate + assetNames: + type: array + items: + type: string + example: "BNX" + required: + - collaterals + - assetNames '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/error' - '401': - description: Unauthorized Request - content: - application/json: - schema: - $ref: '#/components/schemas/error' - /sapi/v1/margin/isolated/allPairs: + /sapi/v1/margin/exchange-small-liability: get: - summary: Get All Isolated Margin Symbol(USER_DATA) - description: 'Weight(IP): 10' + summary: Get Small Liability Exchange Coin List (USER_DATA) + description: |- + Query the coins which can be small liability exchange + + Weight(UID): 100 tags: - Margin parameters: @@ -4762,7 +5104,7 @@ paths: - ApiKeyAuth: [] responses: '200': - description: All Isolated Margin Symbols + description: coin list content: application/json: schema: @@ -4770,28 +5112,28 @@ paths: items: type: object properties: - symbol: + asset: type: string - example: 'BTCUSDT' - base: + example: "ETH" + interest: type: string - example: 'BTC' - quote: + example: "0.00083334" + principal: type: string - example: 'USDT' - isMarginTrade: - type: boolean - isBuyAllowed: - type: boolean - isSellAllowed: - type: boolean + example: "0.001" + liabilityAsset: + type: string + example: "USDT" + liabilityQty: + type: number + format: float + example: 0.3552 required: - - symbol - - base - - quote - - isMarginTrade - - isBuyAllowed - - isSellAllowed + - asset + - interest + - principal + - liabilityAsset + - liabilityQty '400': description: Bad Request content: @@ -4804,30 +5146,20 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/bnbBurn: - post: - summary: Toggle BNB Burn On Spot Trade And Margin Interest (USER_DATA) + /sapi/v1/margin/exchange-small-liability-history: + get: + summary: Get Small Liability Exchange History (USER_DATA) description: |- - - "spotBNBBurn" and "interestBNBBurn" should be sent at least one. + Get Small liability Exchange History - Weight(IP): 1 + Weight(UID): 100 tags: - Margin parameters: - - name: spotBNBBurn - in: query - description: Determines whether to use BNB to pay for trading fees on SPOT - schema: - type: string - enum: ['true','false'] - example: 'true' - - name: interestBNBBurn - in: query - description: Determines whether to use BNB to pay for margin loan's interest - schema: - type: string - enum: ['true','false'] - example: 'false' + - $ref: '#/components/parameters/current' + - $ref: '#/components/parameters/size' + - $ref: '#/components/parameters/startTime' + - $ref: '#/components/parameters/endTime' - $ref: '#/components/parameters/recvWindow' - $ref: '#/components/parameters/timestamp' - $ref: '#/components/parameters/signature' @@ -4835,41 +5167,49 @@ paths: - ApiKeyAuth: [] responses: '200': - description: Status on BNB to pay for trading fees - content: - application/json: - schema: - $ref: '#/components/schemas/bnbBurnStatus' - '400': - description: Bad Request - content: - application/json: - schema: - $ref: '#/components/schemas/error' - '401': - description: Unauthorized Request + description: coin list content: application/json: schema: - $ref: '#/components/schemas/error' - get: - summary: Get BNB Burn Status(USER_DATA) - description: 'Weight(IP): 1' - tags: - - Margin - parameters: - - $ref: '#/components/parameters/recvWindow' - - $ref: '#/components/parameters/timestamp' - - $ref: '#/components/parameters/signature' - security: - - ApiKeyAuth: [] - responses: - '200': - description: Status on BNB to pay for trading fees - content: - application/json: - schema: - $ref: '#/components/schemas/bnbBurnStatus' + type: object + properties: + total: + type: integer + example: 1 + rows: + type: array + items: + type: object + properties: + asset: + type: string + example: "ETH" + amount: + type: string + example: "0.00083434" + targetAsset: + type: string + example: "BUSD" + targetAmount: + type: string + example: "1.37576819" + bizType: + type: string + example: "EXCHANGE_SMALL_LIABILITY" + timestamp: + type: integer + format: int64 + example: 1672801339253 + required: + - asset + - amount + - targetAsset + - targetAmount + - bizType + - timestamp + required: + - total + - rows '400': description: Bad Request content: @@ -4882,20 +5222,29 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/margin/interestRateHistory: + /sapi/v1/margin/next-hourly-interest-rate: get: - summary: Margin Interest Rate History (USER_DATA) - description: |- - The max interval between startTime and endTime is 30 days. + summary: Get a future hourly interest rate (USER_DATA) + description: |- + Get user the next hourly estimate interest - Weight(IP): 1 + Weight(UID): 100 tags: - Margin parameters: - - $ref: '#/components/parameters/asset' - - $ref: '#/components/parameters/vipLevel' - - $ref: '#/components/parameters/startTime' - - $ref: '#/components/parameters/endTime' + - name: assets + in: query + description: List of assets, separated by commas, up to 20 + schema: + type: string + example: BTC,ETH + - name: isIsolated + in: query + description: for isolated margin or not, "TRUE", "FALSE" + schema: + type: string + enum: ['TRUE','FALSE'] + example: "TRUE" - $ref: '#/components/parameters/recvWindow' - $ref: '#/components/parameters/timestamp' - $ref: '#/components/parameters/signature' @@ -4903,7 +5252,7 @@ paths: - ApiKeyAuth: [] responses: '200': - description: Margin Interest Rate History + description: hourly interest content: application/json: schema: @@ -4913,23 +5262,13 @@ paths: properties: asset: type: string - example: 'BTC' - dailyInterestRate: + example: "BTC" + nextHourlyInterestRate: type: string - example: '0.00025000' - timestamp: - type: integer - format: int64 - example: 1611544731000 - vipLevel: - type: integer - format: int32 - example: 1 + example: "0.00000571" required: - asset - - dailyInterestRate - - timestamp - - vipLevel + - nextHourlyInterestRate '400': description: Bad Request content: @@ -4942,18 +5281,47 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/margin/crossMarginData: + /sapi/v1/margin/capital-flow: get: - summary: Query Cross Margin Fee Data (USER_DATA) + summary: Get cross or isolated margin capital flow(USER_DATA) description: |- - Get cross margin fee data collection with any vip level or user's current specific data as https://www.binance.com/en/margin-fee + Get cross or isolated margin capital flow - Weight(IP): 1 when coin is specified; 5 when the coin parameter is omitted + Weight(IP): 100 tags: - Margin parameters: - - $ref: '#/components/parameters/vipLevel' - - $ref: '#/components/parameters/optionalCoin' + - $ref: '#/components/parameters/optionalAsset' + - name: symbol + in: query + description: Required when querying isolated data + schema: + type: string + example: 'BTCUSDT' + - name: type + in: query + schema: + type: string + enum: [TRANSFER, BORROW, REPAY, BUY_INCOME, BUY_EXPENSE, SELL_INCOME, SELL_EXPENSE, TRADING_COMMISSION, BUY_LIQUIDATION, SELL_LIQUIDATION, REPAY_LIQUIDATION, OTHER_LIQUIDATION, LIQUIDATION_FEE, SMALL_BALANCE_CONVERT, COMMISSION_RETURN, SMALL_CONVERT] + - name: startTime + in: query + description: Only supports querying the data of the last 90 days + schema: + type: integer + format: int64 + - $ref: '#/components/parameters/endTime' + - name: fromId + in: query + description: If fromId is set, the data with id > fromId will be returned. Otherwise the latest data will be returned + schema: + type: integer + format: int64 + - name: limit + in: query + description: The number of data items returned each time is limited. Default 500; Max 1000. + schema: + type: integer + format: int64 - $ref: '#/components/parameters/recvWindow' - $ref: '#/components/parameters/timestamp' - $ref: '#/components/parameters/signature' @@ -4961,7 +5329,7 @@ paths: - ApiKeyAuth: [] responses: '200': - description: Cross Margin Fee Data + description: Margin capital flow content: application/json: schema: @@ -4969,44 +5337,38 @@ paths: items: type: object properties: - vipLevel: + id: type: integer - format: int32 - example: 0 - coin: + format: int64 + example: 123456 + tranId: + type: integer + format: int64 + example: 123123 + timestamp: + type: integer + format: int64 + example: 1691116657000 + asset: type: string - example: "BTC" - transferIn: - type: boolean - borrowable: - type: boolean - dailyInterest: + example: "USDT" + symbol: type: string - example: "0.00026125" - yearlyInterest: + example: "BTCUSDT" + type: type: string - example: "0.0953" - borrowLimit: + example: "BORROW" + amount: type: string - example: "180" - marginablePairs: - type: array - items: - type: string - example: - - "BNBBTC" - - "TRXBTC" - - "ETHBTC" - - "BTCUSDT" + example: "101" required: - - vipLevel - - coin - - transferIn - - borrowable - - dailyInterest - - yearlyInterest - - borrowLimit - - marginablePairs + - id + - tranId + - timestamp + - asset + - symbol + - type + - amount '400': description: Bad Request content: @@ -5019,18 +5381,16 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/margin/isolatedMarginData: + /sapi/v1/margin/delist-schedule: get: - summary: Query Isolated Margin Fee Data (USER_DATA) + summary: Get tokens or symbols delist schedule for cross margin and isolated margin (MARKET_DATA) description: |- - Get isolated margin fee data collection with any vip level or user's current specific data as https://www.binance.com/en/margin-fee + Get tokens or symbols delist schedule for cross margin and isolated margin - Weight(IP): 1 when a single is specified; 10 when the symbol parameter is omitted + Weight(IP): 100 tags: - Margin parameters: - - $ref: '#/components/parameters/vipLevel' - - $ref: '#/components/parameters/optionalSymbol' - $ref: '#/components/parameters/recvWindow' - $ref: '#/components/parameters/timestamp' - $ref: '#/components/parameters/signature' @@ -5038,7 +5398,7 @@ paths: - ApiKeyAuth: [] responses: '200': - description: Isolated Margin Fee Data + description: tokens or symbols delist schedule content: application/json: schema: @@ -5046,34 +5406,20 @@ paths: items: type: object properties: - vipLevel: + delistTime: type: integer - format: int32 - example: 0 - symbol: - type: string - example: "BTCUSDT" - leverage: - type: string - example: "10" - data: + format: int64 + example: 1686161202000 + crossMarginAssets: type: array items: - type: object - properties: - coin: - type: string - dailyInterest: - type: string - borrowLimit: - type: string - example: - - coin: "BTC" - dailyInterest: "0.00026125" - borrowLimit: "270" - - coin: "USDT" - dailyInterest: "0.000475" - borrowLimit: "2100000" + type: string + example: "BTC" + isolatedMarginSymbols: + type: array + items: + type: string + example: "BNBUSDT" '400': description: Bad Request content: @@ -5086,60 +5432,61 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/margin/isolatedMarginTier: + /sapi/v1/margin/available-inventory: get: - summary: Query Isolated Margin Tier Data (USER_DATA) + summary: Query Margin Available Inventory (USER_DATA) description: |- - Get isolated margin tier data collection with any tier as https://www.binance.com/en/margin-data + Margin available Inventory query - Weight(IP): 1 + Weight(UID): 50 tags: - Margin parameters: - - $ref: '#/components/parameters/symbol' - - name: tier + - name: type in: query - description: All margin tier data will be returned if tier is omitted + required: true schema: type: string - example: 1 - - $ref: '#/components/parameters/recvWindow' + enum: [MARGIN, ISOLATED] - $ref: '#/components/parameters/timestamp' - $ref: '#/components/parameters/signature' security: - ApiKeyAuth: [] responses: '200': - description: Isolated Margin Tier Data + description: Margin available Inventory content: application/json: schema: - type: array - items: - type: object - properties: - symbol: - type: string - example: "BTCUSDT" - tier: - type: integer - format: int32 - example: 1 - effectiveMultiple: - type: string - example: "10" - initialRiskRatio: - type: string - example: "1.111" - liquidationRiskRatio: - type: string - example: "1.05" - baseAssetMaxBorrowable: - type: string - example: "9" - quoteAssetMaxBorrowable: - type: string - example: "70000" + type: object + properties: + assets: + type: object + properties: + MATIC: + type: string + example: "100000000" + STPT: + type: string + example: "100000000" + TVK: + type: string + example: "100000000" + SHIB: + type: string + example: "97409653" + required: + - MATIC + - STPT + - TVK + - SHIB + updateTime: + type: integer + format: int64 + example: 1699272487 + required: + - assets + - updateTime '400': description: Bad Request content: @@ -5152,30 +5499,34 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/margin/rateLimit/order: - get: - summary: Query Current Margin Order Count Usage (TRADE) + /sapi/v1/margin/manual-liquidation: + post: + summary: Margin manual liquidation(MARGIN) description: |- - Displays the user's current margin order count usage for all intervals. + Margin manual liquidation - Weight(IP): 20 + Weight(UID): 3000 tags: - Margin parameters: - - $ref: '#/components/parameters/optionalIsIsolated' + - name: type + in: query + required: true + schema: + type: string + enum: [MARGIN, ISOLATED] - name: symbol in: query - description: isolated symbol, mandatory for isolated margin schema: type: string - - $ref: '#/components/parameters/recvWindow' + example: "BTCUSDT" - $ref: '#/components/parameters/timestamp' - $ref: '#/components/parameters/signature' security: - ApiKeyAuth: [] responses: '200': - description: Usage. + description: Margin manual liquidation content: application/json: schema: @@ -5183,30 +5534,28 @@ paths: items: type: object properties: - rateLimitType: + asset: type: string - example: ORDERS - interval: + example: "ETH" + interest: type: string - example: SECOND - intervalNum: - type: integer - format: int64 - example: 10 - limit: - type: integer - format: int64 - example: 10000 - count: - type: integer - format: int64 - example: 0 + example: "0.00083334" + principal: + type: string + example: "0.001" + liabilityAsset: + type: string + example: "USDT" + liabilityQty: + type: number + format: float + example: 0.3552 required: - - rateLimitType - - interval - - intervalNum - - limit - - count + - asset + - interest + - principal + - liabilityAsset + - liabilityQty '400': description: Bad Request content: @@ -5219,18 +5568,24 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/margin/dribblet: - get: - summary: Margin Dustlog (USER_DATA) + /sapi/v1/margin/max-leverage: + post: + summary: Adjust cross margin max leverage (USER_DATA) description: |- - Query the historical information of user margin account small-value asset conversion BNB. + Adjust cross margin max leverage - Weight(IP): 1 + Weight(UID): 3000 tags: - Margin parameters: - - $ref: '#/components/parameters/startTime' - - $ref: '#/components/parameters/endTime' + - name: maxLeverage + in: query + required: true + description: |- + Can only adjust 3 or 5 + schema: + type: integer + example: 3 - $ref: '#/components/parameters/recvWindow' - $ref: '#/components/parameters/timestamp' - $ref: '#/components/parameters/signature' @@ -5238,76 +5593,17 @@ paths: - ApiKeyAuth: [] responses: '200': - description: Dust Log + description: Adjust result content: application/json: schema: type: object properties: - total: - type: integer - format: int64 - example: 8 - userAssetDribblets: - type: array - items: - type: object - properties: - operateTime: - type: integer - format: int64 - example: 1615985535000 - totalTransferedAmount: - type: string - example: '0.00132256' - totalServiceChargeAmount: - type: string - example: '0.00002699' - transId: - type: integer - format: int64 - example: 45178372831 - userAssetDribbletDetails: - type: array - items: - type: object - properties: - transId: - type: integer - format: int64 - example: 4359321 - serviceChargeAmount: - type: string - example: '0.000009' - amount: - type: string - example: '0.0009' - operateTime: - type: integer - format: int64 - example: 1615985535000 - transferedAmount: - type: string - example: '0.000441' - fromAsset: - type: string - example: USDT - required: - - transId - - serviceChargeAmount - - amount - - operateTime - - transferedAmount - - fromAsset - required: - - operateTime - - totalTransferedAmount - - totalServiceChargeAmount - - transId - - userAssetDribbletDetails + success: + type: boolean + example: true required: - - total - - userAssetDribblets + - success '400': description: Bad Request content: @@ -5320,19 +5616,20 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/margin/crossMarginCollateralRatio: + /sapi/v1/margin/leverageBracket: get: - summary: Cross margin collateral ratio (MARKET_DATA) + summary: Query Liability Coin Leverage Bracket in Cross Margin Pro Mode (MARKET_DATA) description: |- + Liability Coin Leverage Bracket in Cross Margin Pro Mode - Weight(IP): 100 + Weight(IP): 1 tags: - Margin security: - ApiKeyAuth: [] responses: '200': - description: Margin collateral ratio + description: Leverage info content: application/json: schema: @@ -5340,196 +5637,93 @@ paths: items: type: object properties: - collaterals: - type: array - items: - type: object - properties: - minUsdValue: - type: string - example: "0" - maxUsdValue: - type: string - example: "13000000" - discountRate: - type: string - example: "1" - required: - - minUsdValue - - maxUsdValue - - discountRate assetNames: type: array items: type: string - example: "BNX" - required: - - collaterals - - assetNames - '400': - description: Bad Request - content: - application/json: - schema: - $ref: '#/components/schemas/error' - /sapi/v1/margin/exchange-small-liability: - get: - summary: Get Small Liability Exchange Coin List (USER_DATA) - description: |- - Query the coins which can be small liability exchange - - Weight(UID): 100 - tags: - - Margin - parameters: - - $ref: '#/components/parameters/recvWindow' - - $ref: '#/components/parameters/timestamp' - - $ref: '#/components/parameters/signature' - security: - - ApiKeyAuth: [] - responses: - '200': - description: coin list - content: - application/json: - schema: - type: array - items: - type: object - properties: - asset: - type: string - example: "ETH" - interest: - type: string - example: "0.00083334" - principal: - type: string - example: "0.001" - liabilityAsset: - type: string - example: "USDT" - liabilityQty: - type: number - format: float - example: 0.3552 + example: "BTC" + rank: + type: integer + example: 1 + brackets: + type: array + items: + type: object + properties: + leverage: + type: integer + example: 10 + maxDebt: + type: number + format: double + example: 1000000.00000000 + maintenanceMarginRate: + type: number + format: double + example: 0.02000000 + initialMarginRate: + type: number + format: double + example: 0.1112 + fastNum: + type: number + format: double + example: 60000.000 + required: + - leverage + - maxDebt + - maintenanceMarginRate + - initialMarginRate + - fastNum required: - - asset - - interest - - principal - - liabilityAsset - - liabilityQty + - assetNames + - rank + - brackets '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/error' - '401': - description: Unauthorized Request - content: - application/json: - schema: - $ref: '#/components/schemas/error' - /sapi/v1/margin/exchange-small-liability-history: + /sapi/v1/system/status: get: - summary: Get Small Liability Exchange History (USER_DATA) + summary: System Status (System) description: |- - Get Small liability Exchange History + Fetch system status. - Weight(UID): 100 + Weight(IP): 1 tags: - - Margin - parameters: - - $ref: '#/components/parameters/current' - - $ref: '#/components/parameters/size' - - $ref: '#/components/parameters/startTime' - - $ref: '#/components/parameters/endTime' - - $ref: '#/components/parameters/recvWindow' - - $ref: '#/components/parameters/timestamp' - - $ref: '#/components/parameters/signature' - security: - - ApiKeyAuth: [] + - Wallet responses: '200': - description: coin list + description: OK content: application/json: schema: type: object properties: - total: + status: type: integer - example: 1 - rows: - type: array - items: - type: object - properties: - asset: - type: string - example: "ETH" - amount: - type: string - example: "0.00083434" - targetAsset: - type: string - example: "BUSD" - targetAmount: - type: string - example: "1.37576819" - bizType: - type: string - example: "EXCHANGE_SMALL_LIABILITY" - timestamp: - type: integer - format: int64 - example: 1672801339253 - required: - - asset - - amount - - targetAsset - - targetAmount - - bizType - - timestamp + format: int32 + example: 0 + description: "0: normal, 1:system maintenance" + msg: + type: string + example: "normal" + description: '"normal", "system_maintenance"' required: - - total - - rows - '400': - description: Bad Request - content: - application/json: - schema: - $ref: '#/components/schemas/error' - '401': - description: Unauthorized Request - content: - application/json: - schema: - $ref: '#/components/schemas/error' - /sapi/v1/margin/next-hourly-interest-rate: + - status + - msg + /sapi/v1/capital/config/getall: get: - summary: Get a future hourly interest rate (USER_DATA) + summary: All Coins' Information (USER_DATA) description: |- - Get user the next hourly estimate interest + Get information of coins (available for deposit and withdraw) for user. - Weight(UID): 100 + Weight(IP): 10 tags: - - Margin + - Wallet parameters: - - name: assets - in: query - description: List of assets, separated by commas, up to 20 - schema: - type: string - example: BTC,ETH - - name: isIsolated - in: query - description: for isolated margin or not, "TRUE", "FALSE" - schema: - type: string - enum: ['TRUE','FALSE'] - example: "TRUE" - $ref: '#/components/parameters/recvWindow' - $ref: '#/components/parameters/timestamp' - $ref: '#/components/parameters/signature' @@ -5537,7 +5731,7 @@ paths: - ApiKeyAuth: [] responses: '200': - description: hourly interest + description: All coins details information content: application/json: schema: @@ -5545,115 +5739,140 @@ paths: items: type: object properties: - asset: + coin: type: string example: "BTC" - nextHourlyInterestRate: + depositAllEnable: + type: boolean + free: type: string - example: "0.00000571" - required: - - asset - - nextHourlyInterestRate - '400': - description: Bad Request - content: - application/json: - schema: - $ref: '#/components/schemas/error' - '401': - description: Unauthorized Request - content: - application/json: - schema: - $ref: '#/components/schemas/error' - /sapi/v1/margin/capital-flow: - get: - summary: Get cross or isolated margin capital flow(USER_DATA) - description: |- - Get cross or isolated margin capital flow - - Weight(IP): 100 - tags: - - Margin - parameters: - - $ref: '#/components/parameters/optionalAsset' - - name: symbol - in: query - description: Required when querying isolated data - schema: - type: string - example: 'BTCUSDT' - - name: type - in: query - schema: - type: string - enum: [TRANSFER, BORROW, REPAY, BUY_INCOME, BUY_EXPENSE, SELL_INCOME, SELL_EXPENSE, TRADING_COMMISSION, BUY_LIQUIDATION, SELL_LIQUIDATION, REPAY_LIQUIDATION, OTHER_LIQUIDATION, LIQUIDATION_FEE, SMALL_BALANCE_CONVERT, COMMISSION_RETURN, SMALL_CONVERT] - - name: startTime - in: query - description: Only supports querying the data of the last 90 days - schema: - type: integer - format: int64 - - $ref: '#/components/parameters/endTime' - - name: fromId - in: query - description: If fromId is set, the data with id > fromId will be returned. Otherwise the latest data will be returned - schema: - type: integer - format: int64 - - name: limit - in: query - description: The number of data items returned each time is limited. Default 500; Max 1000. - schema: - type: integer - format: int64 - - $ref: '#/components/parameters/recvWindow' - - $ref: '#/components/parameters/timestamp' - - $ref: '#/components/parameters/signature' - security: - - ApiKeyAuth: [] - responses: - '200': - description: Margin capital flow - content: - application/json: - schema: - type: array - items: - type: object - properties: - id: - type: integer - format: int64 - example: 123456 - tranId: - type: integer - format: int64 - example: 123123 - timestamp: - type: integer - format: int64 - example: 1691116657000 - asset: + example: "0.00000000" + freeze: type: string - example: "USDT" - symbol: + example: "0.00000000" + ipoable: type: string - example: "BTCUSDT" - type: + example: "0.00000000" + ipoing: type: string - example: "BORROW" - amount: + example: "0.00000000" + isLegalMoney: + type: boolean + example: false + locked: type: string - example: "101" + example: "0.00000000" + name: + type: string + example: "Bitcoin" + networkList: + type: array + items: + type: object + properties: + addressRegex: + type: string + example: "^(bnb1)[0-9a-z]{38}$" + coin: + type: string + example: "BTC" + depositDesc: + type: string + example: "Wallet Maintenance, Deposit Suspended" + description: 'shown only when "depositEnable" is false.' + depositEnable: + type: boolean + example: false + isDefault: + type: boolean + example: false + memoRegex: + type: string + example: "^[0-9A-Za-z\\-_]{1,120}$" + minConfirm: + type: integer + format: int64 + example: 1 + description: 'min number for balance confirmation.' + name: + type: string + example: "BEP2" + network: + type: string + example: "ETH" + specialTips: + type: string + example: "Both a MEMO and an Address are required to successfully deposit your BEP2-BTCB tokens to Binance." + unLockConfirm: + type: integer + format: int64 + example: 0 + description: 'confirmation number for balance unlock.' + withdrawDesc: + type: string + example: "Wallet Maintenance, Withdrawal Suspended" + description: 'shown only when "withdrawEnable" is false' + withdrawEnable: + type: boolean + example: false + withdrawFee: + type: string + example: "0.00000220" + withdrawIntegerMultiple: + type: string + example: "0.00000001" + withdrawMax: + type: string + example: "9999999999.99999999" + withdrawMin: + type: string + example: "0.00000440" + sameAddress: + type: boolean + required: + - addressRegex + - coin + - depositDesc + - depositEnable + - isDefault + - memoRegex + - minConfirm + - name + - network + - specialTips + - unLockConfirm + - withdrawDesc + - withdrawEnable + - withdrawFee + - withdrawIntegerMultiple + - withdrawMax + - withdrawMin + - sameAddress + storage: + type: string + example: "0.00000000" + trading: + type: boolean + withdrawAllEnable: + type: boolean + withdrawing: + type: string + example: "0.00000000" required: - - id - - tranId - - timestamp - - asset - - symbol - - type - - amount + - coin + - depositAllEnable + - free + - freeze + - ipoable + - ipoing + - isLegalMoney + - locked + - name + - networkList + - storage + - trading + - withdrawAllEnable + - withdrawing '400': description: Bad Request content: @@ -5666,16 +5885,34 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/margin/delist-schedule: + /sapi/v1/accountSnapshot: get: - summary: Get tokens or symbols delist schedule for cross margin and isolated margin (MARKET_DATA) + summary: Daily Account Snapshot (USER_DATA) description: |- - Get tokens or symbols delist schedule for cross margin and isolated margin + - The query time period must be less than 30 days + - Support query within the last one month only + - If startTimeand endTime not sent, return records of the last 7 days by default - Weight(IP): 100 + Weight(IP): 2400 tags: - - Margin + - Wallet parameters: + - name: type + in: query + required: true + schema: + type: string + enum: [SPOT, MARGIN, FUTURES] + - $ref: '#/components/parameters/startTime' + - $ref: '#/components/parameters/endTime' + - name: limit + in: query + schema: + type: integer + format: int32 + default: 7 + minimum: 7 + maximum: 30 - $ref: '#/components/parameters/recvWindow' - $ref: '#/components/parameters/timestamp' - $ref: '#/components/parameters/signature' @@ -5683,28 +5920,14 @@ paths: - ApiKeyAuth: [] responses: '200': - description: tokens or symbols delist schedule + description: Account Snapshot content: application/json: schema: - type: array - items: - type: object - properties: - delistTime: - type: integer - format: int64 - example: 1686161202000 - crossMarginAssets: - type: array - items: - type: string - example: "BTC" - isolatedMarginSymbols: - type: array - items: - type: string - example: "BNBUSDT" + oneOf: + - $ref: '#/components/schemas/snapshotSpot' + - $ref: '#/components/schemas/snapshotMargin' + - $ref: '#/components/schemas/snapshotFutures' '400': description: Bad Request content: @@ -5717,61 +5940,29 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/margin/available-inventory: - get: - summary: Query Margin Available Inventory (USER_DATA) + /sapi/v1/account/disableFastWithdrawSwitch: + post: + summary: Disable Fast Withdraw Switch (USER_DATA) description: |- - Margin available Inventory query + - This request will disable fastwithdraw switch under your account. + - You need to enable "trade" option for the api key which requests this endpoint. - Weight(UID): 50 + Weight(IP): 1 tags: - - Margin + - Wallet parameters: - - name: type - in: query - required: true - schema: - type: string - enum: [MARGIN, ISOLATED] + - $ref: '#/components/parameters/recvWindow' - $ref: '#/components/parameters/timestamp' - $ref: '#/components/parameters/signature' security: - ApiKeyAuth: [] responses: '200': - description: Margin available Inventory + description: OK content: application/json: schema: type: object - properties: - assets: - type: object - properties: - MATIC: - type: string - example: "100000000" - STPT: - type: string - example: "100000000" - TVK: - type: string - example: "100000000" - SHIB: - type: string - example: "97409653" - required: - - MATIC - - STPT - - TVK - - SHIB - updateTime: - type: integer - format: int64 - example: 1699272487 - required: - - assets - - updateTime '400': description: Bad Request content: @@ -5784,84 +5975,16 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/margin/manual-liquidation: + /sapi/v1/account/enableFastWithdrawSwitch: post: - summary: Margin manual liquidation(MARGIN) + summary: Enable Fast Withdraw Switch (USER_DATA) description: |- - Margin manual liquidation + - This request will enable fastwithdraw switch under your account. You need to enable "trade" option for the api key which requests this endpoint. + - When Fast Withdraw Switch is on, transferring funds to a Binance account will be done instantly. There is no on-chain transaction, no transaction ID and no withdrawal fee. - Weight(UID): 3000 + Weight(IP): 1 tags: - - Margin - parameters: - - name: type - in: query - required: true - schema: - type: string - enum: [MARGIN, ISOLATED] - - name: symbol - in: query - schema: - type: string - example: "BTCUSDT" - - $ref: '#/components/parameters/timestamp' - - $ref: '#/components/parameters/signature' - security: - - ApiKeyAuth: [] - responses: - '200': - description: Margin manual liquidation - content: - application/json: - schema: - type: array - items: - type: object - properties: - asset: - type: string - example: "ETH" - interest: - type: string - example: "0.00083334" - principal: - type: string - example: "0.001" - liabilityAsset: - type: string - example: "USDT" - liabilityQty: - type: number - format: float - example: 0.3552 - required: - - asset - - interest - - principal - - liabilityAsset - - liabilityQty - '400': - description: Bad Request - content: - application/json: - schema: - $ref: '#/components/schemas/error' - '401': - description: Unauthorized Request - content: - application/json: - schema: - $ref: '#/components/schemas/error' - /sapi/v1/margin/dust: - get: - summary: Get Assets That Can Be Converted Into BNB (USER_DATA) - description: |- - Get assets that can be converted into BNB. - - Weight(IP): 100 - tags: - - Margin + - Wallet parameters: - $ref: '#/components/parameters/recvWindow' - $ref: '#/components/parameters/timestamp' @@ -5870,60 +5993,11 @@ paths: - ApiKeyAuth: [] responses: '200': - description: Asset list + description: OK content: application/json: schema: type: object - properties: - details: - type: array - items: - type: object - properties: - asset: - type: string - example: "BTC" - assetFullName: - type: string - example: "ADA" - amountFree: - type: string - example: "6.21" - toBTC: - type: string - example: "0.00016848" - toBNB: - type: string - example: "0.01777302" - toBNBOffExchange: - type: string - example: "0.01741756" - exchange: - type: string - example: "0.00035546" - required: - - asset - - assetFullName - - amountFree - - toBTC - - toBNB - - toBNBOffExchange - - exchange - totalTransferBtc: - type: string - example: "0.00016848" - totalTransferBNB: - type: string - example: "0.01777302" - dribbletPercentage: - type: string - example: "0.02" - required: - - details - - totalTransferBtc - - totalTransferBNB - - dribbletPercentage '400': description: Bad Request content: @@ -5936,16 +6010,56 @@ paths: application/json: schema: $ref: '#/components/schemas/error' + /sapi/v1/capital/withdraw/apply: post: - summary: Dust Transfer (TRADE) + summary: Withdraw (USER_DATA) description: |- - Convert dust assets to BNB + Submit a withdraw request. - Weight(UID): 3000 + - If `network` not send, return with default network of the coin. + - You can get `network` and `isDefault` in `networkList` of a coin in the response of `Get /sapi/v1/capital/config/getall (HMAC SHA256)`. + + Weight(IP): 1 tags: - - Margin + - Wallet parameters: - - $ref: '#/components/parameters/asset' + - $ref: '#/components/parameters/coin' + - name: withdrawOrderId + in: query + description: Client id for withdraw + schema: + type: string + - $ref: '#/components/parameters/network' + - name: address + in: query + required: true + schema: + type: string + - name: addressTag + in: query + description: Secondary address identifier for coins like XRP,XMR etc. + schema: + type: string + - $ref: '#/components/parameters/amount' + - name: transactionFeeFlag + in: query + description: |- + When making internal transfer + - `true` -> returning the fee to the destination account; + - `false` -> returning the fee back to the departure account. + schema: + type: boolean + default: false + - name: name + in: query + schema: + type: string + - name: walletType + in: query + description: The wallet type for withdraw,0-Spot wallet, 1- Funding wallet. Default is Spot wallet + schema: + type: integer + format: int32 - $ref: '#/components/parameters/recvWindow' - $ref: '#/components/parameters/timestamp' - $ref: '#/components/parameters/signature' @@ -5953,54 +6067,17 @@ paths: - ApiKeyAuth: [] responses: '200': - description: convert dust result + description: Transafer Id content: application/json: schema: type: object properties: - totalServiceCharge: - type: string - example: "0.02102542" - totalTransfered: + id: type: string - example: "1.05127099" - transferResult: - type: array - items: - type: object - properties: - amount: - type: string - example: "0.03000000" - fromAsset: - type: string - example: "ETH" - operateTime: - type: integer - format: int64 - example: 1563368549307 - serviceChargeAmount: - type: string - example: "0.00500000" - tranId: - type: integer - format: int64 - example: 1563368549307 - transferedAmount: - type: string - example: "0.25000000" - required: - - amount - - fromAsset - - operateTime - - serviceChargeAmount - - tranId - - transferedAmount + example: "7213fea8e94b4a5593d507237e5a555b" required: - - totalServiceCharge - - totalTransfered - - transferResult + - id '400': description: Bad Request content: @@ -6013,24 +6090,33 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/margin/max-leverage: - post: - summary: Adjust cross margin max leverage (USER_DATA) + /sapi/v1/capital/deposit/hisrec: + get: + summary: Deposit History(supporting network) (USER_DATA) description: |- - Adjust cross margin max leverage + Fetch deposit history. - Weight(UID): 3000 + - Please notice the default `startTime` and `endTime` to make sure that time interval is within 0-90 days. + - If both `startTime` and `endTime` are sent, time between `startTime` and `endTime` must be less than 90 days. + + Weight(IP): 1 tags: - - Margin + - Wallet parameters: - - name: maxLeverage + - $ref: '#/components/parameters/optionalCoin' + - name: status in: query - required: true - description: |- - Can only adjust 3 or 5 + description: |- + * `0` - pending + * `6` - credited but cannot withdraw + * `1` - success schema: type: integer - example: 3 + format: int32 + - $ref: '#/components/parameters/startTime' + - $ref: '#/components/parameters/endTime' + - $ref: '#/components/parameters/offset' + - $ref: '#/components/parameters/limit' - $ref: '#/components/parameters/recvWindow' - $ref: '#/components/parameters/timestamp' - $ref: '#/components/parameters/signature' @@ -6038,43 +6124,7 @@ paths: - ApiKeyAuth: [] responses: '200': - description: Adjust result - content: - application/json: - schema: - type: object - properties: - success: - type: boolean - example: true - required: - - success - '400': - description: Bad Request - content: - application/json: - schema: - $ref: '#/components/schemas/error' - '401': - description: Unauthorized Request - content: - application/json: - schema: - $ref: '#/components/schemas/error' - /sapi/v1/margin/leverageBracket: - get: - summary: Query Liability Coin Leverage Bracket in Cross Margin Pro Mode (MARKET_DATA) - description: |- - Liability Coin Leverage Bracket in Cross Margin Pro Mode - - Weight(IP): 1 - tags: - - Margin - security: - - ApiKeyAuth: [] - responses: - '200': - description: Leverage info + description: List of deposits content: application/json: schema: @@ -6082,93 +6132,110 @@ paths: items: type: object properties: - assetNames: - type: array - items: - type: string - example: "BTC" - rank: + amount: + type: string + example: "0.00999800" + coin: + type: string + example: "PAXG" + network: + type: string + example: "ETH" + status: type: integer + format: int32 example: 1 - brackets: - type: array - items: - type: object - properties: - leverage: - type: integer - example: 10 - maxDebt: - type: number - format: double - example: 1000000.00000000 - maintenanceMarginRate: - type: number - format: double - example: 0.02000000 - initialMarginRate: - type: number - format: double - example: 0.1112 - fastNum: - type: number - format: double - example: 60000.000 - required: - - leverage - - maxDebt - - maintenanceMarginRate - - initialMarginRate - - fastNum + address: + type: string + example: "0x788cabe9236ce061e5a892e1a59395a81fc8d62c" + addressTag: + type: string + example: "" + txId: + type: string + example: "0xaad4654a3234aa6118af9b4b335f5ae81c360b2394721c019b5d1e75328b09f3" + insertTime: + type: integer + format: int64 + example: 1599621997000 + transferType: + type: integer + format: int32 + example: 0 + unlockConfirm: + type: string + example: "12/12" + description: confirm times for unlocking + confirmTimes: + type: string + example: "12/12" required: - - assetNames - - rank - - brackets + - amount + - coin + - network + - status + - address + - addressTag + - txId + - insertTime + - transferType + - unlockConfirm + - confirmTimes '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/system/status: - get: - summary: System Status (System) - description: |- - Fetch system status. - - Weight(IP): 1 - tags: - - Wallet - responses: - '200': - description: OK + '401': + description: Unauthorized Request content: application/json: schema: - type: object - properties: - status: - type: integer - format: int32 - example: 0 - description: "0: normal, 1:system maintenance" - msg: - type: string - example: "normal" - description: '"normal", "system_maintenance"' - required: - - status - - msg - /sapi/v1/capital/config/getall: + $ref: '#/components/schemas/error' + /sapi/v1/capital/withdraw/history: get: - summary: All Coins' Information (USER_DATA) + summary: Withdraw History (supporting network) (USER_DATA) description: |- - Get information of coins (available for deposit and withdraw) for user. + Fetch withdraw history. - Weight(IP): 10 + This endpoint specifically uses per second UID rate limit, user's total second level IP rate limit is 180000/second. Response from the endpoint contains header key X-SAPI-USED-UID-WEIGHT-1S, which defines weight used by the current IP. + + - `network` may not be in the response for old withdraw. + - Please notice the default `startTime` and `endTime` to make sure that time interval is within 0-90 days. + - If both `startTime` and `endTime` are sent, time between `startTime` and `endTime` must be less than 90 days + - If withdrawOrderId is sent, time between startTime and endTime must be less than 7 days. + - If withdrawOrderId is sent, startTime and endTime are not sent, will return last 7 days records by default. + + Weight(UID): 18000 + Request Limit: 10 requests per second tags: - Wallet parameters: + - $ref: '#/components/parameters/optionalCoin' + - name: withdrawOrderId + in: query + schema: + type: string + - name: status + in: query + description: |- + * `0` - Email Sent + * `1` - Cancelled + * `2` - Awaiting Approval + * `3` - Rejected + * `4` - Processing + * `5` - Failure + * `6` - Completed + schema: + type: integer + format: int32 + minimum: 0 + maximum: 6 + - $ref: '#/components/parameters/startTime' + - $ref: '#/components/parameters/endTime' + - $ref: '#/components/parameters/offset' + - $ref: '#/components/parameters/limit' - $ref: '#/components/parameters/recvWindow' - $ref: '#/components/parameters/timestamp' - $ref: '#/components/parameters/signature' @@ -6176,7 +6243,7 @@ paths: - ApiKeyAuth: [] responses: '200': - description: All coins details information + description: List of withdraw history content: application/json: schema: @@ -6184,144 +6251,63 @@ paths: items: type: object properties: + address: + type: string + example: "0x94df8b352de7f46f64b01d3666bf6e936e44ce60" + amount: + type: string + example: "8.91000000" + applyTime: + type: string + example: "2019-10-12 11:12:02" coin: type: string - example: "BTC" - depositAllEnable: - type: boolean - free: + example: "USDT" + id: type: string - example: "0.00000000" - freeze: + example: "b6ae22b3aa844210a7041aee7589627c" + withdrawOrderId: type: string - example: "0.00000000" - ipoable: + example: "WITHDRAWtest123" + description: will not be returned if there's no withdrawOrderId for this withdraw. + network: type: string - example: "0.00000000" - ipoing: + example: "ETH" + transferType: + type: integer + format: int32 + example: 0 + description: "1 for internal transfer, 0 for external transfer" + status: + type: integer + format: int32 + example: 6 + transactionFee: type: string - example: "0.00000000" - isLegalMoney: - type: boolean - example: false - locked: + example: "0.004" + confirmNo: + type: integer + format: int32 + example: 3 + info: type: string - example: "0.00000000" - name: + example: "The address is not valid. Please confirm with the recipient" + description: Reason for withdrawal failure + txId: type: string - example: "Bitcoin" - networkList: - type: array - items: - type: object - properties: - addressRegex: - type: string - example: "^(bnb1)[0-9a-z]{38}$" - coin: - type: string - example: "BTC" - depositDesc: - type: string - example: "Wallet Maintenance, Deposit Suspended" - description: 'shown only when "depositEnable" is false.' - depositEnable: - type: boolean - example: false - isDefault: - type: boolean - example: false - memoRegex: - type: string - example: "^[0-9A-Za-z\\-_]{1,120}$" - minConfirm: - type: integer - format: int64 - example: 1 - description: 'min number for balance confirmation.' - name: - type: string - example: "BEP2" - network: - type: string - example: "ETH" - resetAddressStatus: - type: boolean - example: false - specialTips: - type: string - example: "Both a MEMO and an Address are required to successfully deposit your BEP2-BTCB tokens to Binance." - unLockConfirm: - type: integer - format: int64 - example: 0 - description: 'confirmation number for balance unlock.' - withdrawDesc: - type: string - example: "Wallet Maintenance, Withdrawal Suspended" - description: 'shown only when "withdrawEnable" is false' - withdrawEnable: - type: boolean - example: false - withdrawFee: - type: string - example: "0.00000220" - withdrawIntegerMultiple: - type: string - example: "0.00000001" - withdrawMax: - type: string - example: "9999999999.99999999" - withdrawMin: - type: string - example: "0.00000440" - sameAddress: - type: boolean - required: - - addressRegex - - coin - - depositDesc - - depositEnable - - isDefault - - memoRegex - - minConfirm - - name - - network - - resetAddressStatus - - specialTips - - unLockConfirm - - withdrawDesc - - withdrawEnable - - withdrawFee - - withdrawIntegerMultiple - - withdrawMax - - withdrawMin - - sameAddress - storage: - type: string - example: "0.00000000" - trading: - type: boolean - withdrawAllEnable: - type: boolean - withdrawing: - type: string - example: "0.00000000" + example: "0xb5ef8c13b968a406cc62a93a8bd80f9e9a906ef1b3fcf20a2e48573c17659268" required: + - address + - amount + - applyTime - coin - - depositAllEnable - - free - - freeze - - ipoable - - ipoing - - isLegalMoney - - locked - - name - - networkList - - storage - - trading - - withdrawAllEnable - - withdrawing + - id + - withdrawOrderId + - network + - transferType + - status + - transactionFee + - txId '400': description: Bad Request content: @@ -6334,34 +6320,21 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/accountSnapshot: + /sapi/v1/capital/deposit/address: get: - summary: Daily Account Snapshot (USER_DATA) + summary: Deposit Address (supporting network) (USER_DATA) description: |- - - The query time period must be less than 30 days - - Support query within the last one month only - - If startTimeand endTime not sent, return records of the last 7 days by default + Fetch deposit address with network. - Weight(IP): 2400 + - If network is not send, return with default network of the coin. + - You can get network and isDefault in networkList in the response of Get /sapi/v1/capital/config/getall (HMAC SHA256). + + Weight(IP): 10 tags: - Wallet parameters: - - name: type - in: query - required: true - schema: - type: string - enum: [SPOT, MARGIN, FUTURES] - - $ref: '#/components/parameters/startTime' - - $ref: '#/components/parameters/endTime' - - name: limit - in: query - schema: - type: integer - format: int32 - default: 7 - minimum: 7 - maximum: 30 + - $ref: '#/components/parameters/coin' + - $ref: '#/components/parameters/network' - $ref: '#/components/parameters/recvWindow' - $ref: '#/components/parameters/timestamp' - $ref: '#/components/parameters/signature' @@ -6369,14 +6342,29 @@ paths: - ApiKeyAuth: [] responses: '200': - description: Account Snapshot + description: Deposit address info content: application/json: schema: - oneOf: - - $ref: '#/components/schemas/snapshotSpot' - - $ref: '#/components/schemas/snapshotMargin' - - $ref: '#/components/schemas/snapshotFutures' + type: object + properties: + address: + type: string + example: "1HPn8Rx2y6nNSfagQBKy27GB99Vbzg89wv" + coin: + type: string + example: "BTC" + tag: + type: string + example: "" + url: + type: string + example: "https://btc.com/1HPn8Rx2y6nNSfagQBKy27GB99Vbzg89wv" + required: + - address + - coin + - tag + - url '400': description: Bad Request content: @@ -6389,12 +6377,11 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/account/disableFastWithdrawSwitch: - post: - summary: Disable Fast Withdraw Switch (USER_DATA) + /sapi/v1/account/status: + get: + summary: Account Status (USER_DATA) description: |- - - This request will disable fastwithdraw switch under your account. - - You need to enable "trade" option for the api key which requests this endpoint. + Fetch account status detail. Weight(IP): 1 tags: @@ -6412,6 +6399,12 @@ paths: application/json: schema: type: object + properties: + data: + type: string + example: "Normal" + required: + - data '400': description: Bad Request content: @@ -6424,12 +6417,11 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/account/enableFastWithdrawSwitch: - post: - summary: Enable Fast Withdraw Switch (USER_DATA) + /sapi/v1/account/apiTradingStatus: + get: + summary: Account API Trading Status (USER_DATA) description: |- - - This request will enable fastwithdraw switch under your account. You need to enable "trade" option for the api key which requests this endpoint. - - When Fast Withdraw Switch is on, transferring funds to a Binance account will be done instantly. There is no on-chain transaction, no transaction ID and no withdrawal fee. + Fetch account API trading status with details. Weight(IP): 1 tags: @@ -6442,11 +6434,93 @@ paths: - ApiKeyAuth: [] responses: '200': - description: OK + description: Account API trading status content: application/json: schema: type: object + properties: + data: + type: object + properties: + isLocked: + type: boolean + example: false + description: API trading function is locked or not + plannedRecoverTime: + type: integer + format: int64 + example: 0 + description: If API trading function is locked, this is the planned recover time + triggerCondition: + type: object + properties: + GCR: + type: integer + format: int64 + example: 150 + description: Number of GTC orders + IFER: + type: integer + format: int64 + example: 150 + description: Number of FOK/IOC orders + UFR: + type: integer + format: int64 + example: 300 + description: Number of orders + required: + - GCR + - IFER + - UFR + indicators: + description: The indicators updated every 30 seconds + type: object + properties: + BTCUSDT: + type: array + items: + type: object + properties: + i: + type: string + example: "UFR" + description: Unfilled Ratio (UFR) + c: + type: integer + format: int64 + example: 20 + description: Count of all orders + v: + type: number + format: float + example: 0.05 + description: Current UFR value + t: + type: number + format: float + example: 0.99 + description: Trigger UFR value + required: + - i + - c + - v + - t + required: + - BTCUSDT + updateTime: + type: integer + format: int64 + example: 1547630471725 + required: + - isLocked + - plannedRecoverTime + - triggerCondition + - indicators + - updateTime + required: + - data '400': description: Bad Request content: @@ -6459,56 +6533,128 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/capital/withdraw/apply: - post: - summary: Withdraw (USER_DATA) - description: |- - Submit a withdraw request. - - - If `network` not send, return with default network of the coin. - - You can get `network` and `isDefault` in `networkList` of a coin in the response of `Get /sapi/v1/capital/config/getall (HMAC SHA256)`. - - Weight(IP): 1 + /sapi/v1/asset/dribblet: + get: + summary: DustLog(USER_DATA) + description: 'Weight(IP): 1' tags: - Wallet parameters: - - $ref: '#/components/parameters/coin' - - name: withdrawOrderId - in: query - description: Client id for withdraw - schema: - type: string - - $ref: '#/components/parameters/network' - - name: address - in: query - required: true - schema: - type: string - - name: addressTag + - name: accountType in: query - description: Secondary address identifier for coins like XRP,XMR etc. + required: false + description: SPOT or MARGIN, default SPOT schema: type: string - - $ref: '#/components/parameters/amount' - - name: transactionFeeFlag - in: query - description: |- - When making internal transfer - - `true` -> returning the fee to the destination account; - - `false` -> returning the fee back to the departure account. - schema: - type: boolean - default: false - - name: name + enum: [SPOT, MARGIN] + - $ref: '#/components/parameters/startTime' + - $ref: '#/components/parameters/endTime' + - $ref: '#/components/parameters/recvWindow' + - $ref: '#/components/parameters/timestamp' + - $ref: '#/components/parameters/signature' + security: + - ApiKeyAuth: [] + responses: + '200': + description: Dust log records + content: + application/json: + schema: + type: object + properties: + total: + description: Total counts of exchange + type: integer + format: int64 + example: 8 + userAssetDribblets: + type: array + items: + type: object + properties: + operateTime: + type: integer + format: int64 + example: 1615985535000 + totalTransferedAmount: + type: string + example: "0.00132256" + description: Total transfered BNB amount for this exchange. + totalServiceChargeAmount: + type: string + example: "0.00002699" + description: Total service charge amount for this exchange. + transId: + type: integer + format: int64 + example: 45178372831 + userAssetDribbletDetails: + type: array + items: + type: object + properties: + transId: + type: integer + format: int64 + example: 4359321 + serviceChargeAmount: + type: string + example: "0.000009" + amount: + type: string + example: "0.0009" + operateTime: + type: integer + format: int64 + example: 1615985535000 + transferedAmount: + type: string + example: "0.000441" + fromAsset: + type: string + example: "USDT" + required: + - transId + - serviceChargeAmount + - amount + - operateTime + - transferedAmount + - fromAsset + required: + - operateTime + - totalTransferedAmount + - totalServiceChargeAmount + - transId + - userAssetDribbletDetails + required: + - total + - userAssetDribblets + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/error' + '401': + description: Unauthorized Request + content: + application/json: + schema: + $ref: '#/components/schemas/error' + /sapi/v1/asset/dust-btc: + post: + summary: Get Assets That Can Be Converted Into BNB (USER_DATA) + description: 'Weight(IP): 1' + tags: + - Wallet + parameters: + - name: accountType in: query + required: false + description: SPOT or MARGIN, default SPOT schema: type: string - - name: walletType - in: query - description: The wallet type for withdraw,0-Spot wallet, 1- Funding wallet. Default is Spot wallet - schema: - type: integer - format: int32 + enum: [SPOT, MARGIN] - $ref: '#/components/parameters/recvWindow' - $ref: '#/components/parameters/timestamp' - $ref: '#/components/parameters/signature' @@ -6516,17 +6662,66 @@ paths: - ApiKeyAuth: [] responses: '200': - description: Transafer Id + description: Account assets available to be converted to BNB content: application/json: schema: type: object properties: - id: + details: + type: array + items: + type: object + properties: + asset: + type: string + example: "ADA" + assetFullName: + type: string + example: "ADA" + amountFree: + type: string + example: "6.21" + description: "Convertible amount" + toBTC: + type: string + example: "0.00016848" + description: "BTC amount" + toBNB: + type: string + example: "0.01777302" + description: "BNB amount(Not deducted commission fee" + toBNBOffExchange: + type: string + example: "0.01741756" + description: "BNB amount(Deducted commission fee" + exchange: + type: string + example: "0.00035546" + description: "Commission fee" + required: + - asset + - assetFullName + - amountFree + - toBTC + - toBNB + - toBNBOffExchange + - exchange + totalTransferBtc: type: string - example: "7213fea8e94b4a5593d507237e5a555b" + example: "0.00016848" + totalTransferBNB: + type: string + example: "0.01777302" + dribbletPercentage: + type: string + example: "0.02" + description: "Commission fee" required: - - id + - details + - totalTransferBtc + - totalTransferBNB + - dribbletPercentage '400': description: Bad Request content: @@ -6539,33 +6734,31 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/capital/deposit/hisrec: - get: - summary: Deposit History(supporting network) (USER_DATA) + /sapi/v1/asset/dust: + post: + summary: Dust Transfer (USER_DATA) description: |- - Fetch deposit history. - - - Please notice the default `startTime` and `endTime` to make sure that time interval is within 0-90 days. - - If both `startTime` and `endTime` are sent, time between `startTime` and `endTime` must be less than 90 days. + Convert dust assets to BNB. - Weight(IP): 1 + Weight(UID): 10 tags: - Wallet parameters: - - $ref: '#/components/parameters/optionalCoin' - - name: status + - name: asset in: query - description: |- - * `0` - pending - * `6` - credited but cannot withdraw - * `1` - success + required: true + description: The asset being converted. For example, asset=BTC&asset=USDT schema: - type: integer - format: int32 - - $ref: '#/components/parameters/startTime' - - $ref: '#/components/parameters/endTime' - - $ref: '#/components/parameters/offset' - - $ref: '#/components/parameters/limit' + type: array + items: + type: string + - name: accountType + in: query + required: false + description: SPOT or MARGIN, default SPOT + schema: + type: string + enum: [SPOT, MARGIN] - $ref: '#/components/parameters/recvWindow' - $ref: '#/components/parameters/timestamp' - $ref: '#/components/parameters/signature' @@ -6573,63 +6766,54 @@ paths: - ApiKeyAuth: [] responses: '200': - description: List of deposits + description: Dust log records content: application/json: schema: - type: array - items: - type: object - properties: - amount: - type: string - example: "0.00999800" - coin: - type: string - example: "PAXG" - network: - type: string - example: "ETH" - status: - type: integer - format: int32 - example: 1 - address: - type: string - example: "0x788cabe9236ce061e5a892e1a59395a81fc8d62c" - addressTag: - type: string - example: "" - txId: - type: string - example: "0xaad4654a3234aa6118af9b4b335f5ae81c360b2394721c019b5d1e75328b09f3" - insertTime: - type: integer - format: int64 - example: 1599621997000 - transferType: - type: integer - format: int32 - example: 0 - unlockConfirm: - type: string - example: "12/12" - description: confirm times for unlocking - confirmTimes: - type: string - example: "12/12" - required: - - amount - - coin - - network - - status - - address - - addressTag - - txId - - insertTime - - transferType - - unlockConfirm - - confirmTimes + type: object + properties: + totalServiceCharge: + type: string + example: "0.02102542" + totalTransfered: + type: string + example: "1.05127099" + transferResult: + type: array + items: + type: object + properties: + amount: + type: string + example: "0.03000000" + fromAsset: + type: string + example: "ETH" + operateTime: + type: integer + format: int64 + example: 1563368549307 + serviceChargeAmount: + type: string + example: "0.00500000" + tranId: + type: integer + format: int64 + example: 2970932918 + transferedAmount: + type: string + example: "0.25000000" + required: + - amount + - fromAsset + - operateTime + - serviceChargeAmount + - tranId + - transferedAmount + required: + - totalServiceCharge + - totalTransfered + - transferResult '400': description: Bad Request content: @@ -6642,49 +6826,26 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/capital/withdraw/history: + /sapi/v1/asset/assetDividend: get: - summary: Withdraw History (supporting network) (USER_DATA) + summary: Asset Dividend Record (USER_DATA) description: |- - Fetch withdraw history. - - This endpoint specifically uses per second UID rate limit, user's total second level IP rate limit is 180000/second. Response from the endpoint contains header key X-SAPI-USED-UID-WEIGHT-1S, which defines weight used by the current IP. - - - `network` may not be in the response for old withdraw. - - Please notice the default `startTime` and `endTime` to make sure that time interval is within 0-90 days. - - If both `startTime` and `endTime` are sent, time between `startTime` and `endTime` must be less than 90 days - - If withdrawOrderId is sent, time between startTime and endTime must be less than 7 days. - - If withdrawOrderId is sent, startTime and endTime are not sent, will return last 7 days records by default. + Query asset Dividend Record - Weight(UID): 18000 - Request Limit: 10 requests per second + Weight(IP): 10 tags: - Wallet parameters: - - $ref: '#/components/parameters/optionalCoin' - - name: withdrawOrderId - in: query - schema: - type: string - - name: status + - $ref: '#/components/parameters/optionalAsset' + - $ref: '#/components/parameters/startTime' + - $ref: '#/components/parameters/endTime' + - name: limit in: query - description: |- - * `0` - Email Sent - * `1` - Cancelled - * `2` - Awaiting Approval - * `3` - Rejected - * `4` - Processing - * `5` - Failure - * `6` - Completed schema: type: integer format: int32 - minimum: 0 - maximum: 6 - - $ref: '#/components/parameters/startTime' - - $ref: '#/components/parameters/endTime' - - $ref: '#/components/parameters/offset' - - $ref: '#/components/parameters/limit' + default: 20 + maximum: 500 - $ref: '#/components/parameters/recvWindow' - $ref: '#/components/parameters/timestamp' - $ref: '#/components/parameters/signature' @@ -6692,71 +6853,52 @@ paths: - ApiKeyAuth: [] responses: '200': - description: List of withdraw history + description: Records of asset devidend content: application/json: schema: - type: array - items: - type: object - properties: - address: - type: string - example: "0x94df8b352de7f46f64b01d3666bf6e936e44ce60" - amount: - type: string - example: "8.91000000" - applyTime: - type: string - example: "2019-10-12 11:12:02" - coin: - type: string - example: "USDT" - id: - type: string - example: "b6ae22b3aa844210a7041aee7589627c" - withdrawOrderId: - type: string - example: "WITHDRAWtest123" - description: will not be returned if there's no withdrawOrderId for this withdraw. - network: - type: string - example: "ETH" - transferType: - type: integer - format: int32 - example: 0 - description: "1 for internal transfer, 0 for external transfer" - status: - type: integer - format: int32 - example: 6 - transactionFee: - type: string - example: "0.004" - confirmNo: - type: integer - format: int32 - example: 3 - info: - type: string - example: "The address is not valid. Please confirm with the recipient" - description: Reason for withdrawal failure - txId: - type: string - example: "0xb5ef8c13b968a406cc62a93a8bd80f9e9a906ef1b3fcf20a2e48573c17659268" - required: - - address - - amount - - applyTime - - coin - - id - - withdrawOrderId - - network - - transferType - - status - - transactionFee - - txId + type: object + properties: + rows: + type: array + items: + type: object + properties: + id: + type: integer + format: int64 + example: 242006910 + amount: + type: string + example: "10.00000000" + asset: + type: string + example: "BHFT" + divTime: + type: integer + format: int64 + example: 1563189166000 + enInfo: + type: string + example: "BHFT distribution" + tranId: + type: integer + format: int64 + example: 2968885920 + required: + - id + - amount + - asset + - divTime + - enInfo + - tranId + total: + type: integer + format: int32 + example: 1 + required: + - rows + - total '400': description: Bad Request content: @@ -6769,21 +6911,19 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/capital/deposit/address: + /sapi/v1/asset/assetDetail: get: - summary: Deposit Address (supporting network) (USER_DATA) + summary: Asset Detail (USER_DATA) description: |- - Fetch deposit address with network. + Fetch details of assets supported on Binance. - - If network is not send, return with default network of the coin. - - You can get network and isDefault in networkList in the response of Get /sapi/v1/capital/config/getall (HMAC SHA256). + - Please get network and other deposit or withdraw details from `GET /sapi/v1/capital/config/getall`. - Weight(IP): 10 + Weight(IP): 1 tags: - Wallet parameters: - - $ref: '#/components/parameters/coin' - - $ref: '#/components/parameters/network' + - $ref: '#/components/parameters/optionalAsset' - $ref: '#/components/parameters/recvWindow' - $ref: '#/components/parameters/timestamp' - $ref: '#/components/parameters/signature' @@ -6791,29 +6931,40 @@ paths: - ApiKeyAuth: [] responses: '200': - description: Deposit address info + description: Asset detail content: application/json: schema: type: object properties: - address: - type: string - example: "1HPn8Rx2y6nNSfagQBKy27GB99Vbzg89wv" - coin: - type: string - example: "BTC" - tag: - type: string - example: "" - url: - type: string - example: "https://btc.com/1HPn8Rx2y6nNSfagQBKy27GB99Vbzg89wv" + CTR: + type: object + properties: + minWithdrawAmount: + type: string + example: "70.00000000" + depositStatus: + type: boolean + example: false + description: deposit status (false if ALL of networks' are false) + withdrawFee: + type: integer + format: int64 + example: 35 + withdrawStatus: + type: boolean + description: withdrawStatus status (false if ALL of networks' are false) + depositTip: + type: string + example: "Delisted, Deposit Suspended" + required: + - minWithdrawAmount + - depositStatus + - withdrawFee + - withdrawStatus + - depositTip required: - - address - - coin - - tag - - url + - CTR '400': description: Bad Request content: @@ -6826,16 +6977,17 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/account/status: + /sapi/v1/asset/tradeFee: get: - summary: Account Status (USER_DATA) + summary: Trade Fee (USER_DATA) description: |- - Fetch account status detail. + Fetch trade fee Weight(IP): 1 tags: - Wallet parameters: + - $ref: '#/components/parameters/optionalSymbol' - $ref: '#/components/parameters/recvWindow' - $ref: '#/components/parameters/timestamp' - $ref: '#/components/parameters/signature' @@ -6843,17 +6995,27 @@ paths: - ApiKeyAuth: [] responses: '200': - description: OK + description: Trade fee info per symbol content: application/json: schema: - type: object - properties: - data: - type: string - example: "Normal" - required: - - data + type: array + items: + type: object + properties: + symbol: + type: string + example: "ADABNB" + makerCommission: + type: string + example: "0.001" + takerCommission: + type: string + example: "0.001" + required: + - symbol + - makerCommission + - takerCommission '400': description: Bad Request content: @@ -6866,16 +7028,26 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/account/apiTradingStatus: + /sapi/v1/asset/transfer: get: - summary: Account API Trading Status (USER_DATA) + summary: Query User Universal Transfer History (USER_DATA) description: |- - Fetch account API trading status with details. + - `fromSymbol` must be sent when type are ISOLATEDMARGIN_MARGIN and ISOLATEDMARGIN_ISOLATEDMARGIN + - `toSymbol` must be sent when type are MARGIN_ISOLATEDMARGIN and ISOLATEDMARGIN_ISOLATEDMARGIN + - Support query within the last 6 months only + - If `startTime` and `endTime` not sent, return records of the last 7 days by default Weight(IP): 1 tags: - Wallet parameters: + - $ref: '#/components/parameters/univTransferType' + - $ref: '#/components/parameters/startTime' + - $ref: '#/components/parameters/endTime' + - $ref: '#/components/parameters/current' + - $ref: '#/components/parameters/size' + - $ref: '#/components/parameters/fromSymbol' + - $ref: '#/components/parameters/toSymbol' - $ref: '#/components/parameters/recvWindow' - $ref: '#/components/parameters/timestamp' - $ref: '#/components/parameters/signature' @@ -6883,93 +7055,51 @@ paths: - ApiKeyAuth: [] responses: '200': - description: Account API trading status + description: Universal transfer history content: application/json: schema: type: object properties: - data: - type: object - properties: - isLocked: - type: boolean - example: false - description: API trading function is locked or not - plannedRecoverTime: - type: integer - format: int64 - example: 0 - description: If API trading function is locked, this is the planned recover time - triggerCondition: - type: object - properties: - GCR: - type: integer - format: int64 - example: 150 - description: Number of GTC orders - IFER: - type: integer - format: int64 - example: 150 - description: Number of FOK/IOC orders - UFR: - type: integer - format: int64 - example: 300 - description: Number of orders - required: - - GCR - - IFER - - UFR - indicators: - description: The indicators updated every 30 seconds - type: object - properties: - BTCUSDT: - type: array - items: - type: object - properties: - i: - type: string - example: "UFR" - description: Unfilled Ratio (UFR) - c: - type: integer - format: int64 - example: 20 - description: Count of all orders - v: - type: number - format: float - example: 0.05 - description: Current UFR value - t: - type: number - format: float - example: 0.99 - description: Trigger UFR value - required: - - i - - c - - v - - t - required: - - BTCUSDT - updateTime: - type: integer - format: int64 - example: 1547630471725 - required: - - isLocked - - plannedRecoverTime - - triggerCondition - - indicators - - updateTime + total: + type: integer + format: int32 + example: 1 + rows: + type: array + items: + type: object + properties: + asset: + type: string + example: "USDT" + amount: + type: string + example: "1" + type: + type: string + example: "MAIN_UMFUTUR" + status: + type: string + example: "CONFIRMED" + tranId: + type: integer + format: int64 + example: 11415955596 + timestamp: + type: integer + format: int64 + example: 1544433328000 + required: + - asset + - amount + - type + - status + - tranId + - timestamp required: - - data + - total + - rows '400': description: Bad Request content: @@ -6982,95 +7112,77 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/asset/dribblet: - get: - summary: DustLog(USER_DATA) - description: 'Weight(IP): 1' + post: + summary: User Universal Transfer (USER_DATA) + description: |- + You need to enable `Permits Universal Transfer` option for the api key which requests this endpoint. + + - `fromSymbol` must be sent when type are ISOLATEDMARGIN_MARGIN and ISOLATEDMARGIN_ISOLATEDMARGIN + - `toSymbol` must be sent when type are MARGIN_ISOLATEDMARGIN and ISOLATEDMARGIN_ISOLATEDMARGIN + + ENUM of transfer types: + - MAIN_UMFUTURE Spot account transfer to USDⓈ-M Futures account + - MAIN_CMFUTURE Spot account transfer to COIN-M Futures account + - MAIN_MARGIN Spot account transfer to Margin(cross)account + - UMFUTURE_MAIN USDⓈ-M Futures account transfer to Spot account + - UMFUTURE_MARGIN USDⓈ-M Futures account transfer to Margin(cross)account + - CMFUTURE_MAIN COIN-M Futures account transfer to Spot account + - CMFUTURE_MARGIN COIN-M Futures account transfer to Margin(cross) account + - MARGIN_MAIN Margin(cross)account transfer to Spot account + - MARGIN_UMFUTURE Margin(cross)account transfer to USDⓈ-M Futures + - MARGIN_CMFUTURE Margin(cross)account transfer to COIN-M Futures + - ISOLATEDMARGIN_MARGIN Isolated margin account transfer to Margin(cross) account + - MARGIN_ISOLATEDMARGIN Margin(cross) account transfer to Isolated margin account + - ISOLATEDMARGIN_ISOLATEDMARGIN Isolated margin account transfer to Isolated margin account + - MAIN_FUNDING Spot account transfer to Funding account + - FUNDING_MAIN Funding account transfer to Spot account + - FUNDING_UMFUTURE Funding account transfer to UMFUTURE account + - UMFUTURE_FUNDING UMFUTURE account transfer to Funding account + - MARGIN_FUNDING MARGIN account transfer to Funding account + - FUNDING_MARGIN Funding account transfer to Margin account + - FUNDING_CMFUTURE Funding account transfer to CMFUTURE account + - CMFUTURE_FUNDING CMFUTURE account transfer to Funding account + - MAIN_OPTION Spot account transfer to Options account + - OPTION_MAIN Options account transfer to Spot account + - UMFUTURE_OPTION USDⓈ-M Futures account transfer to Options account + - OPTION_UMFUTURE Options account transfer to USDⓈ-M Futures account + - MARGIN_OPTION Margin(cross)account transfer to Options account + - OPTION_MARGIN Options account transfer to Margin(cross)account + - FUNDING_OPTION Funding account transfer to Options account + - OPTION_FUNDING Options account transfer to Funding account + - MAIN_PORTFOLIO_MARGIN Spot account transfer to Portfolio Margin account + - PORTFOLIO_MARGIN_MAIN Portfolio Margin account transfer to Spot account + - MAIN_ISOLATED_MARGIN Spot account transfer to Isolated margin account + - ISOLATED_MARGIN_MAIN Isolated margin account transfer to Spot account + + Weight(IP): 1 tags: - Wallet parameters: - - $ref: '#/components/parameters/startTime' - - $ref: '#/components/parameters/endTime' - - $ref: '#/components/parameters/recvWindow' + - $ref: '#/components/parameters/univTransferType' + - $ref: '#/components/parameters/asset' + - $ref: '#/components/parameters/amount' + - $ref: '#/components/parameters/fromSymbol' + - $ref: '#/components/parameters/toSymbol' + - $ref: '#/components/parameters/recvWindow' - $ref: '#/components/parameters/timestamp' - $ref: '#/components/parameters/signature' security: - ApiKeyAuth: [] responses: '200': - description: Dust log records + description: Transfer id content: application/json: schema: type: object properties: - total: - description: Total counts of exchange + tranId: type: integer format: int64 - example: 8 - userAssetDribblets: - type: array - items: - type: object - properties: - operateTime: - type: integer - format: int64 - example: 1615985535000 - totalTransferedAmount: - type: string - example: "0.00132256" - description: Total transfered BNB amount for this exchange. - totalServiceChargeAmount: - type: string - example: "0.00002699" - description: Total service charge amount for this exchange. - transId: - type: integer - format: int64 - example: 45178372831 - userAssetDribbletDetails: - type: array - items: - type: object - properties: - transId: - type: integer - format: int64 - example: 4359321 - serviceChargeAmount: - type: string - example: "0.000009" - amount: - type: string - example: "0.0009" - operateTime: - type: integer - format: int64 - example: 1615985535000 - transferedAmount: - type: string - example: "0.000441" - fromAsset: - type: string - example: "USDT" - required: - - transId - - serviceChargeAmount - - amount - - operateTime - - transferedAmount - - fromAsset - required: - - operateTime - - totalTransferedAmount - - totalServiceChargeAmount - - transId - - userAssetDribbletDetails + example: 13526853623 required: - - total - - userAssetDribblets + - tranId '400': description: Bad Request content: @@ -7083,13 +7195,18 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/asset/dust-btc: + /sapi/v1/asset/get-funding-asset: post: - summary: Get Assets That Can Be Converted Into BNB (USER_DATA) - description: 'Weight(IP): 1' + summary: Funding Wallet (USER_DATA) + description: |- + - Currently supports querying the following business assets:Binance Pay, Binance Card, Binance Gift Card, Stock Token + + Weight(IP): 1 tags: - Wallet parameters: + - $ref: '#/components/parameters/optionalAsset' + - $ref: '#/components/parameters/needBtcValuation' - $ref: '#/components/parameters/recvWindow' - $ref: '#/components/parameters/timestamp' - $ref: '#/components/parameters/signature' @@ -7097,66 +7214,39 @@ paths: - ApiKeyAuth: [] responses: '200': - description: Account assets available to be converted to BNB + description: Funding asset detail content: application/json: schema: - type: object - properties: - details: - type: array - items: - type: object - properties: - asset: - type: string - example: "ADA" - assetFullName: - type: string - example: "ADA" - amountFree: - type: string - example: "6.21" - description: "Convertible amount" - toBTC: - type: string - example: "0.00016848" - description: "BTC amount" - toBNB: - type: string - example: "0.01777302" - description: "BNB amount(Not deducted commission fee" - toBNBOffExchange: - type: string - example: "0.01741756" - description: "BNB amount(Deducted commission fee" - exchange: - type: string - example: "0.00035546" - description: "Commission fee" - required: - - asset - - assetFullName - - amountFree - - toBTC - - toBNB - - toBNBOffExchange - - exchange - totalTransferBtc: - type: string - example: "0.00016848" - totalTransferBNB: - type: string - example: "0.01777302" - dribbletPercentage: - type: string - example: "0.02" - description: "Commission fee" - required: - - details - - totalTransferBtc - - totalTransferBNB - - dribbletPercentage + type: array + items: + type: object + properties: + asset: + type: string + example: "USDT" + free: + type: string + example: "1" + locked: + type: string + example: "0" + freeze: + type: string + example: "0" + withdrawing: + type: string + example: "0" + btcValuation: + type: string + example: "0.00000091" + required: + - asset + - free + - locked + - freeze + - withdrawing + - btcValuation '400': description: Bad Request content: @@ -7169,24 +7259,18 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/asset/dust: + /sapi/v3/asset/getUserAsset: post: - summary: Dust Transfer (USER_DATA) + summary: User Asset (USER_DATA) description: |- - Convert dust assets to BNB. + Get user assets, just for positive data. - Weight(UID): 10 + Weight(IP): 5 tags: - Wallet parameters: - - name: asset - in: query - required: true - description: The asset being converted. For example, asset=BTC&asset=USDT - schema: - type: array - items: - type: string + - $ref: '#/components/parameters/optionalAsset' + - $ref: '#/components/parameters/needBtcValuation' - $ref: '#/components/parameters/recvWindow' - $ref: '#/components/parameters/timestamp' - $ref: '#/components/parameters/signature' @@ -7194,86 +7278,81 @@ paths: - ApiKeyAuth: [] responses: '200': - description: Dust log records - content: - application/json: - schema: - type: object - properties: - totalServiceCharge: - type: string - example: "0.02102542" - totalTransfered: - type: string - example: "1.05127099" - transferResult: - type: array - items: - type: object - properties: - amount: - type: string - example: "0.03000000" - fromAsset: - type: string - example: "ETH" - operateTime: - type: integer - format: int64 - example: 1563368549307 - serviceChargeAmount: - type: string - example: "0.00500000" - tranId: - type: integer - format: int64 - example: 2970932918 - transferedAmount: - type: string - example: "0.25000000" - required: - - amount - - fromAsset - - operateTime - - serviceChargeAmount - - tranId - - transferedAmount - required: - - totalServiceCharge - - totalTransfered - - transferResult - '400': - description: Bad Request - content: - application/json: - schema: - $ref: '#/components/schemas/error' - '401': - description: Unauthorized Request + description: User assets content: application/json: schema: - $ref: '#/components/schemas/error' - /sapi/v1/asset/assetDividend: - get: - summary: Asset Dividend Record (USER_DATA) - description: |- - Query asset Dividend Record - - Weight(IP): 10 + type: array + items: + type: object + properties: + asset: + type: string + example: AVAX + free: + type: string + example: '1' + locked: + type: string + example: '0' + freeze: + type: string + example: '0' + withdrawing: + type: string + example: '0' + ipoable: + type: string + example: '0' + btcValuation: + type: string + example: '0' + required: + - asset + - free + - locked + - freeze + - withdrawing + - ipoable + - btcValuation + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/error' + '401': + description: Unauthorized Request + content: + application/json: + schema: + $ref: '#/components/schemas/error' + /sapi/v1/asset/convert-transfer: + post: + summary: Convert Transfer (USER_DATA) + description: |- + Convert transfer, convert between BUSD and stablecoins. + If the clientId has been used before, will not do the convert transfer, the original transfer will be returned. + + Weight(UID): 5 tags: - Wallet parameters: - - $ref: '#/components/parameters/optionalAsset' - - $ref: '#/components/parameters/startTime' - - $ref: '#/components/parameters/endTime' - - name: limit + - name: clientTranId in: query + description: The unique flag, the min length is 20 + required: true schema: - type: integer - format: int32 - default: 20 - maximum: 500 + type: string + - $ref: '#/components/parameters/asset' + - $ref: '#/components/parameters/amount' + - name: targetAsset + in: query + description: Target asset you want to convert + required: true + schema: + type: string + example: "BNB" - $ref: '#/components/parameters/recvWindow' - $ref: '#/components/parameters/timestamp' - $ref: '#/components/parameters/signature' @@ -7281,52 +7360,22 @@ paths: - ApiKeyAuth: [] responses: '200': - description: Records of asset devidend + description: Conversion Information content: application/json: schema: type: object properties: - rows: - type: array - items: - type: object - properties: - id: - type: integer - format: int64 - example: 242006910 - amount: - type: string - example: "10.00000000" - asset: - type: string - example: "BHFT" - divTime: - type: integer - format: int64 - example: 1563189166000 - enInfo: - type: string - example: "BHFT distribution" - tranId: - type: integer - format: int64 - example: 2968885920 - required: - - id - - amount - - asset - - divTime - - enInfo - - tranId - total: + tranId: type: integer - format: int32 - example: 1 + format: int64 + example: 118263407119 + status: + type: string + example: "S" required: - - rows - - total + - tranId + - status '400': description: Bad Request content: @@ -7339,19 +7388,51 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/asset/assetDetail: + /sapi/v1/asset/convert-transfer/queryByPage: get: - summary: Asset Detail (USER_DATA) + summary: Query Convert Transfer (USER_DATA) description: |- - Fetch details of assets supported on Binance. - - - Please get network and other deposit or withdraw details from `GET /sapi/v1/capital/config/getall`. - - Weight(IP): 1 + Weight(UID): 5 tags: - Wallet parameters: - - $ref: '#/components/parameters/optionalAsset' + - name: tranId + in: query + description: The transaction id + required: false + schema: + type: integer + format: int64 + example: 118263615991 + - name: asset + in: query + required: false + description: If it is blank, we will match deducted asset and target asset. + schema: + type: string + example: "BTC" + - name: startTime + in: query + description: UTC timestamp in ms + required: true + schema: + type: integer + format: int64 + - name: endTime + in: query + description: UTC timestamp in ms + required: true + schema: + type: integer + format: int64 + - name: accountType + in: query + description: "MAIN: main account. CARD: funding account. If it is blank, we will query spot and card wallet, otherwise, we just query the corresponding wallet" + schema: + type: string + enum: ['MAIN', 'CARD'] + - $ref: '#/components/parameters/current' + - $ref: '#/components/parameters/size' - $ref: '#/components/parameters/recvWindow' - $ref: '#/components/parameters/timestamp' - $ref: '#/components/parameters/signature' @@ -7359,40 +7440,64 @@ paths: - ApiKeyAuth: [] responses: '200': - description: Asset detail + description: Query Convert Transfer content: application/json: schema: type: object properties: - CTR: - type: object - properties: - minWithdrawAmount: - type: string - example: "70.00000000" - depositStatus: - type: boolean - example: false - description: deposit status (false if ALL of networks' are false) - withdrawFee: - type: integer - format: int64 - example: 35 - withdrawStatus: - type: boolean - description: withdrawStatus status (false if ALL of networks' are false) - depositTip: - type: string - example: "Delisted, Deposit Suspended" - required: - - minWithdrawAmount - - depositStatus - - withdrawFee - - withdrawStatus - - depositTip + total: + type: integer + format: int32 + example: 1 + rows: + type: array + items: + type: object + properties: + tranId: + type: integer + format: int64 + example: 118263407119 + type: + type: integer + format: int64 + example: 244 + time: + type: integer + format: int64 + example: 1664442078000 + deductedAsset: + type: string + example: "BUSD" + deductedAmount: + type: string + example: "1" + targetAsset: + type: string + example: "USDC" + targetAmount: + type: string + example: "1" + status: + type: string + example: "S" + accountType: + type: string + example: "MAIN" + required: + - tranId + - type + - time + - deductedAsset + - deductedAmount + - targetAsset + - targetAmount + - status + - accountType required: - - CTR + - total + - rows '400': description: Bad Request content: @@ -7405,77 +7510,53 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/asset/tradeFee: + /sapi/v1/asset/ledger-transfer/cloud-mining/queryByPage: get: - summary: Trade Fee (USER_DATA) + summary: Get Cloud-Mining payment and refund history (USER_DATA) description: |- - Fetch trade fee + The query of Cloud-Mining payment and refund history - Weight(IP): 1 - tags: - - Wallet - parameters: - - $ref: '#/components/parameters/optionalSymbol' - - $ref: '#/components/parameters/recvWindow' - - $ref: '#/components/parameters/timestamp' - - $ref: '#/components/parameters/signature' - security: - - ApiKeyAuth: [] - responses: - '200': - description: Trade fee info per symbol - content: - application/json: - schema: - type: array - items: - type: object - properties: - symbol: - type: string - example: "ADABNB" - makerCommission: - type: string - example: "0.001" - takerCommission: - type: string - example: "0.001" - required: - - symbol - - makerCommission - - takerCommission - '400': - description: Bad Request - content: - application/json: - schema: - $ref: '#/components/schemas/error' - '401': - description: Unauthorized Request - content: - application/json: - schema: - $ref: '#/components/schemas/error' - /sapi/v1/asset/transfer: - get: - summary: Query User Universal Transfer History (USER_DATA) - description: |- - - `fromSymbol` must be sent when type are ISOLATEDMARGIN_MARGIN and ISOLATEDMARGIN_ISOLATEDMARGIN - - `toSymbol` must be sent when type are MARGIN_ISOLATEDMARGIN and ISOLATEDMARGIN_ISOLATEDMARGIN - - Support query within the last 6 months only - - If `startTime` and `endTime` not sent, return records of the last 7 days by default - - Weight(IP): 1 + Weight(UID): 600 tags: - Wallet parameters: - - $ref: '#/components/parameters/univTransferType' - - $ref: '#/components/parameters/startTime' - - $ref: '#/components/parameters/endTime' + - name: tranId + in: query + description: The transaction id + required: false + schema: + type: integer + format: int64 + example: 118263615991 + - name: clientTranId + in: query + description: The unique flag + required: false + schema: + type: string + - name: asset + in: query + required: false + description: If it is blank, we will query all assets + schema: + type: string + example: "BTC" + - name: startTime + in: query + description: UTC timestamp in ms + required: true + schema: + type: integer + format: int64 + - name: endTime + in: query + description: UTC timestamp in ms + required: true + schema: + type: integer + format: int64 - $ref: '#/components/parameters/current' - $ref: '#/components/parameters/size' - - $ref: '#/components/parameters/fromSymbol' - - $ref: '#/components/parameters/toSymbol' - $ref: '#/components/parameters/recvWindow' - $ref: '#/components/parameters/timestamp' - $ref: '#/components/parameters/signature' @@ -7483,7 +7564,7 @@ paths: - ApiKeyAuth: [] responses: '200': - description: Universal transfer history + description: Cloud Mining Payment and Refund History content: application/json: schema: @@ -7498,33 +7579,34 @@ paths: items: type: object properties: + createTime: + type: integer + format: int64 + example: 1667880112000 + tranId: + type: integer + format: int64 + example: 121230610120 + type: + type: integer + format: int64 + example: 248 asset: type: string example: "USDT" amount: type: string example: "1" - type: - type: string - example: "MAIN_UMFUTUR" status: type: string - example: "CONFIRMED" - tranId: - type: integer - format: int64 - example: 11415955596 - timestamp: - type: integer - format: int64 - example: 1544433328000 + example: "S" required: + - createTime + - tranId + - type - asset - amount - - type - status - - tranId - - timestamp required: - total - rows @@ -7540,58 +7622,13 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - post: - summary: User Universal Transfer (USER_DATA) - description: |- - You need to enable `Permits Universal Transfer` option for the api key which requests this endpoint. - - - `fromSymbol` must be sent when type are ISOLATEDMARGIN_MARGIN and ISOLATEDMARGIN_ISOLATEDMARGIN - - `toSymbol` must be sent when type are MARGIN_ISOLATEDMARGIN and ISOLATEDMARGIN_ISOLATEDMARGIN - - ENUM of transfer types: - - MAIN_UMFUTURE Spot account transfer to USDⓈ-M Futures account - - MAIN_CMFUTURE Spot account transfer to COIN-M Futures account - - MAIN_MARGIN Spot account transfer to Margin(cross)account - - UMFUTURE_MAIN USDⓈ-M Futures account transfer to Spot account - - UMFUTURE_MARGIN USDⓈ-M Futures account transfer to Margin(cross)account - - CMFUTURE_MAIN COIN-M Futures account transfer to Spot account - - CMFUTURE_MARGIN COIN-M Futures account transfer to Margin(cross) account - - MARGIN_MAIN Margin(cross)account transfer to Spot account - - MARGIN_UMFUTURE Margin(cross)account transfer to USDⓈ-M Futures - - MARGIN_CMFUTURE Margin(cross)account transfer to COIN-M Futures - - ISOLATEDMARGIN_MARGIN Isolated margin account transfer to Margin(cross) account - - MARGIN_ISOLATEDMARGIN Margin(cross) account transfer to Isolated margin account - - ISOLATEDMARGIN_ISOLATEDMARGIN Isolated margin account transfer to Isolated margin account - - MAIN_FUNDING Spot account transfer to Funding account - - FUNDING_MAIN Funding account transfer to Spot account - - FUNDING_UMFUTURE Funding account transfer to UMFUTURE account - - UMFUTURE_FUNDING UMFUTURE account transfer to Funding account - - MARGIN_FUNDING MARGIN account transfer to Funding account - - FUNDING_MARGIN Funding account transfer to Margin account - - FUNDING_CMFUTURE Funding account transfer to CMFUTURE account - - CMFUTURE_FUNDING CMFUTURE account transfer to Funding account - - MAIN_OPTION Spot account transfer to Options account - - OPTION_MAIN Options account transfer to Spot account - - UMFUTURE_OPTION USDⓈ-M Futures account transfer to Options account - - OPTION_UMFUTURE Options account transfer to USDⓈ-M Futures account - - MARGIN_OPTION Margin(cross)account transfer to Options account - - OPTION_MARGIN Options account transfer to Margin(cross)account - - FUNDING_OPTION Funding account transfer to Options account - - OPTION_FUNDING Options account transfer to Funding account - - MAIN_PORTFOLIO_MARGIN Spot account transfer to Portfolio Margin account - - PORTFOLIO_MARGIN_MAIN Portfolio Margin account transfer to Spot account - - MAIN_ISOLATED_MARGIN Spot account transfer to Isolated margin account - - ISOLATED_MARGIN_MAIN Isolated margin account transfer to Spot account - - Weight(IP): 1 + /sapi/v1/account/apiRestrictions: + get: + summary: Get API Key Permission (USER_DATA) + description: 'Weight(IP): 1' tags: - Wallet parameters: - - $ref: '#/components/parameters/univTransferType' - - $ref: '#/components/parameters/asset' - - $ref: '#/components/parameters/amount' - - $ref: '#/components/parameters/fromSymbol' - - $ref: '#/components/parameters/toSymbol' - $ref: '#/components/parameters/recvWindow' - $ref: '#/components/parameters/timestamp' - $ref: '#/components/parameters/signature' @@ -7599,18 +7636,68 @@ paths: - ApiKeyAuth: [] responses: '200': - description: Transfer id + description: API Key permissions content: application/json: schema: type: object properties: - tranId: + ipRestrict: + type: boolean + example: false + createTime: type: integer format: int64 - example: 13526853623 + example: 1623840271000 + enableInternalTransfer: + type: boolean + description: This option authorizes this key to transfer funds between your master account and your sub account instantly + enableFutures: + type: boolean + example: false + description: API Key created before your futures account opened does not support futures API service + enablePortfolioMarginTrading: + type: boolean + example: false + description: API Key created before your activate portfolio margin does not support portfolio margin API service + enableVanillaOptions: + type: boolean + example: false + description: Authorizes this key to Vanilla options trading + permitsUniversalTransfer: + type: boolean + description: Authorizes this key to be used for a dedicated universal transfer API to transfer multiple supported currencies. Each business's own transfer API rights are not affected by this authorization + enableReading: + type: boolean + example: true + enableSpotAndMarginTrading: + type: boolean + example: false + enableWithdrawals: + type: boolean + example: false + description: This option allows you to withdraw via API. You must apply the IP Access Restriction filter in order to enable withdrawals + enableMargin: + type: boolean + example: false + description: This option can be adjusted after the Cross Margin account transfer is completed + tradingAuthorityExpirationTime: + type: integer + format: int64 + example: 1628985600000 + description: Expiration time for spot and margin trading permission required: - - tranId + - ipRestrict + - createTime + - enableWithdrawals + - enableInternalTransfer + - permitsUniversalTransfer + - enableVanillaOptions + - enableReading + - enableFutures + - enableMargin + - enableSpotAndMarginTrading + - tradingAuthorityExpirationTime '400': description: Bad Request content: @@ -7623,58 +7710,52 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/asset/get-funding-asset: - post: - summary: Funding Wallet (USER_DATA) + /sapi/v1/capital/contract/convertible-coins: + get: + summary: Query auto-converting stable coins (USER_DATA) description: |- - - Currently supports querying the following business assets:Binance Pay, Binance Card, Binance Gift Card, Stock Token + Get a user's auto-conversion settings in deposit/withdrawal - Weight(IP): 1 + Weight(UID): 600' tags: - Wallet - parameters: - - $ref: '#/components/parameters/optionalAsset' - - $ref: '#/components/parameters/needBtcValuation' - - $ref: '#/components/parameters/recvWindow' - - $ref: '#/components/parameters/timestamp' - - $ref: '#/components/parameters/signature' security: - ApiKeyAuth: [] responses: '200': - description: Funding asset detail + description: User's auto-conversion settings i content: application/json: schema: - type: array - items: + type: object + properties: + convertEnabled: + type: boolean + coins: + type: array + items: + type: string + example: "USDC" + exchangeRates: type: object properties: - asset: - type: string - example: "USDT" - free: + USDC: type: string example: "1" - locked: - type: string - example: "0" - freeze: - type: string - example: "0" - withdrawing: + TUSD: type: string - example: "0" - btcValuation: + example: "1" + USDP: type: string - example: "0.00000091" + example: "1" required: - - asset - - free - - locked - - freeze - - withdrawing - - btcValuation + - USDC + - TUSD + - USDP + required: + - convertEnabled + - coins + - exchangeRates '400': description: Bad Request content: @@ -7687,62 +7768,36 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v3/asset/getUserAsset: post: - summary: User Asset (USER_DATA) + summary: Switch on/off BUSD and stable coins conversion (USER_DATA) (USER_DATA) description: |- - Get user assets, just for positive data. + User can use it to turn on or turn off the BUSD auto-conversion from/to a specific stable coin. - Weight(IP): 5 + Weight(UID): 600' tags: - Wallet parameters: - - $ref: '#/components/parameters/optionalAsset' - - $ref: '#/components/parameters/needBtcValuation' - - $ref: '#/components/parameters/recvWindow' - - $ref: '#/components/parameters/timestamp' - - $ref: '#/components/parameters/signature' + - name: coin + in: query + required: true + description: "Must be USDC, USDP or TUSD" + schema: + type: string + - name: enable + in: query + required: true + description: "true: turn on the auto-conversion. false: turn off the auto-conversion" + schema: + type: boolean security: - ApiKeyAuth: [] responses: '200': - description: User assets + description: OK content: application/json: schema: - type: array - items: - type: object - properties: - asset: - type: string - example: AVAX - free: - type: string - example: '1' - locked: - type: string - example: '0' - freeze: - type: string - example: '0' - withdrawing: - type: string - example: '0' - ipoable: - type: string - example: '0' - btcValuation: - type: string - example: '0' - required: - - asset - - free - - locked - - freeze - - withdrawing - - ipoable - - btcValuation + type: object '400': description: Bad Request content: @@ -7755,32 +7810,23 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/asset/convert-transfer: + /sapi/v1/sub-account/virtualSubAccount: post: - summary: Convert Transfer (USER_DATA) + summary: Create a Virtual Sub-account(For Master Account) description: |- - Convert transfer, convert between BUSD and stablecoins. - If the clientId has been used before, will not do the convert transfer, the original transfer will be returned. + - This request will generate a virtual sub account under your master account. + - You need to enable "trade" option for the api key which requests this endpoint. - Weight(UID): 5 + Weight(IP): 1 tags: - - Wallet + - Sub-Account parameters: - - name: clientTranId - in: query - description: The unique flag, the min length is 20 - required: true - schema: - type: string - - $ref: '#/components/parameters/asset' - - $ref: '#/components/parameters/amount' - - name: targetAsset + - name: subAccountString in: query - description: Target asset you want to convert + description: Please input a string. We will create a virtual email using that string for you to register required: true schema: type: string - example: "BNB" - $ref: '#/components/parameters/recvWindow' - $ref: '#/components/parameters/timestamp' - $ref: '#/components/parameters/signature' @@ -7788,22 +7834,17 @@ paths: - ApiKeyAuth: [] responses: '200': - description: Conversion Information + description: Return the created virtual email content: application/json: schema: type: object properties: - tranId: - type: integer - format: int64 - example: 118263407119 - status: + email: type: string - example: "S" + example: "addsdd_virtual@aasaixwqnoemail.com" required: - - tranId - - status + - email '400': description: Bad Request content: @@ -7816,51 +7857,27 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/asset/convert-transfer/queryByPage: + /sapi/v1/sub-account/list: get: - summary: Query Convert Transfer (USER_DATA) - description: |- - Weight(UID): 5 + summary: Query Sub-account List (For Master Account) + description: 'Weight(IP): 1' tags: - - Wallet + - Sub-Account parameters: - - name: tranId - in: query - description: The transaction id - required: false - schema: - type: integer - format: int64 - example: 118263615991 - - name: asset + - $ref: '#/components/parameters/optionalSubAccountEmail' + - name: isFreeze in: query - required: false - description: If it is blank, we will match deducted asset and target asset. schema: type: string - example: "BTC" - - name: startTime - in: query - description: UTC timestamp in ms - required: true - schema: - type: integer - format: int64 - - name: endTime + enum: ['true', 'false'] + - $ref: '#/components/parameters/page' + - name: limit in: query - description: UTC timestamp in ms - required: true + description: Default 1; max 200 schema: type: integer - format: int64 - - name: accountType - in: query - description: "MAIN: main account. CARD: funding account. If it is blank, we will query spot and card wallet, otherwise, we just query the corresponding wallet" - schema: - type: string - enum: ['MAIN', 'CARD'] - - $ref: '#/components/parameters/current' - - $ref: '#/components/parameters/size' + format: int32 + example: 1 - $ref: '#/components/parameters/recvWindow' - $ref: '#/components/parameters/timestamp' - $ref: '#/components/parameters/signature' @@ -7868,64 +7885,41 @@ paths: - ApiKeyAuth: [] responses: '200': - description: Query Convert Transfer + description: List of sub-accounts content: application/json: schema: type: object properties: - total: - type: integer - format: int32 - example: 1 - rows: + subAccounts: type: array items: type: object properties: - tranId: - type: integer - format: int64 - example: 118263407119 - type: - type: integer - format: int64 - example: 244 - time: + email: + type: string + example: "testsub@gmail.com" + isFreeze: + type: boolean + example: false + createTime: type: integer format: int64 - example: 1664442078000 - deductedAsset: - type: string - example: "BUSD" - deductedAmount: - type: string - example: "1" - targetAsset: - type: string - example: "USDC" - targetAmount: - type: string - example: "1" - status: - type: string - example: "S" - accountType: - type: string - example: "MAIN" + example: 1544433328000 + isManagedSubAccount: + type: boolean + example: false + isAssetManagementSubAccount: + type: boolean + example: false required: - - tranId - - type - - time - - deductedAsset - - deductedAmount - - targetAsset - - targetAmount - - status - - accountType + - email + - isFreeze + - createTime + - isManagedSubAccount + - isAssetManagementSubAccount required: - - total - - rows + - subAccounts '400': description: Bad Request content: @@ -7938,53 +7932,112 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/asset/ledger-transfer/cloud-mining/queryByPage: + /sapi/v1/sub-account/sub/transfer/history: get: - summary: Get Cloud-Mining payment and refund history (USER_DATA) + summary: Sub-account Spot Asset Transfer History (For Master Account) description: |- - The query of Cloud-Mining payment and refund history + - fromEmail and toEmail cannot be sent at the same time. + - Return fromEmail equal master account email by default. - Weight(UID): 600 + Weight(IP): 1 tags: - - Wallet + - Sub-Account parameters: - - name: tranId + - $ref: '#/components/parameters/optionalSubAccountFromEmail' + - $ref: '#/components/parameters/optionalSubAccountToEmail' + - $ref: '#/components/parameters/startTime' + - $ref: '#/components/parameters/endTime' + - $ref: '#/components/parameters/page' + - name: limit in: query - description: The transaction id - required: false + description: Default 1 schema: type: integer - format: int64 - example: 118263615991 - - name: clientTranId - in: query - description: The unique flag - required: false - schema: - type: string - - name: asset - in: query - required: false - description: If it is blank, we will query all assets - schema: - type: string - example: "BTC" - - name: startTime + format: int32 + example: 1 + - $ref: '#/components/parameters/recvWindow' + - $ref: '#/components/parameters/timestamp' + - $ref: '#/components/parameters/signature' + security: + - ApiKeyAuth: [] + responses: + '200': + description: Sub-account Spot Asset Transfer History + content: + application/json: + schema: + type: array + items: + type: object + properties: + from: + type: string + example: aaa@test.com + to: + type: string + example: bbb@test.com + asset: + type: string + example: BTC + qty: + type: string + example: 10 + status: + type: string + example: SUCCESS + tranId: + type: integer + format: int64 + example: 6489943656 + time: + type: integer + format: int64 + example: 1544433328000 + required: + - from + - to + - asset + - qty + - status + - tranId + - time + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/error' + '401': + description: Unauthorized Request + content: + application/json: + schema: + $ref: '#/components/schemas/error' + /sapi/v1/sub-account/futures/internalTransfer: + get: + summary: Sub-account Futures Asset Transfer History (For Master Account) + description: 'Weight(IP): 1' + tags: + - Sub-Account + parameters: + - $ref: '#/components/parameters/subAccountEmail' + - name: futuresType in: query - description: UTC timestamp in ms + description: '1:USDT-margined Futures, 2: Coin-margined Futures' required: true schema: type: integer - format: int64 - - name: endTime + format: int32 + example: 2 + - $ref: '#/components/parameters/startTime' + - $ref: '#/components/parameters/endTime' + - $ref: '#/components/parameters/page' + - name: limit in: query - description: UTC timestamp in ms - required: true + description: 'Default value: 50, Max value: 500' schema: type: integer - format: int64 - - $ref: '#/components/parameters/current' - - $ref: '#/components/parameters/size' + format: int32 - $ref: '#/components/parameters/recvWindow' - $ref: '#/components/parameters/timestamp' - $ref: '#/components/parameters/signature' @@ -7992,52 +8045,54 @@ paths: - ApiKeyAuth: [] responses: '200': - description: Cloud Mining Payment and Refund History + description: Sub-account Futures Asset Transfer History content: application/json: schema: type: object properties: - total: + success: + type: boolean + futuresType: type: integer format: int32 - example: 1 - rows: + example: 2 + transfers: type: array items: type: object properties: - createTime: - type: integer - format: int64 - example: 1667880112000 + from: + type: string + example: "aaa@test.com" + to: + type: string + example: "bbb@test.com" + asset: + type: string + example: "BTC" + qty: + type: string + example: "1" tranId: type: integer format: int64 - example: 121230610120 - type: + example: 11897001102 + time: type: integer format: int64 - example: 248 - asset: - type: string - example: "USDT" - amount: - type: string - example: "1" - status: - type: string - example: "S" + example: 1544433328000 required: - - createTime - - tranId - - type + - from + - to - asset - - amount - - status + - qty + - tranId + - time required: - - total - - rows + - success + - futuresType + - transfers '400': description: Bad Request content: @@ -8050,13 +8105,27 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/account/apiRestrictions: - get: - summary: Get API Key Permission (USER_DATA) - description: 'Weight(IP): 1' + post: + summary: Sub-account Futures Asset Transfer (For Master Account) + description: |- + - Master account can transfer max 2000 times a minute + + Weight(IP): 1 tags: - - Wallet + - Sub-Account parameters: + - $ref: '#/components/parameters/subAccountFromEmail' + - $ref: '#/components/parameters/subAccountToEmail' + - name: futuresType + in: query + required: true + description: '1:USDT-margined Futures,2: Coin-margined Futures' + schema: + type: integer + format: int32 + example: 2 + - $ref: '#/components/parameters/asset' + - $ref: '#/components/parameters/amount' - $ref: '#/components/parameters/recvWindow' - $ref: '#/components/parameters/timestamp' - $ref: '#/components/parameters/signature' @@ -8064,68 +8133,20 @@ paths: - ApiKeyAuth: [] responses: '200': - description: API Key permissions + description: Futures Asset Transfer Info content: application/json: schema: type: object properties: - ipRestrict: - type: boolean - example: false - createTime: - type: integer - format: int64 - example: 1623840271000 - enableInternalTransfer: - type: boolean - description: This option authorizes this key to transfer funds between your master account and your sub account instantly - enableFutures: - type: boolean - example: false - description: API Key created before your futures account opened does not support futures API service - enablePortfolioMarginTrading: - type: boolean - example: false - description: API Key created before your activate portfolio margin does not support portfolio margin API service - enableVanillaOptions: - type: boolean - example: false - description: Authorizes this key to Vanilla options trading - permitsUniversalTransfer: - type: boolean - description: Authorizes this key to be used for a dedicated universal transfer API to transfer multiple supported currencies. Each business's own transfer API rights are not affected by this authorization - enableReading: - type: boolean - example: true - enableSpotAndMarginTrading: - type: boolean - example: false - enableWithdrawals: - type: boolean - example: false - description: This option allows you to withdraw via API. You must apply the IP Access Restriction filter in order to enable withdrawals - enableMargin: + success: type: boolean - example: false - description: This option can be adjusted after the Cross Margin account transfer is completed - tradingAuthorityExpirationTime: - type: integer - format: int64 - example: 1628985600000 - description: Expiration time for spot and margin trading permission + txnId: + type: string + example: "2934662589" required: - - ipRestrict - - createTime - - enableWithdrawals - - enableInternalTransfer - - permitsUniversalTransfer - - enableVanillaOptions - - enableReading - - enableFutures - - enableMargin - - enableSpotAndMarginTrading - - tradingAuthorityExpirationTime + - success + - txnId '400': description: Bad Request content: @@ -8138,94 +8159,52 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/capital/contract/convertible-coins: + /sapi/v3/sub-account/assets: get: - summary: Query auto-converting stable coins (USER_DATA) + summary: Sub-account Assets (For Master Account) description: |- - Get a user's auto-conversion settings in deposit/withdrawal + Fetch sub-account assets - Weight(UID): 600' + Weight(IP): 1 tags: - - Wallet + - Sub-Account + parameters: + - $ref: '#/components/parameters/subAccountEmail' + - $ref: '#/components/parameters/recvWindow' + - $ref: '#/components/parameters/timestamp' + - $ref: '#/components/parameters/signature' security: - ApiKeyAuth: [] responses: '200': - description: User's auto-conversion settings i + description: List of assets balances content: application/json: schema: type: object properties: - convertEnabled: - type: boolean - coins: + balances: type: array items: - type: string - example: "USDC" - exchangeRates: - type: object - properties: - USDC: - type: string - example: "1" - TUSD: - type: string - example: "1" - USDP: - type: string - example: "1" - required: - - USDC - - TUSD - - USDP + type: object + properties: + asset: + type: string + example: "ADA" + free: + type: integer + format: int64 + example: 10000 + locked: + type: integer + format: int64 + example: 0 + required: + - asset + - free + - locked required: - - convertEnabled - - coins - - exchangeRates - '400': - description: Bad Request - content: - application/json: - schema: - $ref: '#/components/schemas/error' - '401': - description: Unauthorized Request - content: - application/json: - schema: - $ref: '#/components/schemas/error' - post: - summary: Switch on/off BUSD and stable coins conversion (USER_DATA) (USER_DATA) - description: |- - User can use it to turn on or turn off the BUSD auto-conversion from/to a specific stable coin. - - Weight(UID): 600' - tags: - - Wallet - parameters: - - name: coin - in: query - required: true - description: "Must be USDC, USDP or TUSD" - schema: - type: string - - name: enable - in: query - required: true - description: "true: turn on the auto-conversion. false: turn off the auto-conversion" - schema: - type: boolean - security: - - ApiKeyAuth: [] - responses: - '200': - description: OK - content: - application/json: - schema: - type: object + - balances '400': description: Bad Request content: @@ -8238,23 +8217,24 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/sub-account/virtualSubAccount: - post: - summary: Create a Virtual Sub-account(For Master Account) + /sapi/v1/sub-account/spotSummary: + get: + summary: Sub-account Spot Assets Summary (For Master Account) description: |- - - This request will generate a virtual sub account under your master account. - - You need to enable "trade" option for the api key which requests this endpoint. + Get BTC valued asset summary of subaccounts. Weight(IP): 1 tags: - Sub-Account parameters: - - name: subAccountString + - $ref: '#/components/parameters/optionalSubAccountEmail' + - $ref: '#/components/parameters/page' + - name: size in: query - description: Please input a string. We will create a virtual email using that string for you to register - required: true + description: Default:10 Max:20 schema: - type: string + type: integer + format: int32 - $ref: '#/components/parameters/recvWindow' - $ref: '#/components/parameters/timestamp' - $ref: '#/components/parameters/signature' @@ -8262,17 +8242,37 @@ paths: - ApiKeyAuth: [] responses: '200': - description: Return the created virtual email + description: Summary of Sub-account Spot Assets content: application/json: schema: type: object properties: - email: + totalCount: + type: integer + format: int64 + example: 1 + masterAccountTotalAsset: type: string - example: "addsdd_virtual@aasaixwqnoemail.com" + example: "0.23231201" + spotSubUserAssetBtcVoList: + type: array + items: + type: object + properties: + email: + type: string + example: "sub123@test.com" + totalAsset: + type: string + example: "9999.00000000" + required: + - email + - totalAsset required: - - email + - totalCount + - masterAccountTotalAsset + - spotSubUserAssetBtcVoList '400': description: Bad Request content: @@ -8285,27 +8285,19 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/sub-account/list: + /sapi/v1/capital/deposit/subAddress: get: - summary: Query Sub-account List (For Master Account) - description: 'Weight(IP): 1' + summary: Sub-account Spot Assets Summary (For Master Account) + description: |- + Fetch sub-account deposit address + + Weight(IP): 1 tags: - Sub-Account parameters: - - $ref: '#/components/parameters/optionalSubAccountEmail' - - name: isFreeze - in: query - schema: - type: string - enum: ['true', 'false'] - - $ref: '#/components/parameters/page' - - name: limit - in: query - description: Default 1; max 200 - schema: - type: integer - format: int32 - example: 1 + - $ref: '#/components/parameters/subAccountEmail' + - $ref: '#/components/parameters/coin' + - $ref: '#/components/parameters/network' - $ref: '#/components/parameters/recvWindow' - $ref: '#/components/parameters/timestamp' - $ref: '#/components/parameters/signature' @@ -8313,41 +8305,29 @@ paths: - ApiKeyAuth: [] responses: '200': - description: List of sub-accounts + description: Deposit address info content: application/json: schema: type: object properties: - subAccounts: - type: array - items: - type: object - properties: - email: - type: string - example: "testsub@gmail.com" - isFreeze: - type: boolean - example: false - createTime: - type: integer - format: int64 - example: 1544433328000 - isManagedSubAccount: - type: boolean - example: false - isAssetManagementSubAccount: - type: boolean - example: false - required: - - email - - isFreeze - - createTime - - isManagedSubAccount - - isAssetManagementSubAccount + address: + type: string + example: "TDunhSa7jkTNuKrusUTU1MUHtqXoBPKETV" + coin: + type: string + example: "USDT" + tag: + type: string + example: "" + url: + type: string + example: "https://tronscan.org/#/address/TDunhSa7jkTNuKrusUTU1MUHtqXoBPKETV" required: - - subAccounts + - address + - coin + - tag + - url '400': description: Bad Request content: @@ -8360,29 +8340,32 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/sub-account/sub/transfer/history: + /sapi/v1/capital/deposit/subHisrec: get: - summary: Sub-account Spot Asset Transfer History (For Master Account) + summary: Sub-account Deposit History (For Master Account) description: |- - - fromEmail and toEmail cannot be sent at the same time. - - Return fromEmail equal master account email by default. + Fetch sub-account deposit history Weight(IP): 1 tags: - Sub-Account parameters: - - $ref: '#/components/parameters/optionalSubAccountFromEmail' - - $ref: '#/components/parameters/optionalSubAccountToEmail' + - $ref: '#/components/parameters/subAccountEmail' + - $ref: '#/components/parameters/optionalCoin' + - name: status + in: query + description: '0(0:pending,6: credited but cannot withdraw, 1:success)' + schema: + type: integer + format: int32 - $ref: '#/components/parameters/startTime' - $ref: '#/components/parameters/endTime' - - $ref: '#/components/parameters/page' - name: limit in: query - description: Default 1 schema: type: integer - format: int32 - example: 1 + format: int64 + - $ref: '#/components/parameters/offset' - $ref: '#/components/parameters/recvWindow' - $ref: '#/components/parameters/timestamp' - $ref: '#/components/parameters/signature' @@ -8390,7 +8373,7 @@ paths: - ApiKeyAuth: [] responses: '200': - description: Sub-account Spot Asset Transfer History + description: Sub-account deposit history content: application/json: schema: @@ -8398,37 +8381,50 @@ paths: items: type: object properties: - from: - type: string - example: aaa@test.com - to: + amount: type: string - example: bbb@test.com - asset: + example: "0.00999800" + coin: type: string - example: BTC - qty: + example: "PAXG" + network: type: string - example: 10 + example: "ETH" status: + type: integer + format: int32 + example: 1 + address: type: string - example: SUCCESS - tranId: + example: "0x788cabe9236ce061e5a892e1a59395a81fc8d62c" + addressTag: + type: string + example: "" + txId: + type: string + example: "0xaad4654a3234aa6118af9b4b335f5ae81c360b2394721c019b5d1e75328b09f3" + insertTime: type: integer format: int64 - example: 6489943656 - time: + example: 1599621997000 + transferType: type: integer - format: int64 - example: 1544433328000 + format: int32 + example: 0 + confirmTimes: + type: string + example: "12/12" required: - - from - - to - - asset - - qty + - amount + - coin + - network - status - - tranId - - time + - address + - addressTag + - txId + - insertTime + - transferType + - confirmTimes '400': description: Bad Request content: @@ -8441,31 +8437,37 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/sub-account/futures/internalTransfer: - get: - summary: Sub-account Futures Asset Transfer History (For Master Account) - description: 'Weight(IP): 1' + /sapi/v1/capital/deposit/credit-apply: + post: + summary: One click arrival deposit apply (USER_DATA) + description: |- + Apply deposit credit for expired address (One click arrival) + + Weight(IP): 1 tags: - - Sub-Account + - Wallet parameters: - - $ref: '#/components/parameters/subAccountEmail' - - name: futuresType + - name: depositId in: query - description: '1:USDT-margined Futures, 2: Coin-margined Futures' - required: true + description: Deposit record Id, priority use schema: type: integer - format: int32 - example: 2 - - $ref: '#/components/parameters/startTime' - - $ref: '#/components/parameters/endTime' - - $ref: '#/components/parameters/page' - - name: limit + format: int64 + - name: txId + in: query + description: Deposit txId, used when depositId is not specified + schema: + type: string + - name: subAccountId in: query - description: 'Default value: 50, Max value: 500' schema: type: integer - format: int32 + format: int64 + - name: subUserId + in: query + schema: + type: integer + format: int64 - $ref: '#/components/parameters/recvWindow' - $ref: '#/components/parameters/timestamp' - $ref: '#/components/parameters/signature' @@ -8473,54 +8475,29 @@ paths: - ApiKeyAuth: [] responses: '200': - description: Sub-account Futures Asset Transfer History + description: deposit result content: application/json: schema: type: object properties: + code: + type: string + example: "000000" + message: + type: string + example: "success" + data: + type: boolean + example: true success: type: boolean - futuresType: - type: integer - format: int32 - example: 2 - transfers: - type: array - items: - type: object - properties: - from: - type: string - example: "aaa@test.com" - to: - type: string - example: "bbb@test.com" - asset: - type: string - example: "BTC" - qty: - type: string - example: "1" - tranId: - type: integer - format: int64 - example: 11897001102 - time: - type: integer - format: int64 - example: 1544433328000 - required: - - from - - to - - asset - - qty - - tranId - - time + example: true required: + - code + - message + - data - success - - futuresType - - transfers '400': description: Bad Request content: @@ -8533,27 +8510,16 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - post: - summary: Sub-account Futures Asset Transfer (For Master Account) + /sapi/v1/asset/wallet/balance: + get: + summary: Query User Wallet Balance (USER_DATA) description: |- - - Master account can transfer max 2000 times a minute + Query User Wallet Balance - Weight(IP): 1 + Weight(IP): 60 tags: - - Sub-Account + - Wallet parameters: - - $ref: '#/components/parameters/subAccountFromEmail' - - $ref: '#/components/parameters/subAccountToEmail' - - name: futuresType - in: query - required: true - description: '1:USDT-margined Futures,2: Coin-margined Futures' - schema: - type: integer - format: int32 - example: 2 - - $ref: '#/components/parameters/asset' - - $ref: '#/components/parameters/amount' - $ref: '#/components/parameters/recvWindow' - $ref: '#/components/parameters/timestamp' - $ref: '#/components/parameters/signature' @@ -8561,20 +8527,27 @@ paths: - ApiKeyAuth: [] responses: '200': - description: Futures Asset Transfer Info + description: wallet balance content: application/json: schema: - type: object - properties: - success: - type: boolean - txnId: - type: string - example: "2934662589" - required: - - success - - txnId + type: array + items: + type: object + properties: + activate: + type: boolean + example: true + balance: + type: string + example: "0" + walletName: + type: string + example: "Spot" + required: + - activate + - balance + - walletName '400': description: Bad Request content: @@ -8587,17 +8560,44 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v3/sub-account/assets: + /sapi/v1/asset/custody/transfer-history: get: - summary: Sub-account Assets (For Master Account) + summary: Query User Delegation History(For Master Account) (USER_DATA) description: |- - Fetch sub-account assets + Query User Delegation History - Weight(IP): 1 + Weight(IP): 60 tags: - - Sub-Account + - Wallet parameters: - - $ref: '#/components/parameters/subAccountEmail' + - name: email + in: query + required: true + schema: + type: string + example: "alice@test.com" + - name: startTime + in: query + required: true + schema: + type: integer + format: int64 + example: 1695205406000 + - name: endTime + in: query + required: true + schema: + type: integer + format: int64 + example: 1695205396000 + - name: type + in: query + schema: + type: string + example: "Delegate" + - $ref: '#/components/parameters/asset' + - $ref: '#/components/parameters/current' + - $ref: '#/components/parameters/size' - $ref: '#/components/parameters/recvWindow' - $ref: '#/components/parameters/timestamp' - $ref: '#/components/parameters/signature' @@ -8605,34 +8605,45 @@ paths: - ApiKeyAuth: [] responses: '200': - description: List of assets balances + description: Delegation History content: application/json: schema: type: object properties: - balances: + total: + type: integer + example: 3316 + rows: type: array items: type: object properties: + clientTranId: + type: string + example: "293915932290879488" + transferType: + type: string + example: "Undelegate" asset: type: string - example: "ADA" - free: - type: integer - format: int64 - example: 10000 - locked: + example: "ETH" + amount: + type: string + example: "1" + time: type: integer format: int64 - example: 0 + example: 1695205406000 required: + - clientTranId + - transferType - asset - - free - - locked + - amount + - time required: - - balances + - total + - rows '400': description: Bad Request content: @@ -8645,24 +8656,27 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/sub-account/spotSummary: + /sapi/v1/capital/deposit/address/list: get: - summary: Sub-account Spot Assets Summary (For Master Account) + summary: Fetch deposit address list with network (USER_DATA) description: |- - Get BTC valued asset summary of subaccounts. + Fetch deposit address list with network. - Weight(IP): 1 + Weight(IP): 10 tags: - - Sub-Account + - Wallet parameters: - - $ref: '#/components/parameters/optionalSubAccountEmail' - - $ref: '#/components/parameters/page' - - name: size + - name: coin in: query - description: Default:10 Max:20 + required: true schema: - type: integer - format: int32 + type: string + example: "BTC" + - name: network + in: query + schema: + type: string + example: "BTC" - $ref: '#/components/parameters/recvWindow' - $ref: '#/components/parameters/timestamp' - $ref: '#/components/parameters/signature' @@ -8670,37 +8684,28 @@ paths: - ApiKeyAuth: [] responses: '200': - description: Summary of Sub-account Spot Assets + description: Coin address content: application/json: schema: - type: object - properties: - totalCount: - type: integer - format: int64 - example: 1 - masterAccountTotalAsset: - type: string - example: "0.23231201" - spotSubUserAssetBtcVoList: - type: array - items: - type: object - properties: - email: - type: string - example: "sub123@test.com" - totalAsset: - type: string - example: "9999.00000000" - required: - - email - - totalAsset - required: - - totalCount - - masterAccountTotalAsset - - spotSubUserAssetBtcVoList + type: array + items: + type: object + properties: + coin: + type: string + example: "ETH" + address: + type: string + example: "0xD316E95Fd9E8E237Cb11f8200Babbc5D8D177BA4" + isDefault: + type: integer + format: int32 + example: 1 + required: + - coin + - address + - isDefault '400': description: Bad Request content: @@ -8713,19 +8718,16 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/capital/deposit/subAddress: + /sapi/v1/spot/delist-schedule: get: - summary: Sub-account Spot Assets Summary (For Master Account) + summary: Get symbols delist schedule for spot (MARKET_DATA) description: |- - Fetch sub-account deposit address + Get symbols delist schedule for spot - Weight(IP): 1 + Weight(IP): 100 tags: - - Sub-Account + - Wallet parameters: - - $ref: '#/components/parameters/subAccountEmail' - - $ref: '#/components/parameters/coin' - - $ref: '#/components/parameters/network' - $ref: '#/components/parameters/recvWindow' - $ref: '#/components/parameters/timestamp' - $ref: '#/components/parameters/signature' @@ -8733,29 +8735,28 @@ paths: - ApiKeyAuth: [] responses: '200': - description: Deposit address info + description: Symbols delist schedule content: application/json: schema: - type: object - properties: - address: - type: string - example: "TDunhSa7jkTNuKrusUTU1MUHtqXoBPKETV" - coin: - type: string - example: "USDT" - tag: - type: string - example: "" - url: - type: string - example: "https://tronscan.org/#/address/TDunhSa7jkTNuKrusUTU1MUHtqXoBPKETV" - required: - - address - - coin - - tag - - url + type: array + items: + type: object + properties: + delistTime: + type: integer + format: int64 + example: 1686161202000 + symbol: + type: array + items: + type: string + example: + - "ADAUSDT" + - "BNBUSDT" + required: + - delistTime + - symbol '400': description: Bad Request content: @@ -8768,40 +8769,20 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/capital/deposit/subHisrec: + /sapi/v1/capital/withdraw/address/list: get: - summary: Sub-account Deposit History (For Master Account) + summary: Fetch withdraw address list (USER_DATA) description: |- - Fetch sub-account deposit history + Fetch withdraw address list - Weight(IP): 1 + Weight(IP): 10 tags: - - Sub-Account - parameters: - - $ref: '#/components/parameters/subAccountEmail' - - $ref: '#/components/parameters/optionalCoin' - - name: status - in: query - description: '0(0:pending,6: credited but cannot withdraw, 1:success)' - schema: - type: integer - format: int32 - - $ref: '#/components/parameters/startTime' - - $ref: '#/components/parameters/endTime' - - name: limit - in: query - schema: - type: integer - format: int64 - - $ref: '#/components/parameters/offset' - - $ref: '#/components/parameters/recvWindow' - - $ref: '#/components/parameters/timestamp' - - $ref: '#/components/parameters/signature' + - Wallet security: - ApiKeyAuth: [] responses: '200': - description: Sub-account deposit history + description: Withdraw address list content: application/json: schema: @@ -8809,50 +8790,39 @@ paths: items: type: object properties: - amount: + address: type: string - example: "0.00999800" + example: "0xD316E95Fd9E8E237Cb11f8200Babbc5D8D177BA4" + addressTag: + type: string + example: "101764890" coin: type: string - example: "PAXG" - network: + example: "BNB" + name: type: string - example: "ETH" - status: - type: integer - format: int32 - example: 1 - address: + example: "" + network: type: string - example: "0x788cabe9236ce061e5a892e1a59395a81fc8d62c" - addressTag: + example: "BNB" + origin: type: string example: "" - txId: - type: string - example: "0xaad4654a3234aa6118af9b4b335f5ae81c360b2394721c019b5d1e75328b09f3" - insertTime: - type: integer - format: int64 - example: 1599621997000 - transferType: - type: integer - format: int32 - example: 0 - confirmTimes: + originType: type: string - example: "12/12" + example: "" + whiteStatus: + type: boolean + example: true required: - - amount - - coin - - network - - status - address - addressTag - - txId - - insertTime - - transferType - - confirmTimes + - coin + - name + - network + - origin + - originType + - whiteStatus '400': description: Bad Request content: @@ -8865,37 +8835,16 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/capital/deposit/credit-apply: - post: - summary: One click arrival deposit apply (USER_DATA) + /sapi/v1/account/info: + get: + summary: Account info (USER_DATA) description: |- - Apply deposit credit for expired address (One click arrival) + Fetch account info detail. Weight(IP): 1 tags: - Wallet parameters: - - name: depositId - in: query - description: Deposit record Id, priority use - schema: - type: integer - format: int64 - - name: txId - in: query - description: Deposit txId, used when depositId is not specified - schema: - type: string - - name: subAccountId - in: query - schema: - type: integer - format: int64 - - name: subUserId - in: query - schema: - type: integer - format: int64 - $ref: '#/components/parameters/recvWindow' - $ref: '#/components/parameters/timestamp' - $ref: '#/components/parameters/signature' @@ -8903,237 +8852,28 @@ paths: - ApiKeyAuth: [] responses: '200': - description: deposit result + description: Account info detail content: application/json: schema: type: object properties: - code: - type: string - example: "000000" - message: - type: string - example: "success" - data: + vipLevel: + type: integer + format: int32 + example: 0 + isMarginEnabled: type: boolean + description: true or false for margin. example: true - success: + isFutureEnabled: type: boolean + description: true or false for futures. example: true required: - - code - - message - - data - - success - '400': - description: Bad Request - content: - application/json: - schema: - $ref: '#/components/schemas/error' - '401': - description: Unauthorized Request - content: - application/json: - schema: - $ref: '#/components/schemas/error' - /sapi/v1/asset/wallet/balance: - get: - summary: Query User Wallet Balance (USER_DATA) - description: |- - Query User Wallet Balance - - Weight(IP): 60 - tags: - - Wallet - parameters: - - $ref: '#/components/parameters/recvWindow' - - $ref: '#/components/parameters/timestamp' - - $ref: '#/components/parameters/signature' - security: - - ApiKeyAuth: [] - responses: - '200': - description: wallet balance - content: - application/json: - schema: - type: array - items: - type: object - properties: - activate: - type: boolean - example: true - balance: - type: string - example: "0" - walletName: - type: string - example: "Spot" - required: - - activate - - balance - - walletName - '400': - description: Bad Request - content: - application/json: - schema: - $ref: '#/components/schemas/error' - '401': - description: Unauthorized Request - content: - application/json: - schema: - $ref: '#/components/schemas/error' - /sapi/v1/asset/custody/transfer-history: - get: - summary: Query User Delegation History(For Master Account) (USER_DATA) - description: |- - Query User Delegation History - - Weight(IP): 60 - tags: - - Wallet - parameters: - - name: email - in: query - required: true - schema: - type: string - example: "alice@test.com" - - name: startTime - in: query - required: true - schema: - type: integer - format: int64 - example: 1695205406000 - - name: endTime - in: query - required: true - schema: - type: integer - format: int64 - example: 1695205396000 - - name: type - in: query - schema: - type: string - example: "Delegate" - - $ref: '#/components/parameters/asset' - - $ref: '#/components/parameters/current' - - $ref: '#/components/parameters/size' - - $ref: '#/components/parameters/recvWindow' - - $ref: '#/components/parameters/timestamp' - - $ref: '#/components/parameters/signature' - security: - - ApiKeyAuth: [] - responses: - '200': - description: Delegation History - content: - application/json: - schema: - type: object - properties: - total: - type: integer - example: 3316 - rows: - type: array - items: - type: object - properties: - clientTranId: - type: string - example: "293915932290879488" - transferType: - type: string - example: "Undelegate" - asset: - type: string - example: "ETH" - amount: - type: string - example: "1" - time: - type: integer - format: int64 - example: 1695205406000 - required: - - clientTranId - - transferType - - asset - - amount - - time - required: - - total - - rows - '400': - description: Bad Request - content: - application/json: - schema: - $ref: '#/components/schemas/error' - '401': - description: Unauthorized Request - content: - application/json: - schema: - $ref: '#/components/schemas/error' - /sapi/v1/capital/deposit/address/list: - get: - summary: Fetch deposit address list with network (USER_DATA) - description: |- - Fetch deposit address list with network. - - Weight(IP): 10 - tags: - - Wallet - parameters: - - name: coin - in: query - required: true - schema: - type: string - example: "BTC" - - name: network - in: query - schema: - type: string - example: "BTC" - - $ref: '#/components/parameters/recvWindow' - - $ref: '#/components/parameters/timestamp' - - $ref: '#/components/parameters/signature' - security: - - ApiKeyAuth: [] - responses: - '200': - description: Coin address - content: - application/json: - schema: - type: array - items: - type: object - properties: - coin: - type: string - example: "ETH" - address: - type: string - example: "0xD316E95Fd9E8E237Cb11f8200Babbc5D8D177BA4" - isDefault: - type: integer - format: int32 - example: 1 - required: - - coin - - address - - isDefault + - vipLevel + - isMarginEnabled + - isFutureEnabled '400': description: Bad Request content: @@ -12480,106 +12220,135 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/staking/productList: + /sapi/v1/mining/pub/algoList: get: - summary: Get Staking Product List (USER_DATA) - description: |- - Get available Staking product list. - - Weight(IP): 1 - tags: - - Staking - parameters: - - $ref: '#/components/parameters/product' - - $ref: '#/components/parameters/optionalAsset' - - $ref: '#/components/parameters/current' - - $ref: '#/components/parameters/size' - - $ref: '#/components/parameters/recvWindow' - - $ref: '#/components/parameters/timestamp' - - $ref: '#/components/parameters/signature' + summary: Acquiring Algorithm (MARKET_DATA) + description: 'Weight(IP): 1' security: - ApiKeyAuth: [] + tags: + - Mining responses: '200': - description: Product list. + description: Algorithm information content: application/json: schema: - type: array - items: - type: object - properties: - projectId: - type: string - example: Axs*90 - detail: + type: object + properties: + code: + type: integer + format: int64 + example: 0 + msg: + type: string + example: "" + data: + type: array + items: type: object properties: - asset: - type: string - example: AXS - rewardAsset: + algoName: type: string - example: AXS - duration: + example: "sha256" + algoId: type: integer format: int64 - example: 90 - renewable: - type: boolean - example: true - apy: - type: string - example: '1.2069' - required: - - asset - - rewardAsset - - duration - - renewable - - apy - quota: - type: object - properties: - totalPersonalQuota: - type: string - example: '2' - minimum: + example: 1 + poolIndex: + type: integer + format: int64 + example: 0 + unit: type: string - example: '0.001' + example: "h/s" required: - - totalPersonalQuota - - minimum - required: - - projectId - - detail - - quota + - algoName + - algoId + - poolIndex + - unit + required: + - code + - msg + - data '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/error' - '401': - description: Unauthorized Request + /sapi/v1/mining/pub/coinList: + get: + summary: Acquiring CoinName (MARKET_DATA) + description: 'Weight(IP): 1' + security: + - ApiKeyAuth: [] + tags: + - Mining + responses: + '200': + description: Coin information + content: + application/json: + schema: + type: object + properties: + code: + type: integer + format: int64 + example: 0 + msg: + type: string + example: "" + data: + type: array + items: + type: object + properties: + coinName: + type: string + example: "BTC" + coinId: + type: integer + format: int64 + example: 1 + poolIndex: + type: integer + format: int64 + example: 0 + algoId: + type: integer + format: int64 + example: 1 + algoName: + type: string + example: "sha256" + required: + - coinName + - coinId + - poolIndex + - algoId + - algoName + required: + - code + - msg + - data + '400': + description: Bad Request content: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/staking/purchase: - post: - summary: Purchase Staking Product (USER_DATA) - description: 'Weight(IP): 1' + /sapi/v1/mining/worker/detail: + get: + summary: Request for Detail Miner List (USER_DATA) + description: 'Weight(IP): 5' tags: - - Staking + - Mining parameters: - - $ref: '#/components/parameters/product' - - $ref: '#/components/parameters/productId' - - $ref: '#/components/parameters/amount' - - name: renewable - in: query - description: true or false, default false. Active if product is `STAKING` or `L_DEFI` - schema: - type: string + - $ref: '#/components/parameters/algo' + - $ref: '#/components/parameters/userName' + - $ref: '#/components/parameters/workerName' - $ref: '#/components/parameters/recvWindow' - $ref: '#/components/parameters/timestamp' - $ref: '#/components/parameters/signature' @@ -12587,21 +12356,61 @@ paths: - ApiKeyAuth: [] responses: '200': - description: Position Id. + description: List of workers' hashrates' content: application/json: schema: type: object properties: - positionId: + code: + type: integer + format: int64 + example: 0 + msg: type: string - example: '12345' - success: - type: boolean - example: true + example: "" + data: + type: array + items: + type: object + properties: + workerName: + type: string + example: "bhdc1.16A10404B" + description: Mining Account name + type: + type: string + example: "H_hashrate" + description: Type of hourly hashrate + hashrateDatas: + type: array + items: + type: object + properties: + time: + type: integer + format: int64 + example: 1587902400000 + hashrate: + type: string + example: "0" + reject: + type: integer + format: int64 + example: 0 + description: Rejection Rate + required: + - time + - hashrate + - reject + required: + - workerName + - type + - hashrateDatas required: - - positionId - - success + - code + - msg + - data '400': description: Bad Request content: @@ -12614,29 +12423,19 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/staking/redeem: - post: - summary: Redeem Staking Product (USER_DATA) - description: |- - Redeem Staking product. Locked staking and Locked DeFI staking belong to early redemption, redeeming in advance will result in loss of interest that you have earned. - - Weight(IP): 1 + /sapi/v1/mining/worker/list: + get: + summary: Request for Miner List (USER_DATA) + description: 'Weight(IP): 5' tags: - - Staking + - Mining parameters: - - $ref: '#/components/parameters/product' - - name: positionId - in: query - description: Mandatory if product is `STAKING` or `L_DEFI` - schema: - type: string - - $ref: '#/components/parameters/productId' - - name: amount - in: query - description: Mandatory if product is `F_DEFI` - schema: - type: number - format: double + - $ref: '#/components/parameters/algo' + - $ref: '#/components/parameters/userName' + - $ref: '#/components/parameters/pageIndex' + - $ref: '#/components/parameters/sort' + - $ref: '#/components/parameters/sortColumn' + - $ref: '#/components/parameters/workerStatus' - $ref: '#/components/parameters/recvWindow' - $ref: '#/components/parameters/timestamp' - $ref: '#/components/parameters/signature' @@ -12644,17 +12443,82 @@ paths: - ApiKeyAuth: [] responses: '200': - description: Success. + description: List of workers content: application/json: schema: type: object properties: - success: - type: boolean - example: true + code: + type: integer + format: int64 + example: 0 + msg: + type: string + example: "" + data: + type: object + properties: + workerDatas: + type: array + items: + type: object + properties: + workerId: + type: string + example: "1420554439452400131" + workerName: + type: string + example: "2X73" + status: + type: integer + format: int64 + example: 3 + description: "Status:1 valid, 2 invalid, 3 no longer valid" + hashRate: + type: integer + format: int64 + example: 0 + description: Real-time rate + dayHashRate: + type: integer + format: int64 + example: 0 + description: 24H Hashrate + rejectRate: + type: integer + format: int64 + example: 0 + description: Real-time Rejection Rate + lastShareTime: + type: integer + format: int64 + example: 1587712919000 + description: Last submission time + required: + - workerId + - workerName + - status + - hashRate + - dayHashRate + - rejectRate + - lastShareTime + totalNum: + type: integer + format: int64 + example: 18530 + pageSize: + type: integer + format: int64 + example: 20 + required: + - workerDatas + - totalNum + - pageSize required: - - success + - code + - msg + - data '400': description: Bad Request content: @@ -12667,21 +12531,20 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/staking/position: + /sapi/v1/mining/payment/list: get: - summary: Get Staking Product Position (USER_DATA) - description: 'Weight(IP): 1' + summary: Earnings List (USER_DATA) + description: 'Weight(IP): 5' tags: - - Staking + - Mining parameters: - - $ref: '#/components/parameters/product' - - name: productId - in: query - schema: - type: string - - $ref: '#/components/parameters/optionalAsset' - - $ref: '#/components/parameters/current' - - $ref: '#/components/parameters/size' + - $ref: '#/components/parameters/algo' + - $ref: '#/components/parameters/userName' + - $ref: '#/components/parameters/optionalCoin' + - $ref: '#/components/parameters/startDate' + - $ref: '#/components/parameters/endDate' + - $ref: '#/components/parameters/pageIndex' + - $ref: '#/components/parameters/pageSize' - $ref: '#/components/parameters/recvWindow' - $ref: '#/components/parameters/timestamp' - $ref: '#/components/parameters/signature' @@ -12689,119 +12552,93 @@ paths: - ApiKeyAuth: [] responses: '200': - description: Position. + description: List of earnings content: application/json: schema: - type: array - items: - type: object - properties: - positionId: - type: string - example: '123123' - projectId: - type: string - example: Axs*90 - asset: - type: string - example: AXS - amount: - type: string - example: '122.09202928' - purchaseTime: - type: string - example: '1646182276000' - duration: - type: string - example: '60' - accrualDays: - type: string - example: '4' - rewardAsset: - type: string - example: AXS - APY: - type: string - example: '0.2032' - rewardAmt: - type: string - example: '5.17181528' - extraRewardAsset: - type: string - example: BNB - extraRewardAPY: - type: string - example: '0.0203' - estExtraRewardAmt: - type: string - example: '5.17181528' - nextInterestPay: - type: string - example: '1.29295383' - nextInterestPayDate: - type: string - example: '1646697600000' - payInterestPeriod: - type: string - example: '1' - redeemAmountEarly: - type: string - example: '2802.24068892' - interestEndDate: - type: string - example: '1651449600000' - deliverDate: - type: string - example: '1651536000000' - redeemPeriod: - type: string - example: '1' - redeemingAmt: - type: string - example: '232.2323' - partialAmtDeliverDate: - type: string - example: '1651536000000' - canRedeemEarly: - type: boolean - example: true - renewable: - type: boolean - example: true - type: - type: string - example: AUTO - status: - type: string - example: HOLDING - required: - - positionId - - projectId - - asset - - amount - - purchaseTime - - duration - - accrualDays - - rewardAsset - - APY - - rewardAmt - - extraRewardAsset - - extraRewardAPY - - estExtraRewardAmt - - nextInterestPay - - nextInterestPayDate - - payInterestPeriod - - redeemAmountEarly - - interestEndDate - - deliverDate - - redeemPeriod - - redeemingAmt - - partialAmtDeliverDate - - canRedeemEarly - - renewable - - type - - status + type: object + properties: + code: + type: integer + format: int64 + example: 0 + msg: + type: string + example: "" + data: + type: object + properties: + accountProfits: + type: array + items: + type: object + properties: + time: + type: integer + format: int64 + example: 1586188800000 + description: Mining date + type: + type: integer + format: int64 + example: 31 + description: "0:Mining Wallet,5:Mining Address,7:Pool Savings,8:Transferred,31:Income Transfer ,32:Hashrate Resale-Mining Wallet 33:Hashrate Resale-Pool Savings" + hashTransfer: + type: integer + format: "nullable" + example: null + description: Transferred Hashrate + transferAmount: + type: number + format: "nullable" + example: null + description: Transferred Income + dayHashRate: + type: integer + format: int64 + example: 129129903378244 + description: Daily Hashrate + profitAmount: + type: number + format: double + example: 8.6083060304 + description: Earnings Amount + coinName: + type: string + example: "BTC" + description: Coin Type + status: + type: integer + format: int32 + example: 2 + description: "Status:0:Unpaid, 1:Paying 2:Paid" + required: + - time + - type + - hashTransfer + - transferAmount + - dayHashRate + - profitAmount + - coinName + - status + totalNum: + type: integer + format: int64 + example: 3 + description: Total Rows + pageSize: + type: integer + format: int64 + example: 20 + description: Rows per page + required: + - accountProfits + - totalNum + - pageSize + required: + - code + - msg + - data '400': description: Bad Request content: @@ -12814,119 +12651,20 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/staking/stakingRecord: + /sapi/v1/mining/payment/other: get: - summary: Get Staking History (USER_DATA) - description: 'Weight(IP): 1' - tags: - - Staking - parameters: - - $ref: '#/components/parameters/product' - - name: txnType - in: query - required: true - description: '`SUBSCRIPTION`, `REDEMPTION`, `INTEREST`' - schema: - type: string - - $ref: '#/components/parameters/optionalAsset' - - $ref: '#/components/parameters/startTime' - - $ref: '#/components/parameters/endTime' - - $ref: '#/components/parameters/current' - - $ref: '#/components/parameters/size' - - $ref: '#/components/parameters/recvWindow' - - $ref: '#/components/parameters/timestamp' - - $ref: '#/components/parameters/signature' - security: - - ApiKeyAuth: [] - responses: - '200': - description: Staking History. - content: - application/json: - schema: - type: array - items: - type: object - properties: - positionId: - type: string - example: '123123' - time: - type: integer - format: int64 - example: 1575018510000 - asset: - type: string - example: BNB - project: - type: string - example: BSC - amount: - type: string - example: '21312.23223' - lockPeriod: - type: string - example: '30' - deliverDate: - type: string - example: '1575018510000' - type: - type: string - example: AUTO - status: - type: string - example: success - required: - - positionId - - time - - asset - - project - - amount - - lockPeriod - - deliverDate - - type - - status - '400': - description: Bad Request - content: - application/json: - schema: - $ref: '#/components/schemas/error' - '401': - description: Unauthorized Request - content: - application/json: - schema: - $ref: '#/components/schemas/error' - /sapi/v1/staking/setAutoStaking: - post: - summary: Set Auto Staking (USER_DATA) - description: |- - Set auto staking on Locked Staking or Locked DeFi Staking - - Weight(IP): 1 + summary: Extra Bonus List (USER_DATA) + description: 'Weight(IP): 5' tags: - - Staking + - Mining parameters: - - name: product - in: query - required: true - description: |- - * `STAKING` - for Locked Staking - * `L_DEFI` - for locked DeFi Staking - schema: - type: string - - name: positionId - in: query - required: true - schema: - type: string - - name: renewable - in: query - required: true - description: true or false - schema: - type: string + - $ref: '#/components/parameters/algo' + - $ref: '#/components/parameters/userName' + - $ref: '#/components/parameters/optionalCoin' + - $ref: '#/components/parameters/startDate' + - $ref: '#/components/parameters/endDate' + - $ref: '#/components/parameters/pageIndex' + - $ref: '#/components/parameters/pageSize' - $ref: '#/components/parameters/recvWindow' - $ref: '#/components/parameters/timestamp' - $ref: '#/components/parameters/signature' @@ -12934,18 +12672,75 @@ paths: - ApiKeyAuth: [] responses: '200': - description: Success. + description: List of extra bonuses content: application/json: schema: type: object properties: - success: - type: boolean - example: true - required: - - success - '400': + code: + type: integer + format: int64 + example: 0 + msg: + type: string + example: "" + data: + type: object + properties: + otherProfits: + type: array + items: + type: object + properties: + time: + type: integer + format: int64 + example: 1607443200000 + description: Mining date + coinName: + type: string + example: "BTC" + description: Coin Name + type: + type: integer + format: int32 + example: 4 + description: '1: Merged Mining, 2: Activity Bonus, 3:Rebate 4:Smart Pool 6:Income Transfer 7:Pool Savings' + profitAmount: + type: number + format: double + example: 0.0011859 + status: + type: integer + format: int32 + example: 2 + description: '0:Unpaid, 1:Paying 2:Paid' + required: + - time + - coinName + - type + - profitAmount + - status + totalNum: + type: integer + format: int64 + example: 3 + description: Total Rows + pageSize: + type: integer + format: int64 + example: 20 + description: Rows per page + required: + - otherProfits + - totalNum + - pageSize + required: + - code + - msg + - data + '400': description: Bad Request content: application/json: @@ -12957,15 +12752,15 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/staking/personalLeftQuota: + /sapi/v1/mining/hash-transfer/config/details/list: get: - summary: Get Personal Left Quota of Staking Product (USER_DATA) - description: 'Weight(IP): 1' + summary: Hashrate Resale List (USER_DATA) + description: 'Weight(IP): 5' tags: - - Staking + - Mining parameters: - - $ref: '#/components/parameters/product' - - $ref: '#/components/parameters/productId' + - $ref: '#/components/parameters/pageIndex' + - $ref: '#/components/parameters/pageSize' - $ref: '#/components/parameters/recvWindow' - $ref: '#/components/parameters/timestamp' - $ref: '#/components/parameters/signature' @@ -12973,42 +12768,7 @@ paths: - ApiKeyAuth: [] responses: '200': - description: Quota. - content: - application/json: - schema: - type: array - items: - type: object - properties: - leftPersonalQuota: - type: string - example: '1000' - required: - - leftPersonalQuota - '400': - description: Bad Request - content: - application/json: - schema: - $ref: '#/components/schemas/error' - '401': - description: Unauthorized Request - content: - application/json: - schema: - $ref: '#/components/schemas/error' - /sapi/v1/mining/pub/algoList: - get: - summary: Acquiring Algorithm (MARKET_DATA) - description: 'Weight(IP): 1' - security: - - ApiKeyAuth: [] - tags: - - Mining - responses: - '200': - description: Algorithm information + description: List of hashrate resales content: application/json: schema: @@ -13022,29 +12782,71 @@ paths: type: string example: "" data: - type: array - items: - type: object - properties: - algoName: - type: string - example: "sha256" - algoId: - type: integer - format: int64 - example: 1 - poolIndex: - type: integer - format: int64 - example: 0 - unit: - type: string - example: "h/s" - required: - - algoName - - algoId - - poolIndex - - unit + type: object + properties: + configDetails: + type: array + items: + type: object + properties: + configId: + type: integer + format: int64 + example: 168 + description: Mining ID + poolUsername: + type: string + example: "123" + description: Transfer out of subaccount + toPoolUsername: + type: string + example: "user1" + description: Transfer into subaccount + algoName: + type: string + example: "Ethash" + description: Transfer algorithm + hashRate: + type: integer + format: int64 + example: 5000000 + description: Transferred Hashrate quantity + startDay: + type: integer + format: int64 + example: 20201210 + description: Start date + endDay: + type: integer + format: int64 + example: 20210405 + description: End date + status: + type: integer + format: int32 + example: 1 + description: "0 Processing, 1:Cancelled, 2:Terminated " + required: + - configId + - poolUsername + - toPoolUsername + - algoName + - hashRate + - startDay + - endDay + - status + totalNum: + type: integer + format: int64 + example: 21 + pageSize: + type: integer + format: int64 + example: 200 + required: + - configDetails + - totalNum + - pageSize required: - code - msg @@ -13055,17 +12857,31 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/mining/pub/coinList: + '401': + description: Unauthorized Request + content: + application/json: + schema: + $ref: '#/components/schemas/error' + /sapi/v1/mining/hash-transfer/profit/details: get: - summary: Acquiring CoinName (MARKET_DATA) - description: 'Weight(IP): 1' - security: - - ApiKeyAuth: [] + summary: Hashrate Resale Details (USER_DATA) + description: 'Weight(IP): 5' tags: - Mining + parameters: + - $ref: '#/components/parameters/configId' + - $ref: '#/components/parameters/userName' + - $ref: '#/components/parameters/pageIndex' + - $ref: '#/components/parameters/pageSize' + - $ref: '#/components/parameters/recvWindow' + - $ref: '#/components/parameters/timestamp' + - $ref: '#/components/parameters/signature' + security: + - ApiKeyAuth: [] responses: '200': - description: Coin information + description: List of hashrate resale details content: application/json: schema: @@ -13079,54 +12895,92 @@ paths: type: string example: "" data: - type: array - items: - type: object - properties: - coinName: - type: string - example: "BTC" - coinId: - type: integer - format: int64 - example: 1 - poolIndex: - type: integer - format: int64 - example: 0 - algoId: - type: integer - format: int64 - example: 1 - algoName: - type: string - example: "sha256" - required: - - coinName - - coinId - - poolIndex - - algoId - - algoName - required: - - code - - msg - - data - '400': - description: Bad Request - content: - application/json: - schema: - $ref: '#/components/schemas/error' - /sapi/v1/mining/worker/detail: - get: - summary: Request for Detail Miner List (USER_DATA) + type: object + properties: + profitTransferDetails: + type: array + items: + type: object + properties: + poolUsername: + type: string + example: "test4001" + description: Transfer out of sub-account + toPoolUsername: + type: string + example: "pop" + description: Transfer into subaccount + algoName: + type: string + example: "sha256" + description: Transfer algorithm + hashRate: + type: integer + format: int64 + example: 200000000000 + description: Transferred Hashrate quantity + day: + type: integer + format: int64 + example: 20201213 + description: Transfer date + amount: + type: number + format: double + example: 0.2256872 + description: Transfer income + coinName: + type: string + example: "BTC" + required: + - poolUsername + - toPoolUsername + - algoName + - hashRate + - day + - amount + - coinName + totalNum: + type: integer + format: int64 + example: 8 + pageSize: + type: integer + format: int64 + example: 200 + required: + - profitTransferDetails + - totalNum + - pageSize + required: + - code + - msg + - data + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/error' + '401': + description: Unauthorized Request + content: + application/json: + schema: + $ref: '#/components/schemas/error' + /sapi/v1/mining/hash-transfer/config: + post: + summary: Hashrate Resale Request (USER_DATA) description: 'Weight(IP): 5' tags: - Mining parameters: - - $ref: '#/components/parameters/algo' - $ref: '#/components/parameters/userName' - - $ref: '#/components/parameters/workerName' + - $ref: '#/components/parameters/algo' + - $ref: '#/components/parameters/startDate' + - $ref: '#/components/parameters/endDate' + - $ref: '#/components/parameters/toPoolUser' + - $ref: '#/components/parameters/hashRate' - $ref: '#/components/parameters/recvWindow' - $ref: '#/components/parameters/timestamp' - $ref: '#/components/parameters/signature' @@ -13134,7 +12988,7 @@ paths: - ApiKeyAuth: [] responses: '200': - description: List of workers' hashrates' + description: Mining Account Id content: application/json: schema: @@ -13148,43 +13002,10 @@ paths: type: string example: "" data: - type: array - items: - type: object - properties: - workerName: - type: string - example: "bhdc1.16A10404B" - description: Mining Account name - type: - type: string - example: "H_hashrate" - description: Type of hourly hashrate - hashrateDatas: - type: array - items: - type: object - properties: - time: - type: integer - format: int64 - example: 1587902400000 - hashrate: - type: string - example: "0" - reject: - type: integer - format: int64 - example: 0 - description: Rejection Rate - required: - - time - - hashrate - - reject - required: - - workerName - - type - - hashrateDatas + type: integer + format: int64 + example: 171 + description: Mining Account required: - code - msg @@ -13201,19 +13022,15 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/mining/worker/list: - get: - summary: Request for Miner List (USER_DATA) + /sapi/v1/mining/hash-transfer/config/cancel: + post: + summary: Cancel Hashrate Resale configuration (USER_DATA) description: 'Weight(IP): 5' tags: - Mining parameters: - - $ref: '#/components/parameters/algo' + - $ref: '#/components/parameters/configId' - $ref: '#/components/parameters/userName' - - $ref: '#/components/parameters/pageIndex' - - $ref: '#/components/parameters/sort' - - $ref: '#/components/parameters/sortColumn' - - $ref: '#/components/parameters/workerStatus' - $ref: '#/components/parameters/recvWindow' - $ref: '#/components/parameters/timestamp' - $ref: '#/components/parameters/signature' @@ -13221,7 +13038,7 @@ paths: - ApiKeyAuth: [] responses: '200': - description: List of workers + description: Success flag content: application/json: schema: @@ -13235,64 +13052,7 @@ paths: type: string example: "" data: - type: object - properties: - workerDatas: - type: array - items: - type: object - properties: - workerId: - type: string - example: "1420554439452400131" - workerName: - type: string - example: "2X73" - status: - type: integer - format: int64 - example: 3 - description: "Status:1 valid, 2 invalid, 3 no longer valid" - hashRate: - type: integer - format: int64 - example: 0 - description: Real-time rate - dayHashRate: - type: integer - format: int64 - example: 0 - description: 24H Hashrate - rejectRate: - type: integer - format: int64 - example: 0 - description: Real-time Rejection Rate - lastShareTime: - type: integer - format: int64 - example: 1587712919000 - description: Last submission time - required: - - workerId - - workerName - - status - - hashRate - - dayHashRate - - rejectRate - - lastShareTime - totalNum: - type: integer - format: int64 - example: 18530 - pageSize: - type: integer - format: int64 - example: 20 - required: - - workerDatas - - totalNum - - pageSize + type: boolean required: - code - msg @@ -13309,20 +13069,15 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/mining/payment/list: + /sapi/v1/mining/statistics/user/status: get: - summary: Earnings List (USER_DATA) + summary: Statistic List (USER_DATA) description: 'Weight(IP): 5' tags: - Mining parameters: - $ref: '#/components/parameters/algo' - $ref: '#/components/parameters/userName' - - $ref: '#/components/parameters/optionalCoin' - - $ref: '#/components/parameters/startDate' - - $ref: '#/components/parameters/endDate' - - $ref: '#/components/parameters/pageIndex' - - $ref: '#/components/parameters/pageSize' - $ref: '#/components/parameters/recvWindow' - $ref: '#/components/parameters/timestamp' - $ref: '#/components/parameters/signature' @@ -13330,7 +13085,7 @@ paths: - ApiKeyAuth: [] responses: '200': - description: List of earnings + description: Mining account statistics content: application/json: schema: @@ -13346,73 +13101,71 @@ paths: data: type: object properties: - accountProfits: - type: array - items: - type: object - properties: - time: - type: integer - format: int64 - example: 1586188800000 - description: Mining date - type: - type: integer - format: int64 - example: 31 - description: "0:Mining Wallet,5:Mining Address,7:Pool Savings,8:Transferred,31:Income Transfer ,32:Hashrate Resale-Mining Wallet 33:Hashrate Resale-Pool Savings" - hashTransfer: - type: integer - format: "nullable" - example: null - description: Transferred Hashrate - transferAmount: - type: number - format: "nullable" - example: null - description: Transferred Income - dayHashRate: - type: integer - format: int64 - example: 129129903378244 - description: Daily Hashrate - profitAmount: - type: number - format: double - example: 8.6083060304 - description: Earnings Amount - coinName: - type: string - example: "BTC" - description: Coin Type - status: - type: integer - format: int32 - example: 2 - description: "Status:0:Unpaid, 1:Paying 2:Paid" - required: - - time - - type - - hashTransfer - - transferAmount - - dayHashRate - - profitAmount - - coinName - - status - totalNum: + fifteenMinHashRate: + type: string + example: "457835490067496409.00000000" + dayHashRate: + type: string + example: "214289268068874127.65000000" + validNum: type: integer format: int64 - example: 3 - description: Total Rows - pageSize: + example: 0 + invalidNum: type: integer format: int64 - example: 20 - description: Rows per page + example: 17562 + profitToday: + type: object + properties: + BTC: + type: string + example: "0.00314332" + BSV: + type: string + example: "56.17055953" + BCH: + type: string + example: "106.61586001" + required: + - BTC + - BSV + - BCH + profitYesterday: + type: object + properties: + BTC: + type: string + example: "0.00314332" + BSV: + type: string + example: "56.17055953" + BCH: + type: string + example: "106.61586001" + required: + - BTC + - BSV + - BCH + userName: + type: string + example: "test" + unit: + type: string + example: "h/s" + algo: + type: string + example: "sha256" required: - - accountProfits - - totalNum - - pageSize + - fifteenMinHashRate + - dayHashRate + - validNum + - invalidNum + - profitToday + - profitYesterday + - userName + - unit + - algo required: - code - msg @@ -13429,16 +13182,93 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/mining/payment/other: + /sapi/v1/mining/statistics/user/list: get: - summary: Extra Bonus List (USER_DATA) + summary: Account List (USER_DATA) description: 'Weight(IP): 5' tags: - Mining parameters: - $ref: '#/components/parameters/algo' - $ref: '#/components/parameters/userName' - - $ref: '#/components/parameters/optionalCoin' + - $ref: '#/components/parameters/recvWindow' + - $ref: '#/components/parameters/timestamp' + - $ref: '#/components/parameters/signature' + security: + - ApiKeyAuth: [] + responses: + '200': + description: List of mining accounts + content: + application/json: + schema: + type: object + properties: + code: + type: integer + format: int64 + example: 0 + msg: + type: string + example: "" + data: + type: array + items: + type: object + properties: + type: + type: string + example: "H_hashrate" + userName: + type: string + example: "test" + list: + type: array + items: + type: object + properties: + time: + type: integer + format: int64 + example: 1585267200000 + hashrate: + type: string + example: "0.00000000" + reject: + type: string + example: "0.00000000" + required: + - time + - hashrate + - reject + required: + - type + - userName + - list + required: + - code + - msg + - data + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/error' + '401': + description: Unauthorized Request + content: + application/json: + schema: + $ref: '#/components/schemas/error' + /sapi/v1/mining/payment/uid: + get: + summary: Mining Account Earning (USER_DATA) + description: 'Weight(IP): 5' + tags: + - Mining + parameters: + - $ref: '#/components/parameters/algo' - $ref: '#/components/parameters/startDate' - $ref: '#/components/parameters/endDate' - $ref: '#/components/parameters/pageIndex' @@ -13450,7 +13280,7 @@ paths: - ApiKeyAuth: [] responses: '200': - description: List of extra bonuses + description: Mining account earnings content: application/json: schema: @@ -13458,7 +13288,7 @@ paths: properties: code: type: integer - format: int64 + format: int32 example: 0 msg: type: string @@ -13466,7 +13296,7 @@ paths: data: type: object properties: - otherProfits: + accountProfits: type: array items: type: object @@ -13475,43 +13305,43 @@ paths: type: integer format: int64 example: 1607443200000 - description: Mining date coinName: type: string example: "BTC" - description: Coin Name type: type: integer format: int32 - example: 4 - description: '1: Merged Mining, 2: Activity Bonus, 3:Rebate 4:Smart Pool 6:Income Transfer 7:Pool Savings' - profitAmount: - type: number - format: double - example: 0.0011859 - status: + description: "0:Referral 1:Refund 2:Rebate" + example: 2 + puid: type: integer format: int32 - example: 2 - description: '0:Unpaid, 1:Paying 2:Paid' + description: "puid" + example: 59985472 + subName: + type: string + description: "Mining account" + example: "vdvaghani" + amount: + type: number + example: 0.09186957 required: - time - coinName - type - - profitAmount - - status + - puid + - subName + - amount totalNum: type: integer - format: int64 + format: int32 example: 3 - description: Total Rows pageSize: type: integer - format: int64 + format: int32 example: 20 - description: Rows per page required: - - otherProfits + - accountProfits - totalNum - pageSize required: @@ -13530,15 +13360,25 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/mining/hash-transfer/config/details/list: - get: - summary: Hashrate Resale List (USER_DATA) - description: 'Weight(IP): 5' + /sapi/v1/futures/transfer: + post: + summary: New Future Account Transfer (USER_DATA) + description: |- + Execute transfer between spot account and futures account. + + Weight(IP): 1 tags: - - Mining + - Futures parameters: - - $ref: '#/components/parameters/pageIndex' - - $ref: '#/components/parameters/pageSize' + - $ref: '#/components/parameters/asset' + - $ref: '#/components/parameters/amount' + - name: type + in: query + required: true + description: "1: transfer from spot account to USDT-Ⓜ futures account. 2: transfer from USDT-Ⓜ futures account to spot account. 3: transfer from spot account to COIN-Ⓜ futures account. 4: transfer from COIN-Ⓜ futures account to spot account." + schema: + type: integer + format: int64 - $ref: '#/components/parameters/recvWindow' - $ref: '#/components/parameters/timestamp' - $ref: '#/components/parameters/signature' @@ -13546,89 +13386,18 @@ paths: - ApiKeyAuth: [] responses: '200': - description: List of hashrate resales + description: Futures Transfer content: application/json: schema: type: object properties: - code: + tranId: type: integer format: int64 - example: 0 - msg: - type: string - example: "" - data: - type: object - properties: - configDetails: - type: array - items: - type: object - properties: - configId: - type: integer - format: int64 - example: 168 - description: Mining ID - poolUsername: - type: string - example: "123" - description: Transfer out of subaccount - toPoolUsername: - type: string - example: "user1" - description: Transfer into subaccount - algoName: - type: string - example: "Ethash" - description: Transfer algorithm - hashRate: - type: integer - format: int64 - example: 5000000 - description: Transferred Hashrate quantity - startDay: - type: integer - format: int64 - example: 20201210 - description: Start date - endDay: - type: integer - format: int64 - example: 20210405 - description: End date - status: - type: integer - format: int32 - example: 1 - description: "0 Processing, 1:Cancelled, 2:Terminated " - required: - - configId - - poolUsername - - toPoolUsername - - algoName - - hashRate - - startDay - - endDay - - status - totalNum: - type: integer - format: int64 - example: 21 - pageSize: - type: integer - format: int64 - example: 200 - required: - - configDetails - - totalNum - - pageSize + example: 100000001 required: - - code - - msg - - data + - tranId '400': description: Bad Request content: @@ -13641,17 +13410,18 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/mining/hash-transfer/profit/details: get: - summary: Hashrate Resale Details (USER_DATA) - description: 'Weight(IP): 5' + summary: Get Future Account Transaction History List (USER_DATA) + description: |- + Weight(IP): 10 tags: - - Mining + - Futures parameters: - - $ref: '#/components/parameters/configId' - - $ref: '#/components/parameters/userName' - - $ref: '#/components/parameters/pageIndex' - - $ref: '#/components/parameters/pageSize' + - $ref: '#/components/parameters/asset' + - $ref: '#/components/parameters/startTimeReq' + - $ref: '#/components/parameters/endTime' + - $ref: '#/components/parameters/current' + - $ref: '#/components/parameters/size' - $ref: '#/components/parameters/recvWindow' - $ref: '#/components/parameters/timestamp' - $ref: '#/components/parameters/signature' @@ -13659,81 +13429,52 @@ paths: - ApiKeyAuth: [] responses: '200': - description: List of hashrate resale details + description: Futures Transfer Query content: application/json: schema: type: object properties: - code: + rows: + type: array + items: + type: object + properties: + asset: + type: string + example: "USDT" + tranId: + type: integer + format: int64 + example: 100000001 + amount: + type: string + example: "40.84624400" + type: + type: string + example: "1" + timestamp: + type: integer + format: int64 + example: 1555056425000 + status: + type: string + description: "one of PENDING (pending to execution), CONFIRMED (successfully transfered), FAILED (execution failed, nothing happened to your account);" + example: "CONFIRMED" + required: + - asset + - tranId + - amount + - type + - timestamp + - status + total: type: integer - format: int64 - example: 0 - msg: - type: string - example: "" - data: - type: object - properties: - profitTransferDetails: - type: array - items: - type: object - properties: - poolUsername: - type: string - example: "test4001" - description: Transfer out of sub-account - toPoolUsername: - type: string - example: "pop" - description: Transfer into subaccount - algoName: - type: string - example: "sha256" - description: Transfer algorithm - hashRate: - type: integer - format: int64 - example: 200000000000 - description: Transferred Hashrate quantity - day: - type: integer - format: int64 - example: 20201213 - description: Transfer date - amount: - type: number - format: double - example: 0.2256872 - description: Transfer income - coinName: - type: string - example: "BTC" - required: - - poolUsername - - toPoolUsername - - algoName - - hashRate - - day - - amount - - coinName - totalNum: - type: integer - format: int64 - example: 8 - pageSize: - type: integer - format: int64 - example: 200 - required: - - profitTransferDetails - - totalNum - - pageSize + format: int32 + example: 1 required: - - code - - msg - - data + - rows + - total '400': description: Bad Request content: @@ -13746,19 +13487,29 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/mining/hash-transfer/config: - post: - summary: Hashrate Resale Request (USER_DATA) - description: 'Weight(IP): 5' + /sapi/v1/futures/histDataLink: + get: + summary: Get Future TickLevel Orderbook Historical Data Download Link (USER_DATA) + description: |- + Weight(IP): 1 tags: - - Mining + - Futures parameters: - - $ref: '#/components/parameters/userName' - - $ref: '#/components/parameters/algo' - - $ref: '#/components/parameters/startDate' - - $ref: '#/components/parameters/endDate' - - $ref: '#/components/parameters/toPoolUser' - - $ref: '#/components/parameters/hashRate' + - name: symbol + in: query + required: true + schema: + type: string + example: "BTCUSDT" + - name: dataType + in: query + required: true + schema: + type: string + enum: ['T_DEPTH', 'S_DEPTH'] + example: "T_DEPTH" + - $ref: '#/components/parameters/startTime' + - $ref: '#/components/parameters/endTime' - $ref: '#/components/parameters/recvWindow' - $ref: '#/components/parameters/timestamp' - $ref: '#/components/parameters/signature' @@ -13766,27 +13517,27 @@ paths: - ApiKeyAuth: [] responses: '200': - description: Mining Account Id + description: data link content: application/json: schema: type: object properties: - code: - type: integer - format: int64 - example: 0 - msg: - type: string - example: "" data: - type: integer - format: int64 - example: 171 - description: Mining Account + type: array + items: + type: object + properties: + day: + type: string + example: "2023-06-30" + url: + type: string + example: "https://bin-prod-user-rebate-bucket.s3.ap-northeast-1.amazonaws.com/xxx" + required: + - day + - url required: - - code - - msg - data '400': description: Bad Request @@ -13800,41 +13551,89 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/mining/hash-transfer/config/cancel: + /sapi/v1/algo/futures/newOrderVp: post: - summary: Cancel Hashrate Resale configuration (USER_DATA) - description: 'Weight(IP): 5' + summary: Volume Participation(VP) New Order (TRADE) + description: |- + Send in a VP new order. Only support on USDⓈ-M Contracts. + + - You need to enable `Futures Trading Permission` for the api key which requests this endpoint. + - Base URL: https://api.binance.com + + - Total Algo open orders max allowed: 10 orders. + - Leverage of symbols and position mode will be the same as your futures account settings. You can set up through the trading page or fapi. + - Receiving "success": true does not mean that your order will be executed. Please use the query order endpoints(GET sapi/v1/algo/futures/openOrders or GET sapi/v1/algo/futures/historicalOrders) to check the order status. For example: Your futures balance is insufficient, or open position with reduce only or position side is inconsistent with your own setting. In these cases you will receive "success": true, but the order status will be expired after we check it. + + Weight(UID): 3000 tags: - - Mining + - Futures Algo parameters: - - $ref: '#/components/parameters/configId' - - $ref: '#/components/parameters/userName' - - $ref: '#/components/parameters/recvWindow' + - $ref: '#/components/parameters/symbol' + - $ref: '#/components/parameters/side' + - $ref: '#/components/parameters/positionSide' + - name: quantity + in: query + required: true + description: "Quantity of base asset; The notional (quantity * mark price(base asset)) must be more than the equivalent of 10,000 USDT and less than the equivalent of 1,000,000 USDT" + schema: + type: number + format: double + - name: urgency + in: query + description: "Represent the relative speed of the current execution; ENUM: LOW, MEDIUM, HIGH" + required: true + schema: + type: string + enum: ['LOW', 'MEDIUM', 'HIGH'] + example: "LOW" + - name: clientAlgoId + in: query + description: "A unique id among Algo orders (length should be 32 characters), If it is not sent, we will give default value" + schema: + type: string + example: "00358ce6a268403398bd34eaa36dffe7" + - name: reduceOnly + in: query + description: "'true' or 'false'. Default 'false'; Cannot be sent in Hedge Mode; Cannot be sent when you open a position" + schema: + type: boolean + - name: limitPrice + in: query + description: "Limit price of the order; If it is not sent, will place order by market price by default" + schema: + type: number + format: double + - $ref: '#/components/parameters/recvWindow' - $ref: '#/components/parameters/timestamp' - $ref: '#/components/parameters/signature' security: - ApiKeyAuth: [] responses: '200': - description: Success flag + description: Volume Participation(VP) Order content: application/json: schema: type: object properties: + clientAlgoId: + type: string + example: "00358ce6a268403398bd34eaa36dffe7" + success: + type: boolean + example: true code: type: integer format: int64 example: 0 msg: type: string - example: "" - data: - type: boolean + example: "OK" required: + - clientAlgoId + - success - code - msg - - data '400': description: Bad Request content: @@ -13847,15 +13646,61 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/mining/statistics/user/status: - get: - summary: Statistic List (USER_DATA) - description: 'Weight(IP): 5' + /sapi/v1/algo/futures/newOrderTwap: + post: + summary: Time-Weighted Average Price(Twap) New Order (TRADE) + description: |- + Send in a Twap new order. Only support on USDⓈ-M Contracts. + + You need to enable Futures Trading Permission for the api key which requests this endpoint. + Base URL: https://api.binance.com + + - Total Algo open orders max allowed: 10 orders. + - Leverage of symbols and position mode will be the same as your futures account settings. You can set up through the trading page or fapi. + - Receiving "success": true does not mean that your order will be executed. Please use the query order endpoints(GET sapi/v1/algo/futures/openOrders or GET sapi/v1/algo/futures/historicalOrders) to check the order status. For example: Your futures balance is insufficient, or open position with reduce only or position side is inconsistent with your own setting. In these cases you will receive "success": true, but the order status will be expired after we check it. + - quantity * 60 / duration should be larger than minQty + - duration cannot be less than 5 mins or more than 24 hours. + - For delivery contracts, TWAP end time should be one hour earlier than the delivery time of the symbol. + + Weight(UID): 3000 tags: - - Mining + - Futures Algo parameters: - - $ref: '#/components/parameters/algo' - - $ref: '#/components/parameters/userName' + - $ref: '#/components/parameters/symbol' + - $ref: '#/components/parameters/side' + - $ref: '#/components/parameters/positionSide' + - name: quantity + in: query + required: true + description: "Quantity of base asset; The notional (quantity * mark price(base asset)) must be more than the equivalent of 10,000 USDT and less than the equivalent of 1,000,000 USDT" + schema: + type: number + format: double + - name: duration + in: query + description: "Duration for TWAP orders in seconds. [300, 86400];Less than 5min => defaults to 5 min; Greater than 24h => defaults to 24h" + required: true + schema: + type: integer + format: int64 + example: 300 + - name: clientAlgoId + in: query + description: "A unique id among Algo orders (length should be 32 characters), If it is not sent, we will give default value" + schema: + type: string + example: "00358ce6a268403398bd34eaa36dffe7" + - name: reduceOnly + in: query + description: "'true' or 'false'. Default 'false'; Cannot be sent in Hedge Mode; Cannot be sent when you open a position" + schema: + type: boolean + - name: limitPrice + in: query + description: "Limit price of the order; If it is not sent, will place order by market price by default" + schema: + type: number + format: double - $ref: '#/components/parameters/recvWindow' - $ref: '#/components/parameters/timestamp' - $ref: '#/components/parameters/signature' @@ -13863,91 +13708,30 @@ paths: - ApiKeyAuth: [] responses: '200': - description: Mining account statistics + description: Time-Weighted Average Price(Twap) New Order content: application/json: schema: type: object properties: + clientAlgoId: + type: string + example: "00358ce6a268403398bd34eaa36dffe7" + success: + type: boolean + example: true code: type: integer format: int64 example: 0 msg: type: string - example: "" - data: - type: object - properties: - fifteenMinHashRate: - type: string - example: "457835490067496409.00000000" - dayHashRate: - type: string - example: "214289268068874127.65000000" - validNum: - type: integer - format: int64 - example: 0 - invalidNum: - type: integer - format: int64 - example: 17562 - profitToday: - type: object - properties: - BTC: - type: string - example: "0.00314332" - BSV: - type: string - example: "56.17055953" - BCH: - type: string - example: "106.61586001" - required: - - BTC - - BSV - - BCH - profitYesterday: - type: object - properties: - BTC: - type: string - example: "0.00314332" - BSV: - type: string - example: "56.17055953" - BCH: - type: string - example: "106.61586001" - required: - - BTC - - BSV - - BCH - userName: - type: string - example: "test" - unit: - type: string - example: "h/s" - algo: - type: string - example: "sha256" - required: - - fifteenMinHashRate - - dayHashRate - - validNum - - invalidNum - - profitToday - - profitYesterday - - userName - - unit - - algo + example: "OK" required: + - clientAlgoId + - success - code - msg - - data '400': description: Bad Request content: @@ -13960,15 +13744,25 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/mining/statistics/user/list: - get: - summary: Account List (USER_DATA) - description: 'Weight(IP): 5' + /sapi/v1/algo/futures/order: + delete: + summary: Cancel Algo Order(TRADE) + description: |- + Cancel an active order. + - You need to enable Futures Trading Permission for the api key which requests this endpoint. + - Base URL: https://api.binance.com + + Weight(IP): 1 tags: - - Mining + - Futures Algo parameters: - - $ref: '#/components/parameters/algo' - - $ref: '#/components/parameters/userName' + - name: algoId + in: query + description: "Eg. 14511" + required: true + schema: + type: integer + format: int64 - $ref: '#/components/parameters/recvWindow' - $ref: '#/components/parameters/timestamp' - $ref: '#/components/parameters/signature' @@ -13976,57 +13770,31 @@ paths: - ApiKeyAuth: [] responses: '200': - description: List of mining accounts + description: Cancelled order content: application/json: schema: type: object properties: + algoId: + type: integer + format: int64 + example: 14511 + success: + type: boolean + example: true code: type: integer format: int64 example: 0 msg: type: string - example: "" - data: - type: array - items: - type: object - properties: - type: - type: string - example: "H_hashrate" - userName: - type: string - example: "test" - list: - type: array - items: - type: object - properties: - time: - type: integer - format: int64 - example: 1585267200000 - hashrate: - type: string - example: "0.00000000" - reject: - type: string - example: "0.00000000" - required: - - time - - hashrate - - reject - required: - - type - - userName - - list + example: "OK" required: + - algoId + - success - code - msg - - data '400': description: Bad Request content: @@ -14039,18 +13807,17 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/mining/payment/uid: + /sapi/v1/algo/futures/openOrders: get: - summary: Mining Account Earning (USER_DATA) - description: 'Weight(IP): 5' + summary: Query Current Algo Open Orders (USER_DATA) + description: |- + - You need to enable Futures Trading Permission for the api key which requests this endpoint. + - Base URL: https://api.binance.com + + Weight(IP): 1 tags: - - Mining + - Futures Algo parameters: - - $ref: '#/components/parameters/algo' - - $ref: '#/components/parameters/startDate' - - $ref: '#/components/parameters/endDate' - - $ref: '#/components/parameters/pageIndex' - - $ref: '#/components/parameters/pageSize' - $ref: '#/components/parameters/recvWindow' - $ref: '#/components/parameters/timestamp' - $ref: '#/components/parameters/signature' @@ -14058,74 +13825,83 @@ paths: - ApiKeyAuth: [] responses: '200': - description: Mining account earnings + description: Open Algo Orders content: application/json: schema: type: object properties: - code: + total: type: integer format: int32 - example: 0 - msg: - type: string - example: "" - data: - type: object - properties: - accountProfits: - type: array - items: - type: object - properties: - time: - type: integer - format: int64 - example: 1607443200000 - coinName: - type: string - example: "BTC" - type: - type: integer - format: int32 - description: "0:Referral 1:Refund 2:Rebate" - example: 2 - puid: - type: integer - format: int32 - description: "puid" - example: 59985472 - subName: - type: string - description: "Mining account" - example: "vdvaghani" - amount: - type: number - example: 0.09186957 - required: - - time - - coinName - - type - - puid - - subName - - amount - totalNum: - type: integer - format: int32 - example: 3 - pageSize: - type: integer - format: int32 - example: 20 - required: - - accountProfits - - totalNum - - pageSize + example: 1 + orders: + type: array + items: + type: object + properties: + algoId: + type: integer + format: int64 + example: 14517 + symbol: + type: string + example: "ETHUSDT" + side: + type: string + example: "SELL" + positionSide: + type: string + example: "SHORT" + totalQty: + type: string + example: "5.00" + executedQty: + type: string + example: "0.000" + executedAmt: + type: string + example: "0.00000000" + avgPrice: + type: string + example: "0.00" + clientAlgoId: + type: string + example: "d7096549481642f8a0bb69e9e2e31f2e" + bookTime: + type: integer + format: int64 + example: 1649756817004 + endTime: + type: integer + format: int64 + example: 0 + algoStatus: + type: string + example: "WORKING" + algoType: + type: string + example: "VP" + urgency: + type: string + example: "LOW" + required: + - algoId + - symbol + - side + - positionSide + - totalQty + - executedQty + - executedAmt + - avgPrice + - clientAlgoId + - bookTime + - endTime + - algoStatus + - algoType + - urgency required: - - code - - msg - - data + - total '400': description: Bad Request content: @@ -14138,25 +13914,23 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/futures/transfer: - post: - summary: New Future Account Transfer (USER_DATA) + /sapi/v1/algo/futures/historicalOrders: + get: + summary: Query Historical Algo Orders (USER_DATA) description: |- - Execute transfer between spot account and futures account. + - You need to enable Futures Trading Permission for the api key which requests this endpoint. + - Base URL: https://api.binance.com Weight(IP): 1 tags: - - Futures + - Futures Algo parameters: - - $ref: '#/components/parameters/asset' - - $ref: '#/components/parameters/amount' - - name: type - in: query - required: true - description: "1: transfer from spot account to USDT-Ⓜ futures account. 2: transfer from USDT-Ⓜ futures account to spot account. 3: transfer from spot account to COIN-Ⓜ futures account. 4: transfer from COIN-Ⓜ futures account to spot account." - schema: - type: integer - format: int64 + - $ref: '#/components/parameters/optionalSymbol' + - $ref: '#/components/parameters/optionalSide' + - $ref: '#/components/parameters/startTime' + - $ref: '#/components/parameters/endTime' + - $ref: '#/components/parameters/page' + - $ref: '#/components/parameters/smallPageSize' - $ref: '#/components/parameters/recvWindow' - $ref: '#/components/parameters/timestamp' - $ref: '#/components/parameters/signature' @@ -14164,18 +13938,84 @@ paths: - ApiKeyAuth: [] responses: '200': - description: Futures Transfer + description: Historical Algo Orders content: application/json: schema: type: object properties: - tranId: + total: type: integer - format: int64 - example: 100000001 + format: int32 + example: 1 + orders: + type: array + items: + type: object + properties: + algoId: + type: integer + format: int64 + example: 14517 + symbol: + type: string + example: "ETHUSDT" + side: + type: string + example: "SELL" + positionSide: + type: string + example: "SHORT" + totalQty: + type: string + example: "5.00" + executedQty: + type: string + example: "0.000" + executedAmt: + type: string + example: "0.00000000" + avgPrice: + type: string + example: "0.00" + clientAlgoId: + type: string + example: "d7096549481642f8a0bb69e9e2e31f2e" + bookTime: + type: integer + format: int64 + example: 1649756817004 + endTime: + type: integer + format: int64 + example: 1649757088101 + algoStatus: + type: string + example: "WORKING" + algoType: + type: string + example: "VP" + urgency: + type: string + example: "LOW" + required: + - algoId + - symbol + - side + - positionSide + - totalQty + - executedQty + - executedAmt + - avgPrice + - clientAlgoId + - bookTime + - endTime + - algoStatus + - algoType + - urgency required: - - tranId + - total + - orders '400': description: Bad Request content: @@ -14188,18 +14028,25 @@ paths: application/json: schema: $ref: '#/components/schemas/error' + /sapi/v1/algo/futures/subOrders: get: - summary: Get Future Account Transaction History List (USER_DATA) + summary: Query Sub Orders (USER_DATA) description: |- - Weight(IP): 10 + - You need to enable Futures Trading Permission for the api key which requests this endpoint. + - Base URL: https://api.binance.com + + Weight(IP): 1 tags: - - Futures + - Futures Algo parameters: - - $ref: '#/components/parameters/asset' - - $ref: '#/components/parameters/startTimeReq' - - $ref: '#/components/parameters/endTime' - - $ref: '#/components/parameters/current' - - $ref: '#/components/parameters/size' + - name: algoId + in: query + required: true + schema: + type: integer + format: int64 + - $ref: '#/components/parameters/page' + - $ref: '#/components/parameters/smallPageSize' - $ref: '#/components/parameters/recvWindow' - $ref: '#/components/parameters/timestamp' - $ref: '#/components/parameters/signature' @@ -14207,52 +14054,92 @@ paths: - ApiKeyAuth: [] responses: '200': - description: Futures Transfer Query + description: Sub orders content: application/json: schema: type: object properties: - rows: + total: + type: integer + format: int32 + example: 1 + executedQty: + type: string + example: "1.000" + executedAmt: + type: string + example: "3229.44000000" + subOrders: type: array items: type: object properties: - asset: + algoId: + type: integer + format: int64 + example: 13723 + orderId: + type: integer + format: int64 + example: 8389765519993908929 + orderStatus: + type: string + example: "FILLED" + executedQty: + type: string + example: "1.000" + executedAmt: + type: string + example: "3229.44000000" + feeAmt: + type: string + example: "-1.61471999" + feeAsset: type: string example: "USDT" - tranId: + bookTime: type: integer format: int64 - example: 100000001 - amount: + example: 1649756817004 + avgPrice: type: string - example: "40.84624400" - type: + example: "3229.44" + side: type: string - example: "1" - timestamp: + example: "SELL" + symbol: + type: string + example: "ETHUSDT" + subId: type: integer format: int64 - example: 1555056425000 - status: + example: 1 + timeInForce: type: string - description: "one of PENDING (pending to execution), CONFIRMED (successfully transfered), FAILED (execution failed, nothing happened to your account);" - example: "CONFIRMED" + example: "IMMEDIATE_OR_CANCEL" + origQty: + type: string + example: "1.000" required: - - asset - - tranId - - amount - - type - - timestamp - - status - total: - type: integer - format: int32 - example: 1 + - algoId + - orderId + - orderStatus + - executedAmt + - feeAmt + - feeAsset + - bookTime + - avgPrice + - side + - symbol + - subId + - timeInForce + - origQty required: - - rows - total + - executedQty + - executedAmt + - subOrders '400': description: Bad Request content: @@ -14265,29 +14152,35 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/futures/histDataLink: - get: - summary: Get Future TickLevel Orderbook Historical Data Download Link (USER_DATA) + /sapi/v1/algo/spot/newOrderTwap: + post: + summary: Time-Weighted Average Price (Twap) New Order description: |- - Weight(IP): 1 + Place a new spot TWAP order with Algo service. + + Weight(UID): 3000 tags: - - Futures + - Spot Algo parameters: - - name: symbol + - $ref: '#/components/parameters/symbol' + - $ref: '#/components/parameters/side' + - $ref: '#/components/parameters/quantity' + - name: duration in: query required: true schema: - type: string - example: "BTCUSDT" - - name: dataType + type: integer + format: int32 + example: 300 + - name: clientAlgoId in: query - required: true schema: type: string - enum: ['T_DEPTH', 'S_DEPTH'] - example: "T_DEPTH" - - $ref: '#/components/parameters/startTime' - - $ref: '#/components/parameters/endTime' + - name: limitPrice + in: query + schema: + type: number + format: float - $ref: '#/components/parameters/recvWindow' - $ref: '#/components/parameters/timestamp' - $ref: '#/components/parameters/signature' @@ -14295,28 +14188,29 @@ paths: - ApiKeyAuth: [] responses: '200': - description: data link + description: twap order response content: application/json: schema: type: object properties: - data: - type: array - items: - type: object - properties: - day: - type: string - example: "2023-06-30" - url: - type: string - example: "https://bin-prod-user-rebate-bucket.s3.ap-northeast-1.amazonaws.com/xxx" - required: - - day - - url + clientAlgoId: + type: string + example: "65ce1630101a480b85915d7e11fd5078" + success: + type: boolean + example: true + code: + type: integer + example: 0 + msg: + type: string + example: "OK" required: - - data + - clientAlgoId + - success + - code + - msg '400': description: Bad Request content: @@ -14329,58 +14223,23 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/algo/futures/newOrderVp: - post: - summary: Volume Participation(VP) New Order (TRADE) + /sapi/v1/algo/spot/order: + delete: + summary: Cancel Algo Order description: |- - Send in a VP new order. Only support on USDⓈ-M Contracts. - - - You need to enable `Futures Trading Permission` for the api key which requests this endpoint. - - Base URL: https://api.binance.com - - - Total Algo open orders max allowed: 10 orders. - - Leverage of symbols and position mode will be the same as your futures account settings. You can set up through the trading page or fapi. - - Receiving "success": true does not mean that your order will be executed. Please use the query order endpoints(GET sapi/v1/algo/futures/openOrders or GET sapi/v1/algo/futures/historicalOrders) to check the order status. For example: Your futures balance is insufficient, or open position with reduce only or position side is inconsistent with your own setting. In these cases you will receive "success": true, but the order status will be expired after we check it. + Cancel an open TWAP order - Weight(UID): 3000 + Weight(IP): 1 tags: - - Futures Algo + - Spot Algo parameters: - - $ref: '#/components/parameters/symbol' - - $ref: '#/components/parameters/side' - - $ref: '#/components/parameters/positionSide' - - name: quantity - in: query - required: true - description: "Quantity of base asset; The notional (quantity * mark price(base asset)) must be more than the equivalent of 10,000 USDT and less than the equivalent of 1,000,000 USDT" - schema: - type: number - format: double - - name: urgency + - name: algoId in: query - description: "Represent the relative speed of the current execution; ENUM: LOW, MEDIUM, HIGH" required: true schema: - type: string - enum: ['LOW', 'MEDIUM', 'HIGH'] - example: "LOW" - - name: clientAlgoId - in: query - description: "A unique id among Algo orders (length should be 32 characters), If it is not sent, we will give default value" - schema: - type: string - example: "00358ce6a268403398bd34eaa36dffe7" - - name: reduceOnly - in: query - description: "'true' or 'false'. Default 'false'; Cannot be sent in Hedge Mode; Cannot be sent when you open a position" - schema: - type: boolean - - name: limitPrice - in: query - description: "Limit price of the order; If it is not sent, will place order by market price by default" - schema: - type: number - format: double + type: integer + format: int64 + example: 1 - $ref: '#/components/parameters/recvWindow' - $ref: '#/components/parameters/timestamp' - $ref: '#/components/parameters/signature' @@ -14388,27 +14247,27 @@ paths: - ApiKeyAuth: [] responses: '200': - description: Volume Participation(VP) Order + description: Cancelled twap order response content: application/json: schema: type: object properties: - clientAlgoId: - type: string - example: "00358ce6a268403398bd34eaa36dffe7" + algoId: + type: integer + format: int64 + example: 14511 success: type: boolean example: true code: type: integer - format: int64 example: 0 msg: type: string example: "OK" required: - - clientAlgoId + - algoId - success - code - msg @@ -14424,177 +14283,15 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/algo/futures/newOrderTwap: - post: - summary: Time-Weighted Average Price(Twap) New Order (TRADE) + /sapi/v1/algo/spot/openOrders: + get: + summary: Query Current Algo Open Orders description: |- - Send in a Twap new order. Only support on USDⓈ-M Contracts. - - You need to enable Futures Trading Permission for the api key which requests this endpoint. - Base URL: https://api.binance.com - - - Total Algo open orders max allowed: 10 orders. - - Leverage of symbols and position mode will be the same as your futures account settings. You can set up through the trading page or fapi. - - Receiving "success": true does not mean that your order will be executed. Please use the query order endpoints(GET sapi/v1/algo/futures/openOrders or GET sapi/v1/algo/futures/historicalOrders) to check the order status. For example: Your futures balance is insufficient, or open position with reduce only or position side is inconsistent with your own setting. In these cases you will receive "success": true, but the order status will be expired after we check it. - - quantity * 60 / duration should be larger than minQty - - duration cannot be less than 5 mins or more than 24 hours. - - For delivery contracts, TWAP end time should be one hour earlier than the delivery time of the symbol. - - Weight(UID): 3000 - tags: - - Futures Algo - parameters: - - $ref: '#/components/parameters/symbol' - - $ref: '#/components/parameters/side' - - $ref: '#/components/parameters/positionSide' - - name: quantity - in: query - required: true - description: "Quantity of base asset; The notional (quantity * mark price(base asset)) must be more than the equivalent of 10,000 USDT and less than the equivalent of 1,000,000 USDT" - schema: - type: number - format: double - - name: duration - in: query - description: "Duration for TWAP orders in seconds. [300, 86400];Less than 5min => defaults to 5 min; Greater than 24h => defaults to 24h" - required: true - schema: - type: integer - format: int64 - example: 300 - - name: clientAlgoId - in: query - description: "A unique id among Algo orders (length should be 32 characters), If it is not sent, we will give default value" - schema: - type: string - example: "00358ce6a268403398bd34eaa36dffe7" - - name: reduceOnly - in: query - description: "'true' or 'false'. Default 'false'; Cannot be sent in Hedge Mode; Cannot be sent when you open a position" - schema: - type: boolean - - name: limitPrice - in: query - description: "Limit price of the order; If it is not sent, will place order by market price by default" - schema: - type: number - format: double - - $ref: '#/components/parameters/recvWindow' - - $ref: '#/components/parameters/timestamp' - - $ref: '#/components/parameters/signature' - security: - - ApiKeyAuth: [] - responses: - '200': - description: Time-Weighted Average Price(Twap) New Order - content: - application/json: - schema: - type: object - properties: - clientAlgoId: - type: string - example: "00358ce6a268403398bd34eaa36dffe7" - success: - type: boolean - example: true - code: - type: integer - format: int64 - example: 0 - msg: - type: string - example: "OK" - required: - - clientAlgoId - - success - - code - - msg - '400': - description: Bad Request - content: - application/json: - schema: - $ref: '#/components/schemas/error' - '401': - description: Unauthorized Request - content: - application/json: - schema: - $ref: '#/components/schemas/error' - /sapi/v1/algo/futures/order: - delete: - summary: Cancel Algo Order(TRADE) - description: |- - Cancel an active order. - - You need to enable Futures Trading Permission for the api key which requests this endpoint. - - Base URL: https://api.binance.com - - Weight(IP): 1 - tags: - - Futures Algo - parameters: - - name: algoId - in: query - description: "Eg. 14511" - required: true - schema: - type: integer - format: int64 - - $ref: '#/components/parameters/recvWindow' - - $ref: '#/components/parameters/timestamp' - - $ref: '#/components/parameters/signature' - security: - - ApiKeyAuth: [] - responses: - '200': - description: Cancelled order - content: - application/json: - schema: - type: object - properties: - algoId: - type: integer - format: int64 - example: 14511 - success: - type: boolean - example: true - code: - type: integer - format: int64 - example: 0 - msg: - type: string - example: "OK" - required: - - algoId - - success - - code - - msg - '400': - description: Bad Request - content: - application/json: - schema: - $ref: '#/components/schemas/error' - '401': - description: Unauthorized Request - content: - application/json: - schema: - $ref: '#/components/schemas/error' - /sapi/v1/algo/futures/openOrders: - get: - summary: Query Current Algo Open Orders (USER_DATA) - description: |- - - You need to enable Futures Trading Permission for the api key which requests this endpoint. - - Base URL: https://api.binance.com + Get all open SPOT TWAP orders Weight(IP): 1 tags: - - Futures Algo + - Spot Algo parameters: - $ref: '#/components/parameters/recvWindow' - $ref: '#/components/parameters/timestamp' @@ -14603,7 +14300,7 @@ paths: - ApiKeyAuth: [] responses: '200': - description: Open Algo Orders + description: twap open orders content: application/json: schema: @@ -14611,7 +14308,7 @@ paths: properties: total: type: integer - format: int32 + format: int64 example: 1 orders: type: array @@ -14620,7 +14317,6 @@ paths: properties: algoId: type: integer - format: int64 example: 14517 symbol: type: string @@ -14628,18 +14324,15 @@ paths: side: type: string example: "SELL" - positionSide: - type: string - example: "SHORT" totalQty: type: string - example: "5.00" + example: "5.000" executedQty: type: string example: "0.000" executedAmt: type: string - example: "0.00000000" + example: "0.000" avgPrice: type: string example: "0.00" @@ -14653,13 +14346,13 @@ paths: endTime: type: integer format: int64 - example: 0 + example: 1649756817004 algoStatus: type: string example: "WORKING" algoType: type: string - example: "VP" + example: "TWAP" urgency: type: string example: "LOW" @@ -14667,7 +14360,6 @@ paths: - algoId - symbol - side - - positionSide - totalQty - executedQty - executedAmt @@ -14680,6 +14372,7 @@ paths: - urgency required: - total + - orders '400': description: Bad Request content: @@ -14692,27 +14385,22 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/algo/futures/historicalOrders: + /sapi/v1/algo/spot/historicalOrders: get: - summary: Query Historical Algo Orders (USER_DATA) + summary: Query Historical Algo Orders description: |- - - You need to enable Futures Trading Permission for the api key which requests this endpoint. - - Base URL: https://api.binance.com + Get all historical SPOT TWAP orders Weight(IP): 1 tags: - - Futures Algo + - Spot Algo parameters: - - $ref: '#/components/parameters/optionalSymbol' - - $ref: '#/components/parameters/optionalSide' + - $ref: '#/components/parameters/symbol' + - $ref: '#/components/parameters/side' - $ref: '#/components/parameters/startTime' - $ref: '#/components/parameters/endTime' - $ref: '#/components/parameters/page' - - name: pageSize - in: query - description: Page size, minimum 1, maximum 100, default 100 - schema: - type: string + - $ref: '#/components/parameters/smallPageSize' - $ref: '#/components/parameters/recvWindow' - $ref: '#/components/parameters/timestamp' - $ref: '#/components/parameters/signature' @@ -14720,7 +14408,7 @@ paths: - ApiKeyAuth: [] responses: '200': - description: Historical Algo Orders + description: twap historical orders content: application/json: schema: @@ -14728,7 +14416,7 @@ paths: properties: total: type: integer - format: int32 + format: int64 example: 1 orders: type: array @@ -14737,7 +14425,6 @@ paths: properties: algoId: type: integer - format: int64 example: 14517 symbol: type: string @@ -14745,18 +14432,15 @@ paths: side: type: string example: "SELL" - positionSide: - type: string - example: "SHORT" totalQty: type: string - example: "5.00" + example: "5.000" executedQty: type: string example: "0.000" executedAmt: type: string - example: "0.00000000" + example: "0.000" avgPrice: type: string example: "0.00" @@ -14770,7 +14454,7 @@ paths: endTime: type: integer format: int64 - example: 1649757088101 + example: 1649756817004 algoStatus: type: string example: "WORKING" @@ -14784,7 +14468,6 @@ paths: - algoId - symbol - side - - positionSide - totalQty - executedQty - executedAmt @@ -14810,16 +14493,15 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/algo/futures/subOrders: + /sapi/v1/algo/spot/subOrders: get: - summary: Query Sub Orders (USER_DATA) + summary: Query Sub Orders description: |- - - You need to enable Futures Trading Permission for the api key which requests this endpoint. - - Base URL: https://api.binance.com + Get respective sub orders for a specified algoId Weight(IP): 1 tags: - - Futures Algo + - Spot Algo parameters: - name: algoId in: query @@ -14828,11 +14510,7 @@ paths: type: integer format: int64 - $ref: '#/components/parameters/page' - - name: pageSize - in: query - description: Page size, minimum 1, maximum 100, default 100 - schema: - type: string + - $ref: '#/components/parameters/smallPageSize' - $ref: '#/components/parameters/recvWindow' - $ref: '#/components/parameters/timestamp' - $ref: '#/components/parameters/signature' @@ -14840,7 +14518,7 @@ paths: - ApiKeyAuth: [] responses: '200': - description: Sub orders + description: twap sub orders content: application/json: schema: @@ -14848,7 +14526,7 @@ paths: properties: total: type: integer - format: int32 + format: int64 example: 1 executedQty: type: string @@ -14863,8 +14541,7 @@ paths: properties: algoId: type: integer - format: int64 - example: 13723 + example: 14517 orderId: type: integer format: int64 @@ -14874,10 +14551,10 @@ paths: example: "FILLED" executedQty: type: string - example: "1.000" + example: "0.000" executedAmt: type: string - example: "3229.44000000" + example: "0.000" feeAmt: type: string example: "-1.61471999" @@ -14887,7 +14564,7 @@ paths: bookTime: type: integer format: int64 - example: 1649756817004 + example: 1649319001964 avgPrice: type: string example: "3229.44" @@ -14899,7 +14576,6 @@ paths: example: "ETHUSDT" subId: type: integer - format: int64 example: 1 timeInForce: type: string @@ -14909,1250 +14585,24 @@ paths: example: "1.000" required: - algoId - - orderId - - orderStatus - - executedAmt - - feeAmt - - feeAsset - - bookTime - - avgPrice - - side - - symbol - - subId - - timeInForce - - origQty - required: - - total - - executedQty - - executedAmt - - subOrders - '400': - description: Bad Request - content: - application/json: - schema: - $ref: '#/components/schemas/error' - '401': - description: Unauthorized Request - content: - application/json: - schema: - $ref: '#/components/schemas/error' - /sapi/v1/algo/spot/newOrderTwap: - post: - summary: Time-Weighted Average Price (Twap) New Order - description: |- - Place a new spot TWAP order with Algo service. - - Weight(UID): 3000 - tags: - - Spot Algo - parameters: - - $ref: '#/components/parameters/symbol' - - $ref: '#/components/parameters/side' - - $ref: '#/components/parameters/quantity' - - name: duration - in: query - required: true - schema: - type: integer - format: int32 - example: 300 - - name: clientAlgoId - in: query - schema: - type: string - - name: limitPrice - in: query - schema: - type: number - format: float - - $ref: '#/components/parameters/recvWindow' - - $ref: '#/components/parameters/timestamp' - - $ref: '#/components/parameters/signature' - security: - - ApiKeyAuth: [] - responses: - '200': - description: twap order response - content: - application/json: - schema: - type: object - properties: - clientAlgoId: - type: string - example: "65ce1630101a480b85915d7e11fd5078" - success: - type: boolean - example: true - code: - type: integer - example: 0 - msg: - type: string - example: "OK" - required: - - clientAlgoId - - success - - code - - msg - '400': - description: Bad Request - content: - application/json: - schema: - $ref: '#/components/schemas/error' - '401': - description: Unauthorized Request - content: - application/json: - schema: - $ref: '#/components/schemas/error' - /sapi/v1/algo/spot/order: - delete: - summary: Cancel Algo Order - description: |- - Cancel an open TWAP order - - Weight(IP): 1 - tags: - - Spot Algo - parameters: - - name: algoId - in: query - required: true - schema: - type: integer - format: int64 - example: 1 - - $ref: '#/components/parameters/recvWindow' - - $ref: '#/components/parameters/timestamp' - - $ref: '#/components/parameters/signature' - security: - - ApiKeyAuth: [] - responses: - '200': - description: Cancelled twap order response - content: - application/json: - schema: - type: object - properties: - algoId: - type: integer - format: int64 - example: 14511 - success: - type: boolean - example: true - code: - type: integer - example: 0 - msg: - type: string - example: "OK" - required: - - algoId - - success - - code - - msg - '400': - description: Bad Request - content: - application/json: - schema: - $ref: '#/components/schemas/error' - '401': - description: Unauthorized Request - content: - application/json: - schema: - $ref: '#/components/schemas/error' - /sapi/v1/algo/spot/openOrders: - get: - summary: Query Current Algo Open Orders - description: |- - Get all open SPOT TWAP orders - - Weight(IP): 1 - tags: - - Spot Algo - parameters: - - $ref: '#/components/parameters/recvWindow' - - $ref: '#/components/parameters/timestamp' - - $ref: '#/components/parameters/signature' - security: - - ApiKeyAuth: [] - responses: - '200': - description: twap open orders - content: - application/json: - schema: - type: object - properties: - total: - type: integer - format: int64 - example: 1 - orders: - type: array - items: - type: object - properties: - algoId: - type: integer - example: 14517 - symbol: - type: string - example: "ETHUSDT" - side: - type: string - example: "SELL" - totalQty: - type: string - example: "5.000" - executedQty: - type: string - example: "0.000" - executedAmt: - type: string - example: "0.000" - avgPrice: - type: string - example: "0.00" - clientAlgoId: - type: string - example: "d7096549481642f8a0bb69e9e2e31f2e" - bookTime: - type: integer - format: int64 - example: 1649756817004 - endTime: - type: integer - format: int64 - example: 1649756817004 - algoStatus: - type: string - example: "WORKING" - algoType: - type: string - example: "TWAP" - urgency: - type: string - example: "LOW" - required: - - algoId - - symbol - - side - - totalQty - - executedQty - - executedAmt - - avgPrice - - clientAlgoId - - bookTime - - endTime - - algoStatus - - algoType - - urgency - required: - - total - - orders - '400': - description: Bad Request - content: - application/json: - schema: - $ref: '#/components/schemas/error' - '401': - description: Unauthorized Request - content: - application/json: - schema: - $ref: '#/components/schemas/error' - /sapi/v1/algo/spot/historicalOrders: - get: - summary: Query Historical Algo Orders - description: |- - Get all historical SPOT TWAP orders - - Weight(IP): 1 - tags: - - Spot Algo - parameters: - - $ref: '#/components/parameters/symbol' - - $ref: '#/components/parameters/side' - - $ref: '#/components/parameters/startTime' - - $ref: '#/components/parameters/endTime' - - $ref: '#/components/parameters/page' - - $ref: '#/components/parameters/pageSize' - - $ref: '#/components/parameters/recvWindow' - - $ref: '#/components/parameters/timestamp' - - $ref: '#/components/parameters/signature' - security: - - ApiKeyAuth: [] - responses: - '200': - description: twap historical orders - content: - application/json: - schema: - type: object - properties: - total: - type: integer - format: int64 - example: 1 - orders: - type: array - items: - type: object - properties: - algoId: - type: integer - example: 14517 - symbol: - type: string - example: "ETHUSDT" - side: - type: string - example: "SELL" - totalQty: - type: string - example: "5.000" - executedQty: - type: string - example: "0.000" - executedAmt: - type: string - example: "0.000" - avgPrice: - type: string - example: "0.00" - clientAlgoId: - type: string - example: "d7096549481642f8a0bb69e9e2e31f2e" - bookTime: - type: integer - format: int64 - example: 1649756817004 - endTime: - type: integer - format: int64 - example: 1649756817004 - algoStatus: - type: string - example: "WORKING" - algoType: - type: string - example: "VP" - urgency: - type: string - example: "LOW" - required: - - algoId - - symbol - - side - - totalQty - - executedQty - - executedAmt - - avgPrice - - clientAlgoId - - bookTime - - endTime - - algoStatus - - algoType - - urgency - required: - - total - - orders - '400': - description: Bad Request - content: - application/json: - schema: - $ref: '#/components/schemas/error' - '401': - description: Unauthorized Request - content: - application/json: - schema: - $ref: '#/components/schemas/error' - /sapi/v1/algo/spot/subOrders: - get: - summary: Query Sub Orders - description: |- - Get respective sub orders for a specified algoId - - Weight(IP): 1 - tags: - - Spot Algo - parameters: - - name: algoId - in: query - required: true - schema: - type: integer - format: int64 - - $ref: '#/components/parameters/page' - - $ref: '#/components/parameters/pageSize' - - $ref: '#/components/parameters/recvWindow' - - $ref: '#/components/parameters/timestamp' - - $ref: '#/components/parameters/signature' - security: - - ApiKeyAuth: [] - responses: - '200': - description: twap sub orders - content: - application/json: - schema: - type: object - properties: - total: - type: integer - format: int64 - example: 1 - executedQty: - type: string - example: "1.000" - executedAmt: - type: string - example: "3229.44000000" - subOrders: - type: array - items: - type: object - properties: - algoId: - type: integer - example: 14517 - orderId: - type: integer - format: int64 - example: 8389765519993908929 - orderStatus: - type: string - example: "FILLED" - executedQty: - type: string - example: "0.000" - executedAmt: - type: string - example: "0.000" - feeAmt: - type: string - example: "-1.61471999" - feeAsset: - type: string - example: "USDT" - bookTime: - type: integer - format: int64 - example: 1649319001964 - avgPrice: - type: string - example: "3229.44" - side: - type: string - example: "SELL" - symbol: - type: string - example: "ETHUSDT" - subId: - type: integer - example: 1 - timeInForce: - type: string - example: "IMMEDIATE_OR_CANCEL" - origQty: - type: string - example: "1.000" - required: - - algoId - - orderId - - orderStatus - - executedQty - - executedAmt - - feeAmt - - feeAsset - - bookTime - - avgPrice - - side - - symbol - - subId - - timeInForce - - origQty - required: - - total - - executedQty - - executedAmt - - subOrders - '400': - description: Bad Request - content: - application/json: - schema: - $ref: '#/components/schemas/error' - '401': - description: Unauthorized Request - content: - application/json: - schema: - $ref: '#/components/schemas/error' - /sapi/v1/portfolio/account: - get: - summary: Portfolio Margin Account (USER_DATA) - description: |- - Get the account info - - 'Weight(IP): 1' - tags: - - Portfolio Margin - parameters: - - $ref: '#/components/parameters/recvWindow' - - $ref: '#/components/parameters/timestamp' - - $ref: '#/components/parameters/signature' - security: - - ApiKeyAuth: [] - responses: - '200': - description: Portfolio account. - content: - application/json: - schema: - type: object - properties: - uniMMR: - type: string - example: '1.87987800' - description: Classic Portfolio margin account maintenance margin rate - accountEquity: - type: string - example: "122607.35137903" - description: Account equity, unit is USD - actualEquity: - type: string - example: '142607.35137903' - description: Actual equity, unit is USD - accountMaintMargin: - type: string - example: '23.72469206' - description: Classic Portfolio margin account maintenance margin, unit is USD - accountStatus: - type: string - example: NORMAL - description: Classic Portfolio margin account status:"NORMAL", "MARGIN_CALL", "SUPPLY_MARGIN", "REDUCE_ONLY", "ACTIVE_LIQUIDATION", "FORCE_LIQUIDATION", "BANKRUPTED" - accountType: - type: string - example: "PM_1" - description: PM_1 for classic PM, PM_2 for PM - required: - - uniMMR - - accountEquity - - actualEquity - - accountMaintMargin - - accountStatus - - accountType - '400': - description: Bad Request - content: - application/json: - schema: - $ref: '#/components/schemas/error' - '401': - description: Unauthorized Request - content: - application/json: - schema: - $ref: '#/components/schemas/error' - /sapi/v1/portfolio/collateralRate: - get: - summary: Portfolio Margin Collateral Rate (MARKET_DATA) - description: |- - Portfolio Margin Collateral Rate. - - Weight(IP): 50 - security: - - ApiKeyAuth: [] - tags: - - Portfolio Margin - responses: - '200': - description: Portfolio Margin Collateral Rate. - content: - application/json: - schema: - type: array - items: - type: object - properties: - asset: - type: string - example: USDC - collateralRate: - type: string - example: '1.0000' - required: - - asset - - collateralRate - '400': - description: Bad Request - content: - application/json: - schema: - $ref: '#/components/schemas/error' - /sapi/v1/portfolio/pmLoan: - get: - summary: Portfolio Margin Bankruptcy Loan Amount (USER_DATA) - description: |- - Query Portfolio Margin Bankruptcy Loan Amount. - - Weight(UID): 500 - tags: - - Portfolio Margin - parameters: - - $ref: '#/components/parameters/recvWindow' - - $ref: '#/components/parameters/timestamp' - - $ref: '#/components/parameters/signature' - security: - - ApiKeyAuth: [] - responses: - '200': - description: Portfolio Margin Bankruptcy Loan Amount. - content: - application/json: - schema: - type: object - properties: - asset: - type: string - example: BUSD - amount: - type: string - example: '579.45' - required: - - asset - - amount - '400': - description: Bad Request - content: - application/json: - schema: - $ref: '#/components/schemas/error' - '401': - description: Unauthorized Request - content: - application/json: - schema: - $ref: '#/components/schemas/error' - /sapi/v1/portfolio/repay: - post: - summary: Portfolio Margin Bankruptcy Loan Repay (USER_DATA) - description: |- - Repay Portfolio Margin Bankruptcy Loan. - - Weight(UID): 3000 - tags: - - Portfolio Margin - parameters: - - name: from - in: query - schema: - type: string - example: "SPOT" - - $ref: '#/components/parameters/recvWindow' - - $ref: '#/components/parameters/timestamp' - - $ref: '#/components/parameters/signature' - security: - - ApiKeyAuth: [] - responses: - '200': - description: Transaction. - content: - application/json: - schema: - type: object - properties: - tranId: - type: integer - format: int64 - example: 58203331886213500 - required: - - tranId - '400': - description: Bad Request - content: - application/json: - schema: - $ref: '#/components/schemas/error' - '401': - description: Unauthorized Request - content: - application/json: - schema: - $ref: '#/components/schemas/error' - /sapi/v1/portfolio/interest-history: - get: - summary: Query Classic Portfolio Margin Negative Balance Interest History (USER_DATA) - description: |- - Query interest history of negative balance for portfolio margin. - - Weight(IP): 50 - tags: - - Portfolio Margin - parameters: - - $ref: '#/components/parameters/asset' - - $ref: '#/components/parameters/startTime' - - $ref: '#/components/parameters/endTime' - - $ref: '#/components/parameters/size' - - $ref: '#/components/parameters/recvWindow' - - $ref: '#/components/parameters/timestamp' - - $ref: '#/components/parameters/signature' - security: - - ApiKeyAuth: [] - responses: - '200': - description: Balance interest history - content: - application/json: - schema: - type: array - items: - type: object - properties: - asset: - type: string - example: "USDT" - interest: - type: string - example: "24.4440" - interestAccruedTime: - type: integer - format: int64 - example: 1672801339253 - interestRate: - type: string - example: "0.0001164" - principal: - type: string - example: "210000" - required: - - asset - - interest - - interestAccruedTime - - interestRate - - principal - '400': - description: Bad Request - content: - application/json: - schema: - $ref: '#/components/schemas/error' - '401': - description: Unauthorized Request - content: - application/json: - schema: - $ref: '#/components/schemas/error' - /sapi/v1/portfolio/asset-index-price: - get: - summary: Query Portfolio Margin Asset Index Price (MARKET_DATA) - description: |- - Query Portfolio Margin Asset Index Price - - Weight(IP): - - 1 if send asset - - 50 if not send asset - - security: - - ApiKeyAuth: [] - tags: - - Portfolio Margin - parameters: - - name: asset - in: query - schema: - type: string - example: "BTC" - responses: - '200': - description: asset price index - content: - application/json: - schema: - type: array - items: - type: object - properties: - asset: - type: string - example: "USDT" - assetIndexPrice: - type: string - example: "28251.9136906" - time: - type: integer - format: int64 - example: 1683518338121 - required: - - asset - - assetIndexPrice - - time - '400': - description: Bad Request - content: - application/json: - schema: - $ref: '#/components/schemas/error' - /sapi/v1/portfolio/auto-collection: - post: - summary: Fund Auto-collection (USER_DATA) - description: |- - Transfers all assets from Futures Account to Margin account - - Weight(IP): 1500 - tags: - - Portfolio Margin - parameters: - - $ref: '#/components/parameters/recvWindow' - - $ref: '#/components/parameters/timestamp' - - $ref: '#/components/parameters/signature' - security: - - ApiKeyAuth: [] - responses: - '200': - description: Result - content: - application/json: - schema: - type: object - properties: - msg: - type: string - example: "success" - required: - - msg - '400': - description: Bad Request - content: - application/json: - schema: - $ref: '#/components/schemas/error' - '401': - description: Unauthorized Request - content: - application/json: - schema: - $ref: '#/components/schemas/error' - /sapi/v1/portfolio/bnb-transfer: - post: - summary: BNB Transfer (USER_DATA) - description: |- - BNB transfer can be between Margin Account and USDM Account - - Weight(IP): 1500 - tags: - - Portfolio Margin - parameters: - - name: transferSide - in: query - required: true - schema: - type: string - enum: ['TO_UM','FROM_UM'] - example: 'TO_UM' - - $ref: '#/components/parameters/amount' - - $ref: '#/components/parameters/recvWindow' - - $ref: '#/components/parameters/timestamp' - - $ref: '#/components/parameters/signature' - security: - - ApiKeyAuth: [] - responses: - '200': - description: Result - content: - application/json: - schema: - type: object - properties: - tranId: - type: integer - format: int64 - example: 100000001 - required: - - tranId - '400': - description: Bad Request - content: - application/json: - schema: - $ref: '#/components/schemas/error' - '401': - description: Unauthorized Request - content: - application/json: - schema: - $ref: '#/components/schemas/error' - /sapi/v1/portfolio/repay-futures-switch: - post: - summary: Change Auto-repay-futures Status (USER_DATA) - description: |- - Change Auto-repay-futures Status - - Weight(IP): 1500 - tags: - - Portfolio Margin - parameters: - - $ref: '#/components/parameters/autoRepay' - - $ref: '#/components/parameters/recvWindow' - - $ref: '#/components/parameters/timestamp' - - $ref: '#/components/parameters/signature' - security: - - ApiKeyAuth: [] - responses: - '200': - description: Result - content: - application/json: - schema: - type: object - properties: - msg: - type: string - example: "success" - required: - - msg - '400': - description: Bad Request - content: - application/json: - schema: - $ref: '#/components/schemas/error' - '401': - description: Unauthorized Request - content: - application/json: - schema: - $ref: '#/components/schemas/error' - get: - summary: Get Auto-repay-futures Status (USER_DATA) - description: |- - Query Auto-repay-futures Status - - Weight(IP): 30 - tags: - - Portfolio Margin - parameters: - - $ref: '#/components/parameters/recvWindow' - - $ref: '#/components/parameters/timestamp' - - $ref: '#/components/parameters/signature' - security: - - ApiKeyAuth: [] - responses: - '200': - description: Result - content: - application/json: - schema: - type: object - properties: - autoRepay: - type: boolean - example: true - required: - - autoRepay - '400': - description: Bad Request - content: - application/json: - schema: - $ref: '#/components/schemas/error' - '401': - description: Unauthorized Request - content: - application/json: - schema: - $ref: '#/components/schemas/error' - /sapi/v1/portfolio/repay-futures-negative-balance: - post: - summary: Repay futures Negative Balance (USER_DATA) - description: |- - Repay futures Negative Balance - - Weight(IP): 1500 - tags: - - Portfolio Margin - parameters: - - $ref: '#/components/parameters/recvWindow' - - $ref: '#/components/parameters/timestamp' - - $ref: '#/components/parameters/signature' - security: - - ApiKeyAuth: [] - responses: - '200': - description: Result - content: - application/json: - schema: - type: object - properties: - msg: - type: string - example: "success" - required: - - msg - '400': - description: Bad Request - content: - application/json: - schema: - $ref: '#/components/schemas/error' - '401': - description: Unauthorized Request - content: - application/json: - schema: - $ref: '#/components/schemas/error' - /sapi/v1/portfolio/margin-asset-leverage: - get: - summary: Get Portfolio Margin Asset Leverage (USER_DATA) - description: |- - Weight(IP): 50 - tags: - - Portfolio Margin - responses: - '200': - description: Classic Portfolio Margin Collateral Rate - content: - application/json: - schema: - type: array - items: - type: object - properties: - asset: - type: string - example: "USDC" - collateralRate: - type: string - example: '1.0000' - '400': - description: Bad Request - content: - application/json: - schema: - $ref: '#/components/schemas/error' - '401': - description: Unauthorized Request - content: - application/json: - schema: - $ref: '#/components/schemas/error' - - /sapi/v1/portfolio/asset-collection: - post: - summary: Fund Collection by Asset (USER_DATA) - description: |- - Transfers specific asset from Futures Account to Margin account - - Weight(IP): 60 - tags: - - Portfolio Margin - parameters: - - $ref: '#/components/parameters/asset' - - $ref: '#/components/parameters/recvWindow' - - $ref: '#/components/parameters/timestamp' - - $ref: '#/components/parameters/signature' - security: - - ApiKeyAuth: [] - responses: - '200': - description: Result - content: - application/json: - schema: - type: object - properties: - msg: - type: string - example: "success" - required: - - msg - '400': - description: Bad Request - content: - application/json: - schema: - $ref: '#/components/schemas/error' - '401': - description: Unauthorized Request - content: - application/json: - schema: - $ref: '#/components/schemas/error' - /sapi/v1/blvt/tokenInfo: - get: - summary: BLVT Info (MARKET_DATA) - description: 'Weight(IP): 1' - tags: - - BLVT - parameters: - - $ref: '#/components/parameters/optionalBlvtTokenName' - security: - - ApiKeyAuth: [] - responses: - '200': - description: List of token information - content: - application/json: - schema: - type: array - items: - type: object - properties: - tokenName: - type: string - example: "BTCDOWN" - description: - type: string - example: "3X Short Bitcoin Token" - underlying: - type: string - example: "BTC" - tokenIssued: - type: string - example: "717953.95" - basket: - type: string - example: "-821.474 BTCUSDT Futures" - currentBaskets: - type: array - items: - type: object - properties: - symbol: - type: string - example: "BTCUSDT" - amount: - type: string - example: "-1183.984" - notionalValue: - type: string - example: "-22871089.96704" - required: - - symbol - - amount - - notionalValue - nav: - type: string - example: "4.79" - realLeverage: - type: string - example: "-2.316" - fundingRate: - type: string - example: "0.001020" - dailyManagementFee: - type: string - example: "0.0001" - purchaseFeePct: - type: string - example: "0.0010" - dailyPurchaseLimit: - type: string - example: "100000.00" - redeemFeePct: - type: string - example: "0.0010" - dailyRedeemLimit: - type: string - example: "1000000.00" - timestamp: - type: integer - format: int64 - example: 1583127900000 - required: - - tokenName - - description - - underlying - - tokenIssued - - basket - - currentBaskets - - nav - - realLeverage - - fundingRate - - dailyManagementFee - - purchaseFeePct - - dailyPurchaseLimit - - redeemFeePct - - dailyRedeemLimit - - timestamp - '400': - description: Bad Request - content: - application/json: - schema: - $ref: '#/components/schemas/error' - /sapi/v1/blvt/subscribe: - post: - summary: Subscribe BLVT (USER_DATA) - description: 'Weight(IP): 1' - tags: - - BLVT - parameters: - - $ref: '#/components/parameters/blvtTokenName' - - name: cost - in: query - description: Spot balance - required: true - schema: - type: number - format: double - - $ref: '#/components/parameters/recvWindow' - - $ref: '#/components/parameters/timestamp' - - $ref: '#/components/parameters/signature' - security: - - ApiKeyAuth: [] - responses: - '200': - description: Subscription Info - content: - application/json: - schema: - type: object - properties: - id: - type: integer - format: int64 - example: 123 - status: - type: string - example: "S" - description: 'S, P, and F for "success", "pending", and "failure"' - tokenName: - type: string - example: "LINKUP" - amount: - type: string - example: "0.9559090500" - description: subscribed token amount - cost: - type: string - example: "9.99999995" - description: subscription cost in usdt - timestamp: - type: integer - format: int64 - example: 1600249972899 + - orderId + - orderStatus + - executedQty + - executedAmt + - feeAmt + - feeAsset + - bookTime + - avgPrice + - side + - symbol + - subId + - timeInForce + - origQty required: - - id - - status - - tokenName - - amount - - cost - - timestamp + - total + - executedQty + - executedAmt + - subOrders '400': description: Bad Request content: @@ -16165,25 +14615,16 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/blvt/subscribe/record: + /sapi/v1/portfolio/account: get: - summary: Query Subscription Record (USER_DATA) + summary: Portfolio Margin Account (USER_DATA) description: |- - - Only the data of the latest 90 days is available + Get the account info - Weight(IP): 1 + 'Weight(IP): 1' tags: - - BLVT + - Portfolio Margin parameters: - - $ref: '#/components/parameters/optionalBlvtTokenName' - - name: id - in: query - schema: - type: integer - format: int64 - - $ref: '#/components/parameters/startTime' - - $ref: '#/components/parameters/endTime' - - $ref: '#/components/parameters/limit' - $ref: '#/components/parameters/recvWindow' - $ref: '#/components/parameters/timestamp' - $ref: '#/components/parameters/signature' @@ -16191,47 +14632,43 @@ paths: - ApiKeyAuth: [] responses: '200': - description: List of subscription record + description: Portfolio account. content: application/json: schema: type: object properties: - id: - type: integer - format: int64 - example: 1 - tokenName: + uniMMR: type: string - example: "LINKUP" - amount: + example: '1.87987800' + description: Classic Portfolio margin account maintenance margin rate + accountEquity: type: string - example: "0.54216292" - description: Subscription amount - nav: + example: "122607.35137903" + description: Account equity, unit is USD + actualEquity: type: string - example: "18.42621386" - description: NAV price of subscription - fee: + example: '142607.35137903' + description: Actual equity, unit is USD + accountMaintMargin: type: string - example: "0.00999000" - description: Subscription fee in usdt - totalCharge: + example: '23.72469206' + description: Classic Portfolio margin account maintenance margin, unit is USD + accountStatus: type: string - example: "9.99999991" - description: Subscription cost in usdt - timestamp: - type: integer - format: int64 - example: 1599127217916 + example: NORMAL + description: Classic Portfolio margin account status:"NORMAL", "MARGIN_CALL", "SUPPLY_MARGIN", "REDUCE_ONLY", "ACTIVE_LIQUIDATION", "FORCE_LIQUIDATION", "BANKRUPTED" + accountType: + type: string + example: "PM_1" + description: PM_1 for classic PM, PM_2 for PM required: - - id - - tokenName - - amount - - nav - - fee - - totalCharge - - timestamp + - uniMMR + - accountEquity + - actualEquity + - accountMaintMargin + - accountStatus + - accountType '400': description: Bad Request content: @@ -16244,94 +14681,52 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/blvt/redeem: - post: - summary: Redeem BLVT (USER_DATA) - description: 'Weight(IP): 1' - tags: - - BLVT - parameters: - - $ref: '#/components/parameters/blvtTokenName' - - $ref: '#/components/parameters/amount' - - $ref: '#/components/parameters/recvWindow' - - $ref: '#/components/parameters/timestamp' - - $ref: '#/components/parameters/signature' + /sapi/v1/portfolio/collateralRate: + get: + summary: Portfolio Margin Collateral Rate (MARKET_DATA) + description: |- + Portfolio Margin Collateral Rate. + + Weight(IP): 50 security: - ApiKeyAuth: [] + tags: + - Portfolio Margin responses: '200': - description: Redemption record + description: Portfolio Margin Collateral Rate. content: application/json: schema: - type: object - properties: - id: - type: integer - format: int64 - example: 123 - status: - type: string - example: "S" - description: 'S, P, and F for "success", "pending", and "failure"' - tokenName: - type: string - example: "LINKUP" - redeemAmount: - type: string - example: "0.95590905" - description: Redemption token amount - amount: - type: string - example: "10.05022099" - description: Redemption value in usdt - timestamp: - type: integer - format: int64 - example: 1600250279614 - required: - - id - - status - - tokenName - - redeemAmount - - amount - - timestamp + type: array + items: + type: object + properties: + asset: + type: string + example: USDC + collateralRate: + type: string + example: '1.0000' + required: + - asset + - collateralRate '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/error' - '401': - description: Unauthorized Request - content: - application/json: - schema: - $ref: '#/components/schemas/error' - /sapi/v1/blvt/redeem/record: + /sapi/v1/portfolio/pmLoan: get: - summary: Redemption Record (USER_DATA) + summary: Portfolio Margin Bankruptcy Loan Amount (USER_DATA) description: |- - - Only the data of the latest 90 days is available + Query Portfolio Margin Bankruptcy Loan Amount. - Weight(IP): 1 + Weight(UID): 500 tags: - - BLVT + - Portfolio Margin parameters: - - $ref: '#/components/parameters/optionalBlvtTokenName' - - name: id - in: query - schema: - type: integer - format: int64 - - $ref: '#/components/parameters/startTime' - - $ref: '#/components/parameters/endTime' - - name: limit - in: query - schema: - type: integer - format: int32 - description: 'default 1000, max 1000' - $ref: '#/components/parameters/recvWindow' - $ref: '#/components/parameters/timestamp' - $ref: '#/components/parameters/signature' @@ -16339,49 +14734,67 @@ paths: - ApiKeyAuth: [] responses: '200': - description: List of redemption record + description: Portfolio Margin Bankruptcy Loan Amount. content: application/json: schema: - type: array - items: - type: object - properties: - id: - type: integer - format: int64 - example: 1 - tokenName: - type: string - example: "LINKUP" - amount: - type: string - example: "0.54216292" - description: Redemption amount - nav: - type: string - example: "18.36345064" - description: NAV of redemption - fee: - type: string - example: "0.00995598" - description: Reemption fee - netProceed: - type: string - example: "9.94602604" - description: Net redemption value in usdt - timestamp: - type: integer - format: int64 - example: 1599128003050 - required: - - id - - tokenName - - amount - - nav - - fee - - netProceed - - timestamp + type: object + properties: + asset: + type: string + example: BUSD + amount: + type: string + example: '579.45' + required: + - asset + - amount + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/error' + '401': + description: Unauthorized Request + content: + application/json: + schema: + $ref: '#/components/schemas/error' + /sapi/v1/portfolio/repay: + post: + summary: Portfolio Margin Bankruptcy Loan Repay (USER_DATA) + description: |- + Repay Portfolio Margin Bankruptcy Loan. + + Weight(UID): 3000 + tags: + - Portfolio Margin + parameters: + - name: from + in: query + schema: + type: string + example: "SPOT" + - $ref: '#/components/parameters/recvWindow' + - $ref: '#/components/parameters/timestamp' + - $ref: '#/components/parameters/signature' + security: + - ApiKeyAuth: [] + responses: + '200': + description: Transaction. + content: + application/json: + schema: + type: object + properties: + tranId: + type: integer + format: int64 + example: 58203331886213500 + required: + - tranId '400': description: Bad Request content: @@ -16394,14 +14807,20 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/blvt/userLimit: + /sapi/v1/portfolio/interest-history: get: - summary: BLVT User Limit Info (USER_DATA) - description: 'Weight(IP): 1' + summary: Query Classic Portfolio Margin Negative Balance Interest History (USER_DATA) + description: |- + Query interest history of negative balance for portfolio margin. + + Weight(IP): 50 tags: - - BLVT + - Portfolio Margin parameters: - - $ref: '#/components/parameters/optionalBlvtTokenName' + - $ref: '#/components/parameters/asset' + - $ref: '#/components/parameters/startTime' + - $ref: '#/components/parameters/endTime' + - $ref: '#/components/parameters/size' - $ref: '#/components/parameters/recvWindow' - $ref: '#/components/parameters/timestamp' - $ref: '#/components/parameters/signature' @@ -16409,7 +14828,7 @@ paths: - ApiKeyAuth: [] responses: '200': - description: List of token limits + description: Balance interest history content: application/json: schema: @@ -16417,21 +14836,28 @@ paths: items: type: object properties: - tokenName: + asset: type: string - example: "LINKUP" - userDailyTotalPurchaseLimit: + example: "USDT" + interest: type: string - example: "1000" - description: USDT - userDailyTotalRedeemLimit: + example: "24.4440" + interestAccruedTime: + type: integer + format: int64 + example: 1672801339253 + interestRate: type: string - example: "1000" - description: USDT + example: "0.0001164" + principal: + type: string + example: "210000" required: - - tokenName - - userDailyTotalPurchaseLimit - - userDailyTotalRedeemLimit + - asset + - interest + - interestAccruedTime + - interestRate + - principal '400': description: Bad Request content: @@ -16444,20 +14870,29 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/bswap/pools: + /sapi/v1/portfolio/asset-index-price: get: - summary: List All Swap Pools (MARKET_DATA) + summary: Query Portfolio Margin Asset Index Price (MARKET_DATA) description: |- - Get metadata about all swap pools. + Query Portfolio Margin Asset Index Price + + Weight(IP): + - 1 if send asset + - 50 if not send asset - Weight(IP): 1 - tags: - - BSwap security: - ApiKeyAuth: [] + tags: + - Portfolio Margin + parameters: + - name: asset + in: query + schema: + type: string + example: "BTC" responses: '200': - description: List of Swap Pools + description: asset price index content: application/json: schema: @@ -16465,45 +14900,36 @@ paths: items: type: object properties: - poolId: + asset: + type: string + example: "USDT" + assetIndexPrice: + type: string + example: "28251.9136906" + time: type: integer format: int64 - example: 2 - poolName: - type: string - example: "BUSD/USDT" - assets: - type: array - items: - type: string - minItems: 2 - maxItems: 2 - example: - - BUSD - - USDT + example: 1683518338121 required: - - poolId - - poolName - - assets + - asset + - assetIndexPrice + - time '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/bswap/liquidity: - get: - summary: Liquidity information of a pool (USER_DATA) + /sapi/v1/portfolio/auto-collection: + post: + summary: Fund Auto-collection (USER_DATA) description: |- - Get liquidity information and user share of a pool. + Transfers all assets from Futures Account to Margin account - Weight(IP): - - `1` for one pool; - - `10` when the poolId parameter is omitted; + Weight(IP): 1500 tags: - - BSwap + - Portfolio Margin parameters: - - $ref: '#/components/parameters/optionalPoolId' - $ref: '#/components/parameters/recvWindow' - $ref: '#/components/parameters/timestamp' - $ref: '#/components/parameters/signature' @@ -16511,74 +14937,17 @@ paths: - ApiKeyAuth: [] responses: '200': - description: Pool Liquidation information + description: Result content: application/json: schema: - type: array - items: type: object properties: - poolId: - type: integer - format: int64 - example: 2 - poolNmae: + msg: type: string - example: "BUSD/USDT" - updateTime: - type: integer - format: int64 - example: 1565769342148 - liquidity: - type: object - properties: - BUSD: - type: number - format: double - example: 100000315.79 - USDT: - type: number - format: double - example: 99999245.54 - required: - - BUSD - - USDT - share: - type: object - properties: - shareAmount: - type: number - format: double - example: 12415 - sharePercentage: - type: number - format: double - example: 0.00006207 - asset: - type: object - properties: - BUSD: - type: number - format: double - example: 6207.02 - USDT: - type: number - format: double - example: 6206.95 - required: - - BUSD - - USDT - required: - - shareAmount - - sharePercentage - - asset + example: "success" required: - - poolId - - poolNmae - - updateTime - - liquidity - - share + - msg '400': description: Bad Request content: @@ -16591,28 +14960,24 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/bswap/liquidityAdd: + /sapi/v1/portfolio/bnb-transfer: post: - summary: Add Liquidity (TRADE) + summary: BNB Transfer (USER_DATA) description: |- - Add liquidity to a pool. + BNB transfer can be between Margin Account and USDM Account - Weight(UID): 1000 (Additional: 3 times one second) + Weight(IP): 1500 tags: - - BSwap + - Portfolio Margin parameters: - - $ref: '#/components/parameters/poolId' - - name: type + - name: transferSide in: query - description: |- - * `Single` - to add a single token - * `Combination` - to add dual tokens + required: true schema: type: string - enum: [Single, Combination] - example: 'Single' - - $ref: '#/components/parameters/asset' - - $ref: '#/components/parameters/quantity' + enum: ['TO_UM','FROM_UM'] + example: 'TO_UM' + - $ref: '#/components/parameters/amount' - $ref: '#/components/parameters/recvWindow' - $ref: '#/components/parameters/timestamp' - $ref: '#/components/parameters/signature' @@ -16620,18 +14985,18 @@ paths: - ApiKeyAuth: [] responses: '200': - description: Operation Id + description: Result content: application/json: schema: - type: object - properties: - operationId: - type: integer - format: int64 - example: 12341 - required: - - operationId + type: object + properties: + tranId: + type: integer + format: int64 + example: 100000001 + required: + - tranId '400': description: Bad Request content: @@ -16644,39 +15009,17 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/bswap/liquidityRemove: + /sapi/v1/portfolio/repay-futures-switch: post: - summary: Remove Liquidity (TRADE) + summary: Change Auto-repay-futures Status (USER_DATA) description: |- - Remove liquidity from a pool, `type` include `SINGLE` and `COMBINATION`, asset is mandatory for single asset removal + Change Auto-repay-futures Status - Weight(UID): 1000 (Additional: 3 times one second) + Weight(IP): 1500 tags: - - BSwap + - Portfolio Margin parameters: - - $ref: '#/components/parameters/poolId' - - name: type - in: query - description: |- - * `SINGLE` - for single asset removal - * `COMBINATION` - for combination of all coins removal - required: true - schema: - type: string - enum: [SINGLE, COMBINATION] - example: 'SINGLE' - - name: asset - in: query - description: Mandatory for single asset removal - schema: - type: string - example: BNB - - name: shareAmount - in: query - required: true - schema: - type: number - format: double + - $ref: '#/components/parameters/autoRepay' - $ref: '#/components/parameters/recvWindow' - $ref: '#/components/parameters/timestamp' - $ref: '#/components/parameters/signature' @@ -16684,18 +15027,17 @@ paths: - ApiKeyAuth: [] responses: '200': - description: Operation Id + description: Result content: application/json: schema: - type: object - properties: - operationId: - type: integer - format: int64 - example: 12341 - required: - - operationId + type: object + properties: + msg: + type: string + example: "success" + required: + - msg '400': description: Bad Request content: @@ -16708,80 +15050,33 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/bswap/liquidityOps: get: - summary: Liquidity Operation Record (USER_DATA) + summary: Get Auto-repay-futures Status (USER_DATA) description: |- - Get liquidity operation (add/remove) records. + Query Auto-repay-futures Status - Weight(UID): 3000 + Weight(IP): 30 tags: - - BSwap + - Portfolio Margin parameters: - - name: operationId - in: query - schema: - type: integer - format: int64 - - $ref: '#/components/parameters/optionalPoolId' - - name: operation - in: query - schema: - type: string - enum: [ADD, REMOVE] - - $ref: '#/components/parameters/startTime' - - $ref: '#/components/parameters/endTime' - - $ref: '#/components/parameters/limit' - $ref: '#/components/parameters/recvWindow' - $ref: '#/components/parameters/timestamp' - $ref: '#/components/parameters/signature' security: - ApiKeyAuth: [] - responses: - '200': - description: Liquidity Operation Record - content: - application/json: - schema: - type: array - items: - type: object - properties: - operationId: - type: integer - format: int64 - example: 12341 - poolId: - type: integer - format: int64 - example: 2 - poolName: - type: string - example: "BUSD/USDT" - operation: - type: string - example: "ADD" - description: '"ADD" or "REMOVE"' - status: - type: integer - format: int32 - example: 1 - description: "0: pending, 1: success, 2: failed" - updateTime: - type: integer - format: int64 - example: 1565769342148 - shareAmount: - type: string - example: "10.1" + responses: + '200': + description: Result + content: + application/json: + schema: + type: object + properties: + autoRepay: + type: boolean + example: true required: - - operationId - - poolId - - poolName - - operation - - status - - updateTime - - shareAmount + - autoRepay '400': description: Bad Request content: @@ -16794,23 +15089,16 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/bswap/quote: - get: - summary: Request Quote (USER_DATA) + /sapi/v1/portfolio/repay-futures-negative-balance: + post: + summary: Repay futures Negative Balance (USER_DATA) description: |- - Request a quote for swap quote asset (selling asset) for base asset (buying asset), essentially price/exchange rates. - - quoteQty is quantity of quote asset (to sell). - - Please be noted the quote is for reference only, the actual price will change as the liquidity changes, it's recommended to swap immediate after request a quote for slippage prevention. + Repay futures Negative Balance - Weight(UID): 150 + Weight(IP): 1500 tags: - - BSwap + - Portfolio Margin parameters: - - $ref: '#/components/parameters/quoteAsset' - - $ref: '#/components/parameters/baseAsset' - - $ref: '#/components/parameters/quoteQty' - $ref: '#/components/parameters/recvWindow' - $ref: '#/components/parameters/timestamp' - $ref: '#/components/parameters/signature' @@ -16818,46 +15106,17 @@ paths: - ApiKeyAuth: [] responses: '200': - description: Quote Info + description: Result content: application/json: schema: - type: object - properties: - quoteAsset: - type: string - example: "USDT" - baseAsset: - type: string - example: "BUSD" - quoteQty: - type: number - format: double - example: 300000 - baseQty: - type: number - format: double - example: 299975 - price: - type: number - format: double - example: 1.00008334 - slippage: - type: number - format: double - example: 0.00007245 - fee: - type: number - format: double - example: 120 - required: - - quoteAsset - - baseAsset - - quoteQty - - baseQty - - price - - slippage - - fee + type: object + properties: + msg: + type: string + example: "success" + required: + - msg '400': description: Bad Request content: @@ -16870,38 +15129,29 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/bswap/swap: - post: - summary: Swap (TRADE) + /sapi/v1/portfolio/margin-asset-leverage: + get: + summary: Get Portfolio Margin Asset Leverage (USER_DATA) description: |- - Swap `quoteAsset` for `baseAsset`. - - Weight(UID): 1000 (Additional: 3 times one second) + Weight(IP): 50 tags: - - BSwap - parameters: - - $ref: '#/components/parameters/quoteAsset' - - $ref: '#/components/parameters/baseAsset' - - $ref: '#/components/parameters/quoteQty' - - $ref: '#/components/parameters/recvWindow' - - $ref: '#/components/parameters/timestamp' - - $ref: '#/components/parameters/signature' - security: - - ApiKeyAuth: [] + - Portfolio Margin responses: '200': - description: Swap Id + description: Classic Portfolio Margin Collateral Rate content: application/json: schema: - type: object - properties: - swapId: - type: integer - format: int64 - example: 2314 - required: - - swapId + type: array + items: + type: object + properties: + asset: + type: string + example: "USDC" + collateralRate: + type: string + example: '1.0000' '400': description: Bad Request content: @@ -16914,48 +15164,18 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - get: - summary: Swap History (USER_DATA) + + /sapi/v1/portfolio/asset-collection: + post: + summary: Fund Collection by Asset (USER_DATA) description: |- - Get swap history. + Transfers specific asset from Futures Account to Margin account - Weight(UID): 3000 + Weight(IP): 60 tags: - - BSwap + - Portfolio Margin parameters: - - name: swapId - in: query - schema: - type: integer - format: int64 - - $ref: '#/components/parameters/startTime' - - $ref: '#/components/parameters/endTime' - - name: status - in: query - description: |- - * `0` - pending for swap - * `1` - success - * `2` - failed - schema: - type: integer - format: int32 - example: 1 - - name: quoteAsset - in: query - schema: - type: string - example: 'USDT' - - name: baseAsset - in: query - schema: - type: string - example: 'BUSD' - - name: limit - in: query - schema: - type: integer - format: int32 - description: 'default 3, max 100' + - $ref: '#/components/parameters/asset' - $ref: '#/components/parameters/recvWindow' - $ref: '#/components/parameters/timestamp' - $ref: '#/components/parameters/signature' @@ -16963,59 +15183,17 @@ paths: - ApiKeyAuth: [] responses: '200': - description: Swap History + description: Result content: application/json: schema: - type: array - items: type: object properties: - swapId: - type: integer - format: int64 - example: 2314 - swapTime: - type: integer - format: int64 - example: 1565770342148 - status: - type: integer - format: int32 - example: 0 - description: "0: pending, 1: success, 2: failed" - quoteAsset: - type: string - example: "USDT" - baseAsset: + msg: type: string - example: "BUSD" - quoteQty: - type: number - format: double - example: 300000 - baseQty: - type: number - format: double - example: 299975 - price: - type: number - format: double - example: 1.00008334 - fee: - type: number - format: double - example: 120 + example: "success" required: - - swapId - - swapTime - - status - - quoteAsset - - baseAsset - - quoteQty - - baseQty - - price - - fee + - msg '400': description: Bad Request content: @@ -17028,27 +15206,19 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/bswap/poolConfigure: + /sapi/v1/blvt/tokenInfo: get: - summary: Pool Configure (USER_DATA) - description: 'Weight(IP): 150' + summary: BLVT Info (MARKET_DATA) + description: 'Weight(IP): 1' tags: - - BSwap + - BLVT parameters: - - name: poolId - in: query - schema: - type: integer - format: int64 - example: 2 - - $ref: '#/components/parameters/recvWindow' - - $ref: '#/components/parameters/timestamp' - - $ref: '#/components/parameters/signature' + - $ref: '#/components/parameters/optionalBlvtTokenName' security: - ApiKeyAuth: [] responses: '200': - description: Pool Information + description: List of token information content: application/json: schema: @@ -17056,139 +15226,104 @@ paths: items: type: object properties: - poolId: - type: integer - format: int64 - example: 2 - poolNmae: + tokenName: + type: string + example: "BTCDOWN" + description: + type: string + example: "3X Short Bitcoin Token" + underlying: + type: string + example: "BTC" + tokenIssued: + type: string + example: "717953.95" + basket: + type: string + example: "-821.474 BTCUSDT Futures" + currentBaskets: + type: array + items: + type: object + properties: + symbol: + type: string + example: "BTCUSDT" + amount: + type: string + example: "-1183.984" + notionalValue: + type: string + example: "-22871089.96704" + required: + - symbol + - amount + - notionalValue + nav: + type: string + example: "4.79" + realLeverage: + type: string + example: "-2.316" + fundingRate: + type: string + example: "0.001020" + dailyManagementFee: + type: string + example: "0.0001" + purchaseFeePct: + type: string + example: "0.0010" + dailyPurchaseLimit: + type: string + example: "100000.00" + redeemFeePct: + type: string + example: "0.0010" + dailyRedeemLimit: type: string - example: "BUSD/USDT" - updateTime: + example: "1000000.00" + timestamp: type: integer format: int64 - example: 1565769342148 - liquidity: - type: object - properties: - constantA: - type: integer - format: int64 - example: 2000 - description: '"NA" if pool is an innovation pool' - minRedeemShare: - type: number - format: double - example: 0.1 - slippageTolerance: - type: number - example: 0.2 - format: double - description: The swap proceeds only when the slippage is within the set range - required: - - constantA - - minRedeemShare - - slippageTolerance - assetConfigure: - type: object - properties: - BUSD: - type: object - properties: - minAdd: - type: integer - format: int64 - example: 10 - maxAdd: - type: integer - format: int64 - example: 20 - minSwap: - type: integer - format: int64 - example: 10 - maxSwap: - type: integer - format: int64 - example: 30 - required: - - minAdd - - maxAdd - - minSwap - - maxSwap - USDT: - type: object - properties: - minAdd: - type: integer - format: int64 - example: 10 - maxAdd: - type: integer - format: int64 - example: 20 - minSwap: - type: integer - format: int64 - example: 10 - maxSwap: - type: integer - format: int64 - example: 30 - required: - - minAdd - - maxAdd - - minSwap - - maxSwap - required: - - BUSD - - USDT + example: 1583127900000 required: - - poolId - - poolNmae - - updateTime - - liquidity - - assetConfigure + - tokenName + - description + - underlying + - tokenIssued + - basket + - currentBaskets + - nav + - realLeverage + - fundingRate + - dailyManagementFee + - purchaseFeePct + - dailyPurchaseLimit + - redeemFeePct + - dailyRedeemLimit + - timestamp '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/error' - '401': - description: Unauthorized Request - content: - application/json: - schema: - $ref: '#/components/schemas/error' - /sapi/v1/bswap/addLiquidityPreview: - get: - summary: Add Liquidity Preview (USER_DATA) - description: |- - Calculate expected share amount for adding liquidity in single or dual token. - - Weight(IP): 150 + /sapi/v1/blvt/subscribe: + post: + summary: Subscribe BLVT (USER_DATA) + description: 'Weight(IP): 1' tags: - - BSwap + - BLVT parameters: - - name: poolId - in: query - required: true - schema: - type: integer - format: int64 - example: 2 - - name: type + - $ref: '#/components/parameters/blvtTokenName' + - name: cost in: query - description: |- - * `SINGLE` - for adding a single token - * `COMBINATION` - for adding dual tokens + description: Spot balance required: true schema: - type: string - enum: [SINGLE, COMBINATION] - example: 'SINGLE' - - $ref: '#/components/parameters/quoteAsset' - - $ref: '#/components/parameters/quoteQty' + type: number + format: double - $ref: '#/components/parameters/recvWindow' - $ref: '#/components/parameters/timestamp' - $ref: '#/components/parameters/signature' @@ -17196,13 +15331,42 @@ paths: - ApiKeyAuth: [] responses: '200': - description: Add Liquidity Preview + description: Subscription Info content: application/json: schema: - oneOf: - - $ref: '#/components/schemas/bswapAddLiquidityPreviewCombination' - - $ref: '#/components/schemas/bswapAddLiquidityPreviewSingle' + type: object + properties: + id: + type: integer + format: int64 + example: 123 + status: + type: string + example: "S" + description: 'S, P, and F for "success", "pending", and "failure"' + tokenName: + type: string + example: "LINKUP" + amount: + type: string + example: "0.9559090500" + description: subscribed token amount + cost: + type: string + example: "9.99999995" + description: subscription cost in usdt + timestamp: + type: integer + format: int64 + example: 1600249972899 + required: + - id + - status + - tokenName + - amount + - cost + - timestamp '400': description: Bad Request content: @@ -17215,40 +15379,25 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/bswap/removeLiquidityPreview: + /sapi/v1/blvt/subscribe/record: get: - summary: Remove Liquidity Preview (USER_DATA) + summary: Query Subscription Record (USER_DATA) description: |- - Calculate the expected asset amount of single token redemption or dual token redemption. + - Only the data of the latest 90 days is available - Weight(IP): 150 + Weight(IP): 1 tags: - - BSwap + - BLVT parameters: - - name: poolId + - $ref: '#/components/parameters/optionalBlvtTokenName' + - name: id in: query - required: true schema: type: integer format: int64 - example: 2 - - name: type - in: query - description: |- - * `SINGLE` - remove and obtain a single token - * `COMBINATION` - remove and obtain dual token - required: true - schema: - type: string - enum: [SINGLE, COMBINATION] - example: 'SINGLE' - - $ref: '#/components/parameters/quoteAsset' - - name: shareAmount - in: query - required: true - schema: - type: number - format: double + - $ref: '#/components/parameters/startTime' + - $ref: '#/components/parameters/endTime' + - $ref: '#/components/parameters/limit' - $ref: '#/components/parameters/recvWindow' - $ref: '#/components/parameters/timestamp' - $ref: '#/components/parameters/signature' @@ -17256,13 +15405,47 @@ paths: - ApiKeyAuth: [] responses: '200': - description: Remove Liquidity Preview + description: List of subscription record content: application/json: schema: - oneOf: - - $ref: '#/components/schemas/bswapRmvLiquidityPreviewCombination' - - $ref: '#/components/schemas/bswapRmvLiquidityPreviewSingle' + type: object + properties: + id: + type: integer + format: int64 + example: 1 + tokenName: + type: string + example: "LINKUP" + amount: + type: string + example: "0.54216292" + description: Subscription amount + nav: + type: string + example: "18.42621386" + description: NAV price of subscription + fee: + type: string + example: "0.00999000" + description: Subscription fee in usdt + totalCharge: + type: string + example: "9.99999991" + description: Subscription cost in usdt + timestamp: + type: integer + format: int64 + example: 1599127217916 + required: + - id + - tokenName + - amount + - nav + - fee + - totalCharge + - timestamp '400': description: Bad Request content: @@ -17275,17 +15458,15 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/bswap/unclaimedRewards: - get: - summary: Get Unclaimed Rewards Record (USER_DATA) - description: |- - Get unclaimed rewards record. - - Weight(UID): 1000 + /sapi/v1/blvt/redeem: + post: + summary: Redeem BLVT (USER_DATA) + description: 'Weight(IP): 1' tags: - - BSwap + - BLVT parameters: - - $ref: '#/components/parameters/bswapClaimType' + - $ref: '#/components/parameters/blvtTokenName' + - $ref: '#/components/parameters/amount' - $ref: '#/components/parameters/recvWindow' - $ref: '#/components/parameters/timestamp' - $ref: '#/components/parameters/signature' @@ -17293,63 +15474,42 @@ paths: - ApiKeyAuth: [] responses: '200': - description: Unclaimed rewards record + description: Redemption record content: application/json: schema: type: object properties: - totalUnclaimedRewards: - type: object - properties: - BUSD: - type: number - format: float - example: 100000315.79 - BNB: - type: number - format: double - example: 0.00000001 - USDT: - type: number - format: double - example: 0.00000002 - required: - - BUSD - - BNB - - USDT - details: - type: object - properties: - BNB/USDT: - type: object - properties: - BUSD: - type: number - format: float - example: 100000315.79 - USDT: - type: number - format: double - example: 0.00000002 - required: - - BUSD - - USDT - BNB/BTC: - type: object - properties: - BNB: - type: number - format: double - example: 0.00000001 - required: - - BNB - required: - - BNB/USDT - - BNB/BTC + id: + type: integer + format: int64 + example: 123 + status: + type: string + example: "S" + description: 'S, P, and F for "success", "pending", and "failure"' + tokenName: + type: string + example: "LINKUP" + redeemAmount: + type: string + example: "0.95590905" + description: Redemption token amount + amount: + type: string + example: "10.05022099" + description: Redemption value in usdt + timestamp: + type: integer + format: int64 + example: 1600250279614 required: - - totalUnclaimedRewards - - details + - id + - status + - tokenName + - redeemAmount + - amount + - timestamp '400': description: Bad Request content: @@ -17362,17 +15522,30 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/bswap/claimRewards: - post: - summary: Claim rewards (TRADE) + /sapi/v1/blvt/redeem/record: + get: + summary: Redemption Record (USER_DATA) description: |- - Claim swap rewards or liquidity rewards + - Only the data of the latest 90 days is available - Weight(UID): 1000 + Weight(IP): 1 tags: - - BSwap + - BLVT parameters: - - $ref: '#/components/parameters/bswapClaimType' + - $ref: '#/components/parameters/optionalBlvtTokenName' + - name: id + in: query + schema: + type: integer + format: int64 + - $ref: '#/components/parameters/startTime' + - $ref: '#/components/parameters/endTime' + - name: limit + in: query + schema: + type: integer + format: int32 + description: 'default 1000, max 1000' - $ref: '#/components/parameters/recvWindow' - $ref: '#/components/parameters/timestamp' - $ref: '#/components/parameters/signature' @@ -17380,16 +15553,49 @@ paths: - ApiKeyAuth: [] responses: '200': - description: Result of claim + description: List of redemption record content: application/json: schema: - type: object - properties: - success: - type: boolean - required: - - success + type: array + items: + type: object + properties: + id: + type: integer + format: int64 + example: 1 + tokenName: + type: string + example: "LINKUP" + amount: + type: string + example: "0.54216292" + description: Redemption amount + nav: + type: string + example: "18.36345064" + description: NAV of redemption + fee: + type: string + example: "0.00995598" + description: Reemption fee + netProceed: + type: string + example: "9.94602604" + description: Net redemption value in usdt + timestamp: + type: integer + format: int64 + example: 1599128003050 + required: + - id + - tokenName + - amount + - nav + - fee + - netProceed + - timestamp '400': description: Bad Request content: @@ -17402,34 +15608,14 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/bswap/claimedHistory: + /sapi/v1/blvt/userLimit: get: - summary: Get Claimed History (USER_DATA) - description: |- - Get history of claimed rewards. - - Weight(UID): 1000 + summary: BLVT User Limit Info (USER_DATA) + description: 'Weight(IP): 1' tags: - - BSwap + - BLVT parameters: - - name: poolId - in: query - schema: - type: integer - format: int64 - - name: assetRewards - in: query - schema: - type: string - - $ref: '#/components/parameters/bswapClaimType' - - $ref: '#/components/parameters/startTime' - - $ref: '#/components/parameters/endTime' - - name: limit - in: query - description: Default 3, max 100 - schema: - type: integer - format: int32 + - $ref: '#/components/parameters/optionalBlvtTokenName' - $ref: '#/components/parameters/recvWindow' - $ref: '#/components/parameters/timestamp' - $ref: '#/components/parameters/signature' @@ -17437,44 +15623,29 @@ paths: - ApiKeyAuth: [] responses: '200': - description: Claimed History + description: List of token limits content: application/json: schema: type: array items: - type: object - properties: - poolId: - type: integer - format: int32 - example: 52 - poolName: - type: string - example: "BNB/USDT" - assetRewards: - type: string - example: "BNB" - claimTime: - type: integer - format: int64 - example: 1565769342148 - claimAmount: - type: number - format: float - example: 0.00000023 - status: - type: integer - format: int32 - example: 1 - description: "0: pending, 1: success" - required: - - poolId - - poolName - - assetRewards - - claimTime - - claimAmount - - status + type: object + properties: + tokenName: + type: string + example: "LINKUP" + userDailyTotalPurchaseLimit: + type: string + example: "1000" + description: USDT + userDailyTotalRedeemLimit: + type: string + example: "1000" + description: USDT + required: + - tokenName + - userDailyTotalPurchaseLimit + - userDailyTotalRedeemLimit '400': description: Bad Request content: @@ -19503,10 +17674,11 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/loan/flexible/borrow: + /sapi/v2/loan/flexible/borrow: post: summary: Borrow - Flexible Loan Borrow (TRADE) description: |- + - Only available for master account Weight(UID): 6000 tags: @@ -19561,7 +17733,7 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/loan/flexible/ongoing/orders: + /sapi/v2/loan/flexible/ongoing/orders: get: summary: Borrow - Get Flexible Loan Ongoing Orders (USER_DATA) description: |- @@ -19632,10 +17804,12 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/loan/flexible/borrow/history: + /sapi/v2/loan/flexible/borrow/history: get: summary: Borrow - Get Flexible Loan Borrow History (USER_DATA) description: |- + - If startTime and endTime are not sent, the recent 90-day data will be returned. + - The max interval between startTime and endTime is 180 days. Weight(IP): 400 tags: @@ -19709,10 +17883,11 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/loan/flexible/repay: + /sapi/v2/loan/flexible/repay: post: summary: Repay - Flexible Loan Repay (TRADE) description: |- + - repayAmount is mandatory even fullRepayment = FALSE Weight(IP): 6000 tags: @@ -19729,11 +17904,19 @@ paths: format: float - name: collateralReturn in: query + description: |- + Default: TRUE. + TRUE: Return extra collateral to earn account; + FALSE: Keep extra collateral in the order, and lower LTV. schema: type: boolean example: TRUE - name: fullRepayment in: query + description: |- + Default: FALSE. + TRUE: Full repayment; + FALSE: Partial repayment, based on loanAmount schema: type: boolean example: TRUE @@ -19770,6 +17953,7 @@ paths: example: "50.5" repayStatus: type: string + description: Repaid, Repaying, Failed example: "Repaid" required: - loanCoin @@ -19791,10 +17975,12 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/loan/flexible/repay/history: + /sapi/v2/loan/flexible/repay/history: get: summary: Repay - Get Flexible Loan Repayment History (USER_DATA) description: |- + - If startTime and endTime are not sent, the recent 90-day data will be returned. + - The max interval between startTime and endTime is 180 days. Weight(IP): 400 tags: @@ -19869,10 +18055,11 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/loan/flexible/adjust/ltv: + /sapi/v2/loan/flexible/adjust/ltv: post: summary: Adjust LTV - Flexible Loan Adjust LTV (TRADE) description: |- + - API Key needs Spot & Margin Trading permission for this endpoint Weight(UID): 6000 tags: @@ -19920,16 +18107,12 @@ paths: currentLTV: type: string example: "0.235" - status: - type: string - example: "Succeeds" required: - loanCoin - collateralCoin - direction - adjustmentAmount - currentLTV - - status '400': description: Bad Request content: @@ -19942,10 +18125,12 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/loan/flexible/ltv/adjustment/history: + /sapi/v2/loan/flexible/ltv/adjustment/history: get: summary: Adjust LTV - Get Flexible Loan LTV Adjustment History (USER_DATA) description: |- + - If startTime and endTime are not sent, the recent 90-day data will be returned. + - The max interval between startTime and endTime is 180 days. Weight(IP): 400 tags: @@ -20024,7 +18209,7 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/loan/flexible/loanable/data: + /sapi/v2/loan/flexible/loanable/data: get: summary: Get Flexible Loan Assets Data (USER_DATA) description: |- @@ -20089,7 +18274,7 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/loan/flexible/collateral/data: + /sapi/v2/loan/flexible/collateral/data: get: summary: Get Flexible Loan Collateral Assets Data (USER_DATA) description: |- @@ -20687,15 +18872,246 @@ paths: format: int64 example: 1623381330472 required: - - orderId - - orderStatus - - fromAsset - - fromAmount - - toAsset - - toAmount - - ratio - - inverseRatio - - createTime + - orderId + - orderStatus + - fromAsset + - fromAmount + - toAsset + - toAmount + - ratio + - inverseRatio + - createTime + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/error' + '401': + description: Unauthorized Request + content: + application/json: + schema: + $ref: '#/components/schemas/error' + /sapi/v1/convert/limit/placeOrder: + post: + summary: Place limit order (USER_DATA) + description: |- + Enable users to place a limit order + + - baseAsset or quoteAsset can be determined via exchangeInfo endpoint. + - Limit price is defined from baseAsset to quoteAsset. + - Either baseAmount or quoteAmount is used. + + Weight(UID): 500 + tags: + - Convert + parameters: + - $ref: '#/components/parameters/baseAsset' + - $ref: '#/components/parameters/quoteAsset' + - name: limitPrice + in: query + required: true + description: Symbol limit price (from baseAsset to quoteAsset) + schema: + type: number + format: double + - name: baseAmount + in: query + required: false + description: Base asset amount. (One of baseAmount or quoteAmount is required) + schema: + type: number + format: double + - name: quoteAmount + in: query + required: false + description: Quote asset amount. (One of baseAmount or quoteAmount is required) + schema: + type: number + format: double + - $ref: '#/components/parameters/side' + - name: walletType + in: query + required: false + description: SPOT or FUNDING or SPOT_FUNDING. It is to use which type of assets. Default is SPOT. + schema: + type: string + enum: ['SPOT', 'FUNDING', 'SPOT_FUNDING'] + example: 'SPOT' + - name: expiredType + in: query + required: false + description: 1_D, 3_D, 7_D, 30_D (D means day) + schema: + type: string + enum: ['1_D', '3_D', '7_D', '30_D'] + example: '1_D' + - $ref: '#/components/parameters/recvWindow' + - $ref: '#/components/parameters/timestamp' + - $ref: '#/components/parameters/signature' + security: + - ApiKeyAuth: [] + responses: + '200': + description: + content: + application/json: + schema: + type: object + properties: + orderId: + type: integer + format: int64 + example: "1603680255057330400" + status: + type: string + example: "PROCESS" + required: + - orderId + - status + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/error' + '401': + description: Unauthorized Request + content: + application/json: + schema: + $ref: '#/components/schemas/error' + /sapi/v1/convert/limit/cancelOrder: + post: + summary: Cancel limit order (USER_DATA) + description: |- + Enable users to cancel a limit order + + Weight(UID): 200 + tags: + - Convert + parameters: + - name: orderId + in: query + required: true + schema: + type: integer + format: int64 + example: 1603680255057330400 + - $ref: '#/components/parameters/recvWindow' + - $ref: '#/components/parameters/timestamp' + - $ref: '#/components/parameters/signature' + security: + - ApiKeyAuth: [] + responses: + '200': + description: Cancel Order + content: + application/json: + schema: + type: object + properties: + orderId: + type: integer + format: int64 + example: 1603680255057330400 + status: + type: string + example: "CANCELED" + required: + - orderId + - status + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/error' + '401': + description: Unauthorized Request + content: + application/json: + schema: + $ref: '#/components/schemas/error' + /sapi/v1/convert/limit/queryOpenOrders: + get: + summary: Query limit open orders (USER_DATA) + description: |- + Enable users to query for all existing limit orders + + Weight(UID): 3000 + tags: + - Convert + parameters: + - $ref: '#/components/parameters/recvWindow' + - $ref: '#/components/parameters/timestamp' + - $ref: '#/components/parameters/signature' + security: + - ApiKeyAuth: [] + responses: + '200': + description: All existing limit orders + content: + application/json: + schema: + type: object + properties: + list: + type: array + items: + type: object + properties: + quoteId: + type: string + example: "18sdf87kh9df" + orderId: + type: integer + format: int64 + example: "1603680255057330400" + orderStatus: + type: string + example: "SUCCESS" + fromAsset: + type: string + example: "BNB" + fromAmount: + type: string + example: "10" + toAsset: + type: string + example: "USDT" + toAmount: + type: string + example: "2317.89" + ratio: + type: string + example: "231.789" + inverseRatio: + type: string + example: "0.00431427" + createTime: + type: integer + format: int64 + example: 1614089498000 + expiredTimestamp: + type: integer + format: int64 + example: 1614099498000 + required: + - quoteId + - orderId + - orderStatus + - fromAsset + - fromAmount + - toAsset + - toAmount + - ratio + - inverseRatio + - createTime + - expiredTimestamp + required: + - list '400': description: Bad Request content: @@ -21194,8 +19610,304 @@ paths: - fee - feeAsset required: - - total - - list + - total + - list + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/error' + '401': + description: Unauthorized Request + content: + application/json: + schema: + $ref: '#/components/schemas/error' + /sapi/v1/nft/user/getAsset: + get: + summary: Get NFT Asset (USER_DATA) + description: 'Weight(UID): 3000' + tags: + - NFT + parameters: + - $ref: '#/components/parameters/limit50' + - $ref: '#/components/parameters/page' + - $ref: '#/components/parameters/recvWindow' + - $ref: '#/components/parameters/timestamp' + - $ref: '#/components/parameters/signature' + security: + - ApiKeyAuth: [] + responses: + '200': + description: Asset Information + content: + application/json: + schema: + type: object + properties: + total: + type: integer + format: int32 + example: 347 + list: + type: array + items: + type: object + properties: + network: + type: string + example: "BSC" + contractAddress: + type: string + example: "REGULAR11234567891779" + tokenId: + type: string + example: "100900000017" + required: + - network + - contractAddress + - tokenId + required: + - total + - list + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/error' + '401': + description: Unauthorized Request + content: + application/json: + schema: + $ref: '#/components/schemas/error' + /sapi/v1/giftcard/createCode: + post: + summary: Create a Binance Code (USER_DATA) + description: |- + This API is for creating a Binance Code. To get started with, please make sure: + + - You have a Binance account + - You have passed kyc + - You have a sufficient balance in your Binance funding wallet + - You need Enable Withdrawals for the API Key which requests this endpoint. + + Daily creation volume: 2 BTC / 24H Daily creation times: 200 Codes / 24H + + Weight(IP): 1 + tags: + - Gift Card + parameters: + - name: token + in: query + description: The coin type contained in the Binance Code + required: true + schema: + type: string + - name: amount + in: query + required: true + description: The amount of the coin + schema: + type: number + format: double + - $ref: '#/components/parameters/recvWindow' + - $ref: '#/components/parameters/timestamp' + - $ref: '#/components/parameters/signature' + security: + - ApiKeyAuth: [] + responses: + '200': + description: Code creation + content: + application/json: + schema: + type: object + properties: + code: + type: string + example: "000000" + message: + type: string + example: "success" + data: + type: object + properties: + referenceNo: + type: string + example: "0033002327977405" + code: + type: string + example: "AOGANK3NB4GIT3C6" + expiredTime: + type: integer + format: int64 + example: 1727417154000 + required: + - referenceNo + - code + - expiredTime + success: + type: boolean + required: + - code + - message + - data + - success + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/error' + '401': + description: Unauthorized Request + content: + application/json: + schema: + $ref: '#/components/schemas/error' + /sapi/v1/giftcard/redeemCode: + post: + summary: Redeem a Binance Code (USER_DATA) + description: |- + This API is for redeeming the Binance Code. Once redeemed, the coins will be deposited in your funding wallet. + + Please note that if you enter the wrong code 5 times within 24 hours, you will no longer be able to redeem any Binance Code that day. + + Weight(IP): 1 + tags: + - Gift Card + parameters: + - name: code + in: query + description: Binance Code + required: true + schema: + type: string + - name: externalUid + in: query + description: Each external unique ID represents a unique user on the partner platform. The function helps you to identify the redemption behavior of different users, such as redemption frequency and amount. It also helps risk and limit control of a single account, such as daily limit on redemption volume, frequency, and incorrect number of entries. This will also prevent a single user account reach the partner's daily redemption limits. We strongly recommend you to use this feature and transfer us the User ID of your users if you have different users redeeming Binance codes on your platform. To protect user data privacy, you may choose to transfer the user id in any desired format (max. 400 characters). + schema: + type: string + - $ref: '#/components/parameters/recvWindow' + - $ref: '#/components/parameters/timestamp' + - $ref: '#/components/parameters/signature' + security: + - ApiKeyAuth: [] + responses: + '200': + description: Redeemed Information + content: + application/json: + schema: + type: object + properties: + code: + type: string + example: "000000" + message: + type: string + example: "success" + data: + type: object + properties: + token: + type: string + example: "BNB" + amount: + type: string + example: "10" + referenceNo: + type: string + example: "0033002327977405" + identityNo: + type: string + example: "10316281761814589440" + required: + - token + - amount + - referenceNo + - identityNo + success: + type: boolean + required: + - code + - message + - data + - success + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/error' + '401': + description: Unauthorized Request + content: + application/json: + schema: + $ref: '#/components/schemas/error' + /sapi/v1/giftcard/verify: + get: + summary: Verify a Binance Code (USER_DATA) + description: |- + This API is for verifying whether the Binance Code is valid or not by entering Binance Code or reference number. + + Please note that if you enter the wrong binance code 5 times within an hour, you will no longer be able to verify any binance code for that hour. + + Weight(IP): 1 + tags: + - Gift Card + parameters: + - name: referenceNo + in: query + description: reference number + required: true + schema: + type: string + - $ref: '#/components/parameters/recvWindow' + - $ref: '#/components/parameters/timestamp' + - $ref: '#/components/parameters/signature' + security: + - ApiKeyAuth: [] + responses: + '200': + description: Code Verification + content: + application/json: + schema: + type: object + properties: + code: + type: string + example: "000000" + message: + type: string + example: "success" + data: + type: object + properties: + valid: + type: boolean + token: + type: string + example: "BNB" + amount: + type: string + example: "0.00000001" + required: + - valid + - token + - amount + success: + type: boolean + required: + - code + - message + - data + - success '400': description: Bad Request content: @@ -21208,15 +19920,18 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/nft/user/getAsset: + /sapi/v1/giftcard/cryptography/rsa-public-key: get: - summary: Get NFT Asset (USER_DATA) - description: 'Weight(UID): 3000' + summary: Fetch RSA Public Key (USER_DATA) + description: |- + This API is for fetching the RSA Public Key. + This RSA Public key will be used to encrypt the card code. + Please note that the RSA Public key fetched is valid only for the current day. + + Weight(IP): 1 tags: - - NFT + - Gift Card parameters: - - $ref: '#/components/parameters/limit50' - - $ref: '#/components/parameters/page' - $ref: '#/components/parameters/recvWindow' - $ref: '#/components/parameters/timestamp' - $ref: '#/components/parameters/signature' @@ -21224,37 +19939,30 @@ paths: - ApiKeyAuth: [] responses: '200': - description: Asset Information + description: RSA Public Key. content: application/json: schema: type: object properties: - total: - type: integer - format: int32 - example: 347 - list: - type: array - items: - type: object - properties: - network: - type: string - example: "BSC" - contractAddress: - type: string - example: "REGULAR11234567891779" - tokenId: - type: string - example: "100900000017" - required: - - network - - contractAddress - - tokenId + code: + type: string + example: '000000' + message: + type: string + example: success + data: + type: string + example: >- + MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCXBBVKLAc1GQ5FsIFFqOHrPTox5noBONIKr+IAedTR9FkVxq6e65updEbfdhRNkMOeYIO2i0UylrjGC0X8YSoIszmrVHeV0l06Zh1oJuZos1+7N+WLuz9JvlPaawof3GUakTxYWWCa9+8KIbLKsoKMdfS96VT+8iOXO3quMGKUmQIDAQAB + success: + type: boolean + example: true required: - - total - - list + - code + - message + - data + - success '400': description: Bad Request content: @@ -21267,12 +19975,15 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/giftcard/createCode: + /sapi/v1/giftcard/buyCode: post: - summary: Create a Binance Code (USER_DATA) + summary: Buy a Binance Code (TRADE) description: |- - This API is for creating a Binance Code. To get started with, please make sure: + This API is for buying a fixed-value Binance Code, which means your Binance Code will be redeemable to a token that is different to the token that you are paying in. If the token you’re paying and the redeemable token are the same, please use the Create Binance Code endpoint. + You can use supported crypto currency or fiat token as baseToken to buy Binance Code that is redeemable to your chosen faceToken. + Once successfully purchased, the amount of baseToken would be deducted from your funding wallet. + To get started with, please make sure: - You have a Binance account - You have passed kyc - You have a sufficient balance in your Binance funding wallet @@ -21284,16 +19995,22 @@ paths: tags: - Gift Card parameters: - - name: token + - name: baseToken in: query - description: The coin type contained in the Binance Code + description: The token you want to pay, example BUSD required: true schema: type: string - - name: amount + - name: faceToken + in: query + description: The token you want to buy, example BNB. If faceToken = baseToken, it's the same as createCode endpoint. + required: true + schema: + type: string + - name: baseTokenAmount in: query required: true - description: The amount of the coin + description: The base token asset quantity, example 1.002 schema: type: number format: double @@ -21325,9 +20042,14 @@ paths: code: type: string example: "AOGANK3NB4GIT3C6" + expiredTime: + type: integer + format: int64 + example: 1727417154000 required: - referenceNo - code + - expiredTime success: type: boolean required: @@ -21347,29 +20069,22 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/giftcard/redeemCode: - post: - summary: Redeem a Binance Code (USER_DATA) + /sapi/v1/giftcard/buyCode/token-limit: + get: + summary: Fetch Token Limit (USER_DATA) description: |- - This API is for redeeming the Binance Code. Once redeemed, the coins will be deposited in your funding wallet. - - Please note that if you enter the wrong code 5 times within 24 hours, you will no longer be able to redeem any Binance Code that day. + This API is to help you verify which tokens are available for you to purchase fixed-value gift cards as mentioned in section 2 and it's limitation. Weight(IP): 1 tags: - Gift Card parameters: - - name: code + - name: baseToken in: query - description: Binance Code + description: The token you want to pay, example BUSD required: true schema: type: string - - name: externalUid - in: query - description: Each external unique ID represents a unique user on the partner platform. The function helps you to identify the redemption behavior of different users, such as redemption frequency and amount. It also helps risk and limit control of a single account, such as daily limit on redemption volume, frequency, and incorrect number of entries. This will also prevent a single user account reach the partner's daily redemption limits. We strongly recommend you to use this feature and transfer us the User ID of your users if you have different users redeeming Binance codes on your platform. To protect user data privacy, you may choose to transfer the user id in any desired format (max. 400 characters). - schema: - type: string - $ref: '#/components/parameters/recvWindow' - $ref: '#/components/parameters/timestamp' - $ref: '#/components/parameters/signature' @@ -21377,7 +20092,7 @@ paths: - ApiKeyAuth: [] responses: '200': - description: Redeemed Information + description: Token limit content: application/json: schema: @@ -21392,23 +20107,18 @@ paths: data: type: object properties: - token: + coin: type: string example: "BNB" - amount: - type: string - example: "10" - referenceNo: + fromMin: type: string - example: "0033002327977405" - identityNo: + example: "0.01" + fromMax: type: string - example: "10316281761814589440" + example: "1" required: - - token - - amount - referenceNo - - identityNo + - code success: type: boolean required: @@ -21428,24 +20138,20 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/giftcard/verify: + /sapi/v1/lending/auto-invest/target-asset/list: get: - summary: Verify a Binance Code (USER_DATA) + summary: Get target asset list (USER_DATA) description: |- - This API is for verifying whether the Binance Code is valid or not by entering Binance Code or reference number. - - Please note that if you enter the wrong binance code 5 times within an hour, you will no longer be able to verify any binance code for that hour. - Weight(IP): 1 tags: - - Gift Card + - Auto-Invest parameters: - - name: referenceNo + - name: targetAsset in: query - description: reference number - required: true schema: type: string + - $ref: '#/components/parameters/size' + - $ref: '#/components/parameters/current' - $ref: '#/components/parameters/recvWindow' - $ref: '#/components/parameters/timestamp' - $ref: '#/components/parameters/signature' @@ -21453,40 +20159,44 @@ paths: - ApiKeyAuth: [] responses: '200': - description: Code Verification + description: Target asset list content: application/json: schema: type: object properties: - code: - type: string - example: "000000" - message: + targetAssets: type: string - example: "success" - data: - type: object - properties: - valid: - type: boolean - token: - type: string - example: "BNB" - amount: - type: string - example: "0.00000001" - required: - - valid - - token - - amount - success: - type: boolean - required: - - code - - message - - data - - success + example: "BTC" + autoInvestAssetList: + type: array + items: + type: object + properties: + targetAsset: + type: string + example: "BTC" + roiAndDimensionTypeList: + type: array + items: + type: object + properties: + simulateRoi: + type: string + example: "5.004" + dimensionValue: + type: string + example: "3" + dimensionUnit: + type: string + example: "year" + required: + - simulateRoi + - dimensionValue + - dimensionUnit + required: + - targetAsset + - roiAndDimensionTypeList '400': description: Bad Request content: @@ -21499,18 +20209,23 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/giftcard/cryptography/rsa-public-key: + /sapi/v1/lending/auto-invest/target-asset/roi/list: get: - summary: Fetch RSA Public Key (USER_DATA) + summary: Get target asset ROI data (USER_DATA) description: |- - This API is for fetching the RSA Public Key. - This RSA Public key will be used to encrypt the card code. - Please note that the RSA Public key fetched is valid only for the current day. + ROI return list for target asset Weight(IP): 1 tags: - - Gift Card + - Auto-Invest parameters: + - $ref: '#/components/parameters/targetAsset' + - name: hisRoiType + in: query + required: true + schema: + type: string + example: FIVE_YEAR - $ref: '#/components/parameters/recvWindow' - $ref: '#/components/parameters/timestamp' - $ref: '#/components/parameters/signature' @@ -21518,30 +20233,23 @@ paths: - ApiKeyAuth: [] responses: '200': - description: RSA Public Key. + description: Target asset list content: application/json: schema: - type: object - properties: - code: - type: string - example: '000000' - message: - type: string - example: success - data: - type: string - example: >- - MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCXBBVKLAc1GQ5FsIFFqOHrPTox5noBONIKr+IAedTR9FkVxq6e65updEbfdhRNkMOeYIO2i0UylrjGC0X8YSoIszmrVHeV0l06Zh1oJuZos1+7N+WLuz9JvlPaawof3GUakTxYWWCa9+8KIbLKsoKMdfS96VT+8iOXO3quMGKUmQIDAQAB - success: - type: boolean - example: true - required: - - code - - message - - data - - success + type: array + items: + type: object + properties: + date: + type: string + example: "1648378800000" + simulateRoi: + type: string + example: "1.75" + required: + - date + - simulateRoi '400': description: Bad Request content: @@ -21554,45 +20262,16 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/giftcard/buyCode: - post: - summary: Buy a Binance Code (TRADE) + /sapi/v1/lending/auto-invest/all/asset: + get: + summary: Query all source asset and target asset (USER_DATA) description: |- - This API is for buying a fixed-value Binance Code, which means your Binance Code will be redeemable to a token that is different to the token that you are paying in. If the token you’re paying and the redeemable token are the same, please use the Create Binance Code endpoint. - You can use supported crypto currency or fiat token as baseToken to buy Binance Code that is redeemable to your chosen faceToken. - Once successfully purchased, the amount of baseToken would be deducted from your funding wallet. - - To get started with, please make sure: - - You have a Binance account - - You have passed kyc - - You have a sufficient balance in your Binance funding wallet - - You need Enable Withdrawals for the API Key which requests this endpoint. - - Daily creation volume: 2 BTC / 24H Daily creation times: 200 Codes / 24H + Query all source assets and target assets Weight(IP): 1 tags: - - Gift Card + - Auto-Invest parameters: - - name: baseToken - in: query - description: The token you want to pay, example BUSD - required: true - schema: - type: string - - name: faceToken - in: query - description: The token you want to buy, example BNB. If faceToken = baseToken, it's the same as createCode endpoint. - required: true - schema: - type: string - - name: baseTokenAmount - in: query - required: true - description: The base token asset quantity, example 1.002 - schema: - type: number - format: double - $ref: '#/components/parameters/recvWindow' - $ref: '#/components/parameters/timestamp' - $ref: '#/components/parameters/signature' @@ -21600,37 +20279,25 @@ paths: - ApiKeyAuth: [] responses: '200': - description: Code creation + description: Target asset content: application/json: schema: type: object properties: - code: - type: string - example: "000000" - message: - type: string - example: "success" - data: - type: object - properties: - referenceNo: - type: string - example: "0033002327977405" - code: - type: string - example: "AOGANK3NB4GIT3C6" - required: - - referenceNo - - code - success: - type: boolean + targetAssets: + type: array + items: + type: string + example: ["BTC", "BNB"] + sourceAssets: + type: array + items: + type: string + example: ["BTC", "BNB"] required: - - code - - message - - data - - success + - targetAssets + - sourceAssets '400': description: Bad Request content: @@ -21643,22 +20310,39 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/giftcard/buyCode/token-limit: + /sapi/v1/lending/auto-invest/source-asset/list: get: - summary: Fetch Token Limit (USER_DATA) + summary: Query source asset list (USER_DATA) description: |- - This API is to help you verify which tokens are available for you to purchase fixed-value gift cards as mentioned in section 2 and it's limitation. + Query Source Asset to be used for investment Weight(IP): 1 tags: - - Gift Card + - Auto-Invest parameters: - - name: baseToken + - name: targetAsset + in: query + schema: + type: string + example: BTC + - name: indexId + in: query + schema: + type: integer + format: int64 + example: 1 + - name: usageType in: query - description: The token you want to pay, example BUSD required: true schema: type: string + example: RECURRING + - name: flexibleAllowedToUse + in: query + required: false + schema: + type: boolean + example: true - $ref: '#/components/parameters/recvWindow' - $ref: '#/components/parameters/timestamp' - $ref: '#/components/parameters/signature' @@ -21666,40 +20350,44 @@ paths: - ApiKeyAuth: [] responses: '200': - description: Token limit + description: Asset list content: application/json: schema: type: object properties: - code: - type: string - example: "000000" - message: + feeRate: type: string - example: "success" - data: - type: object - properties: - coin: - type: string - example: "BNB" - fromMin: - type: string - example: "0.01" - fromMax: - type: string - example: "1" - required: - - referenceNo - - code - success: - type: boolean + example: "0.002" + sourceAssets: + type: array + items: + type: object + properties: + sourceAsset: + type: string + example: "USDT" + assetMinAmount: + type: string + example: "0.1" + assetMaxAmount: + type: string + example: "1000000" + scale: + type: string + example: "2" + flexibleAmount: + type: string + example: "1111" + required: + - sourceAsset + - assetMinAmount + - assetMaxAmount + - scale + - flexibleAmount required: - - code - - message - - data - - success + - feeRate + - sourceAssets '400': description: Bad Request content: @@ -21712,20 +20400,90 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/lending/auto-invest/target-asset/list: - get: - summary: Get target asset list (USER_DATA) + /sapi/v1/lending/auto-invest/plan/add: + post: + summary: Investment plan creation (USER_DATA) description: |- + Post an investment plan creation + Weight(IP): 1 tags: - Auto-Invest parameters: - - name: targetAsset + - name: sourceType + in: query + required: true + schema: + type: string + enum: [MAIN_SITE, TR] + example: MAIN_SITE + - name: requestId + in: query + schema: + type: string + - name: planType + in: query + required: true + schema: + type: string + enum: [SINGLE, PORTFOLIO, INDEX] + example: SINGLE + - name: IndexId + in: query + schema: + type: integer + format: int64 + - name: subscriptionAmount + in: query + required: true + schema: + type: number + format: float + - name: subscriptionCycle in: query + required: true schema: type: string - - $ref: '#/components/parameters/size' - - $ref: '#/components/parameters/current' + enum: [H1, H4, H8, H12, WEEKLY, DAILY, MONTHLY, BI_WEEKLY] + - name: subscriptionStartDay + in: query + schema: + type: integer + - name: subscriptionStartWeekday + in: query + schema: + type: string + enum: [MON, TUE, WED, THU, FRI, SAT, SUN] + - name: subscriptionStartTime + in: query + required: true + schema: + type: integer + - name: sourceAsset + in: query + required: true + schema: + type: string + example: "USDT" + - name: flexibleAllowedToUse + in: query + schema: + type: boolean + example: true + - name: details + in: query + required: true + schema: + type: array + items: + type: object + properties: + targetAsset: + type: string + example: "BTC" + percentage: + type: integer + format: int64 - $ref: '#/components/parameters/recvWindow' - $ref: '#/components/parameters/timestamp' - $ref: '#/components/parameters/signature' @@ -21733,44 +20491,22 @@ paths: - ApiKeyAuth: [] responses: '200': - description: Target asset list + description: Plan result content: application/json: schema: type: object properties: - targetAssets: - type: string - example: "BTC" - autoInvestAssetList: - type: array - items: - type: object - properties: - targetAsset: - type: string - example: "BTC" - roiAndDimensionTypeList: - type: array - items: - type: object - properties: - simulateRoi: - type: string - example: "5.004" - dimensionValue: - type: string - example: "3" - dimensionUnit: - type: string - example: "year" - required: - - simulateRoi - - dimensionValue - - dimensionUnit - required: - - targetAsset - - roiAndDimensionTypeList + planId: + type: integer + example: 12345 + nextExecutionDateTime: + type: integer + format: int64 + example: 1648378800000 + required: + - planId + - nextExecutionDateTime '400': description: Bad Request content: @@ -21783,23 +20519,71 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/lending/auto-invest/target-asset/roi/list: - get: - summary: Get target asset ROI data (USER_DATA) + /sapi/v1/lending/auto-invest/plan/edit: + post: + summary: Investment plan adjustment description: |- - ROI return list for target asset + Query Source Asset to be used for investment Weight(IP): 1 tags: - Auto-Invest parameters: - - $ref: '#/components/parameters/targetAsset' - - name: hisRoiType + - name: planId + in: query + required: true + schema: + type: integer + - name: subscriptionAmount + in: query + required: true + schema: + type: number + format: float + - name: subscriptionCycle in: query required: true schema: type: string - example: FIVE_YEAR + enum: [H1, H4, H8, H12, WEEKLY, DAILY, MONTHLY, BI_WEEKLY] + - name: subscriptionStartDay + in: query + schema: + type: integer + - name: subscriptionStartWeekday + in: query + schema: + type: string + enum: [MON, TUE, WED, THU, FRI, SAT, SUN] + - name: subscriptionStartTime + in: query + required: true + schema: + type: integer + - name: sourceAsset + in: query + required: true + schema: + type: string + example: "USDT" + - name: flexibleAllowedToUse + in: query + schema: + type: boolean + example: true + - name: details + in: query + schema: + type: array + items: + type: object + properties: + targetAsset: + type: string + example: "BTC" + percentage: + type: integer + format: int64 - $ref: '#/components/parameters/recvWindow' - $ref: '#/components/parameters/timestamp' - $ref: '#/components/parameters/signature' @@ -21807,23 +20591,22 @@ paths: - ApiKeyAuth: [] responses: '200': - description: Target asset list + description: Plan result content: application/json: schema: - type: array - items: - type: object - properties: - date: - type: string - example: "1648378800000" - simulateRoi: - type: string - example: "1.75" - required: - - date - - simulateRoi + type: object + properties: + planId: + type: integer + example: 12345 + nextExecutionDateTime: + type: integer + format: int64 + example: 1648378800000 + required: + - planId + - nextExecutionDateTime '400': description: Bad Request content: @@ -21836,16 +20619,27 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/lending/auto-invest/all/asset: - get: - summary: Query all source asset and target asset (USER_DATA) + /sapi/v1/lending/auto-invest/plan/edit-status: + post: + summary: Change Plan Status description: |- - Query all source assets and target assets + Change Plan Status Weight(IP): 1 tags: - Auto-Invest parameters: + - name: planId + in: query + required: true + schema: + type: integer + - name: status + in: query + required: true + schema: + type: string + enum: [ONGOING, PAUSED, REMOVED] - $ref: '#/components/parameters/recvWindow' - $ref: '#/components/parameters/timestamp' - $ref: '#/components/parameters/signature' @@ -21853,25 +20647,26 @@ paths: - ApiKeyAuth: [] responses: '200': - description: Target asset + description: Plan result content: application/json: schema: type: object properties: - targetAssets: - type: array - items: - type: string - example: ["BTC", "BNB"] - sourceAssets: - type: array - items: - type: string - example: ["BTC", "BNB"] + planId: + type: integer + example: 12345 + nextExecutionDateTime: + type: integer + format: int64 + example: 1648378800000 + status: + type: string + example: "ONGOING" required: - - targetAssets - - sourceAssets + - planId + - nextExecutionDateTime + - status '400': description: Bad Request content: @@ -21884,39 +20679,21 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/lending/auto-invest/source-asset/list: + /sapi/v1/lending/auto-invest/plan/list: get: - summary: Query source asset list (USER_DATA) + summary: Get list of plans description: |- - Query Source Asset to be used for investment + Query plan lists Weight(IP): 1 tags: - Auto-Invest parameters: - - name: targetAsset - in: query - schema: - type: string - example: BTC - - name: indexId - in: query - schema: - type: integer - format: int64 - example: 1 - - name: usageType + - name: planType in: query required: true schema: type: string - example: RECURRING - - name: flexibleAllowedToUse - in: query - required: false - schema: - type: boolean - example: true - $ref: '#/components/parameters/recvWindow' - $ref: '#/components/parameters/timestamp' - $ref: '#/components/parameters/signature' @@ -21924,44 +20701,128 @@ paths: - ApiKeyAuth: [] responses: '200': - description: Asset list + description: Plan result content: application/json: schema: type: object properties: - feeRate: + planValueInUSD: + type: string + example: "123" + planValueInBTC: type: string - example: "0.002" - sourceAssets: + example: "0.1" + pnlInUSD: + type: string + example: "120" + roi: + type: string + example: "2.3" + plan: type: array items: type: object properties: + planId: + type: integer + example: 12345 + planType: + type: string + example: "SINGLE" + editAllowed: + type: string + example: "true" + creationDateTime: + type: integer + format: int64 + example: 1648378800000 + firstExecutionDateTime: + type: integer + format: int64 + example: 1648378800000 + nextExecutionDateTime: + type: integer + format: int64 + example: 1648378800000 + status: + type: string + example: "ONGOING" + lastUpdatedDateTime: + type: integer + format: int64 + example: 1648378800000 + targetAsset: + type: string + example: "BTC" + totalTargetAmount: + type: string + example: "0.111" sourceAsset: type: string - example: "USDT" - assetMinAmount: + example: "BUSD" + totalInvestedInUSD: + type: string + example: "4.555" + subscriptionAmount: type: string example: "0.1" - assetMaxAmount: + subscriptionCycle: type: string - example: "1000000" - scale: + example: "WEEKLY" + subscriptionStartDay: type: string - example: "2" - flexibleAmount: + example: "1" + subscriptionStartWeekday: type: string - example: "1111" + example: "MON" + subscriptionStartTime: + type: string + example: "1" + sourceWallet: + type: string + example: "SPOT_WALLET" + flexibleAllowedToUse: + type: string + example: "false" + planValueInUSD: + type: string + example: "101.2" + pnlInUSD: + type: string + example: "101.2" + roi: + type: string + example: "1.02" required: + - planId + - planType + - editAllowed + - creationDateTime + - firstExecutionDateTime + - nextExecutionDateTime + - status + - lastUpdatedDateTime + - targetAsset + - totalTargetAmount - sourceAsset - - assetMinAmount - - assetMaxAmount - - scale - - flexibleAmount + - totalInvestedInUSD + - subscriptionAmount + - subscriptionCycle + - subscriptionStartDay + - subscriptionStartWeekday + - subscriptionStartTime + - sourceWallet + - flexibleAllowedToUse + - planValueInUSD + - pnlInUSD + - roi required: - - feeRate - - sourceAssets + - planValueInUSD + - planValueInBTC + - pnlInUSD + - roi + - plan '400': description: Bad Request content: @@ -21974,90 +20835,25 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/lending/auto-invest/plan/add: - post: - summary: Investment plan creation (USER_DATA) + /sapi/v1/lending/auto-invest/plan/id: + get: + summary: Query holding details of the plan description: |- - Post an investment plan creation + Query holding details of the plan Weight(IP): 1 tags: - Auto-Invest parameters: - - name: sourceType - in: query - required: true - schema: - type: string - enum: [MAIN_SITE, TR] - example: MAIN_SITE - - name: requestId - in: query - schema: - type: string - - name: planType - in: query - required: true - schema: - type: string - enum: [SINGLE, PORTFOLIO, INDEX] - example: SINGLE - - name: IndexId + - name: planId in: query schema: type: integer format: int64 - - name: subscriptionAmount - in: query - required: true - schema: - type: number - format: float - - name: subscriptionCycle - in: query - required: true - schema: - type: string - enum: [H1, H4, H8, H12, WEEKLY, DAILY, MONTHLY, BI_WEEKLY] - - name: subscriptionStartDay - in: query - schema: - type: integer - - name: subscriptionStartWeekday - in: query - schema: - type: string - enum: [MON, TUE, WED, THU, FRI, SAT, SUN] - - name: subscriptionStartTime - in: query - required: true - schema: - type: integer - - name: sourceAsset + - name: requestId in: query - required: true schema: type: string - example: "USDT" - - name: flexibleAllowedToUse - in: query - schema: - type: boolean - example: true - - name: details - in: query - required: true - schema: - type: array - items: - type: object - properties: - targetAsset: - type: string - example: "BTC" - percentage: - type: integer - format: int64 - $ref: '#/components/parameters/recvWindow' - $ref: '#/components/parameters/timestamp' - $ref: '#/components/parameters/signature' @@ -22071,16 +20867,146 @@ paths: schema: type: object properties: - planId: - type: integer - example: 12345 - nextExecutionDateTime: - type: integer - format: int64 - example: 1648378800000 - required: - - planId - - nextExecutionDateTime + planValueInUSD: + type: string + example: "123" + planValueInBTC: + type: string + example: "0.1" + pnlInUSD: + type: string + example: "120" + roi: + type: string + example: "2.3" + plan: + type: array + items: + type: object + properties: + planId: + type: integer + example: 12345 + planType: + type: string + example: "SINGLE" + editAllowed: + type: string + example: "true" + flexibleAllowedToUse: + type: string + example: "false" + creationDateTime: + type: integer + format: int64 + example: 1648378800000 + firstExecutionDateTime: + type: integer + format: int64 + example: 1648378800000 + nextExecutionDateTime: + type: integer + format: int64 + example: 1648378800000 + status: + type: string + example: "ONGOING" + targetAsset: + type: string + example: "BTC" + sourceAsset: + type: string + example: "BUSD" + totalInvestedInUSD: + type: string + example: "4.555" + planValueInUSD: + type: string + example: "101.2" + pnlInUSD: + type: string + example: "101.2" + roi: + type: string + example: "1.02" + details: + type: array + items: + type: object + properties: + targetAsset: + type: string + example: "ADA" + averagePriceInUSD: + type: string + example: "3.4" + totalInvestedInUSD: + type: string + example: "222.21" + purchasedAmount: + type: string + example: "122.12345678" + purchasedAmountUnit: + type: string + example: "ADA" + pnlInUSD: + type: string + example: "109.2" + roi: + type: string + example: "0.1" + percentage: + type: string + example: "50" + assetStatus: + type: string + example: "ACTIVE" + availableAmount: + type: string + example: "122.12345678" + availableAmountUnit: + type: string + example: "ADA" + redeemedAmout: + type: string + example: "122.12345678" + redeemedAmoutUnit: + type: string + example: "ADA" + assetValueInUSD: + type: string + example: "101.2" + required: + - targetAsset + - averagePriceInUSD + - totalInvestedInUSD + - purchasedAmount + - purchasedAmountUnit + - pnlInUSD + - roi + - percentage + - assetStatus + - availableAmount + - availableAmountUnit + - redeemedAmout + - redeemedAmoutUnit + - assetValueInUSD + required: + - planId + - planType + - editAllowed + - flexibleAllowedToUse + - creationDateTime + - firstExecutionDateTime + - nextExecutionDateTime + - status + - targetAsset + - sourceAsset + - totalInvestedInUSD + - planValueInUSD + - pnlInUSD + - roi + - details '400': description: Bad Request content: @@ -22093,11 +21019,11 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/lending/auto-invest/plan/edit: - post: - summary: Investment plan adjustment + /sapi/v1/lending/auto-invest/history/list: + get: + summary: Query subscription transaction history description: |- - Query Source Asset to be used for investment + Query subscription transaction history of a plan Weight(IP): 1 tags: @@ -22105,59 +21031,23 @@ paths: parameters: - name: planId in: query - required: true schema: type: integer - - name: subscriptionAmount + format: int64 + - $ref: '#/components/parameters/startTime' + - $ref: '#/components/parameters/endTime' + - name: targetAsset in: query - required: true schema: type: number - format: float - - name: subscriptionCycle - in: query - required: true - schema: - type: string - enum: [H1, H4, H8, H12, WEEKLY, DAILY, MONTHLY, BI_WEEKLY] - - name: subscriptionStartDay - in: query - schema: - type: integer - - name: subscriptionStartWeekday - in: query - schema: - type: string - enum: [MON, TUE, WED, THU, FRI, SAT, SUN] - - name: subscriptionStartTime - in: query - required: true - schema: - type: integer - - name: sourceAsset + format: int64 + - name: planType in: query - required: true schema: type: string - example: "USDT" - - name: flexibleAllowedToUse - in: query - schema: - type: boolean - example: true - - name: details - in: query - schema: - type: array - items: - type: object - properties: - targetAsset: - type: string - example: "BTC" - percentage: - type: integer - format: int64 + enum: [SINGLE, PORTFOLIO, INDEX, ALL] + - $ref: '#/components/parameters/size' + - $ref: '#/components/parameters/current' - $ref: '#/components/parameters/recvWindow' - $ref: '#/components/parameters/timestamp' - $ref: '#/components/parameters/signature' @@ -22169,18 +21059,86 @@ paths: content: application/json: schema: - type: object - properties: - planId: - type: integer - example: 12345 - nextExecutionDateTime: - type: integer - format: int64 - example: 1648378800000 - required: - - planId - - nextExecutionDateTime + type: array + items: + type: object + properties: + id: + type: integer + format: int64 + example: 12345 + targetAsset: + type: string + example: "BTC" + planType: + type: string + example: "SINGLE" + planName: + type: string + example: "BTC" + planId: + type: integer + format: int64 + example: 1234 + transactionDateTime: + type: integer + format: int64 + example: 1648378800000 + transactionStatus: + type: string + example: "SUCCESS" + failedType: + type: string + example: "INSUFFICIENT_BALANCE" + sourceAsset: + type: string + example: "BUSD" + sourceAssetAmount: + type: string + example: "297.12345" + targetAssetAmount: + type: string + example: "297.12345" + sourceWallet: + type: string + example: "SPOT_WALLET" + flexibleUsed: + type: string + example: "false" + transactionFee: + type: string + example: "0.002" + transactionFeeUnit: + type: string + example: "BUSD" + executionPrice: + type: string + example: "2342" + executionType: + type: string + example: "RECURRING" + subscriptionCycle: + type: string + example: "WEEKLY" + required: + - id + - targetAsset + - planType + - planName + - planId + - transactionDateTime + - transactionStatus + - failedType + - sourceAsset + - sourceAssetAmount + - targetAssetAmount + - sourceWallet + - flexibleUsed + - transactionFee + - transactionFeeUnit + - executionPrice + - executionType + - subscriptionCycle '400': description: Bad Request content: @@ -22193,27 +21151,22 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/lending/auto-invest/plan/edit-status: - post: - summary: Change Plan Status + /sapi/v1/lending/auto-invest/index/info: + get: + summary: Query Index Details(USER_DATA) description: |- - Change Plan Status + Query index details Weight(IP): 1 tags: - Auto-Invest parameters: - - name: planId - in: query - required: true - schema: - type: integer - - name: status + - name: indexId in: query required: true schema: - type: string - enum: [ONGOING, PAUSED, REMOVED] + type: integer + format: int64 - $ref: '#/components/parameters/recvWindow' - $ref: '#/components/parameters/timestamp' - $ref: '#/components/parameters/signature' @@ -22221,26 +21174,41 @@ paths: - ApiKeyAuth: [] responses: '200': - description: Plan result + description: Index result content: application/json: schema: type: object properties: - planId: - type: integer - example: 12345 - nextExecutionDateTime: + indexId: type: integer format: int64 - example: 1648378800000 + example: 1 + indexName: + type: string + example: "BINANCE TOP 10 EW" status: type: string - example: "ONGOING" + example: "RUNNING" + assetAllocation: + type: array + items: + type: object + properties: + targetAsset: + type: string + example: "ADA" + allocation: + type: string + example: "10" + required: + - targetAsset + - allocation required: - - planId - - nextExecutionDateTime + - indexId + - indexName - status + - assetAllocation '400': description: Bad Request content: @@ -22253,21 +21221,22 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/lending/auto-invest/plan/list: + /sapi/v1/lending/auto-invest/index/user-summary: get: - summary: Get list of plans + summary: Query Index Linked Plan Position Details(USER_DATA) description: |- - Query plan lists + Details on users Index-Linked plan position details Weight(IP): 1 tags: - Auto-Invest parameters: - - name: planType + - name: indexId in: query required: true schema: - type: string + type: integer + format: int64 - $ref: '#/components/parameters/recvWindow' - $ref: '#/components/parameters/timestamp' - $ref: '#/components/parameters/signature' @@ -22275,128 +21244,211 @@ paths: - ApiKeyAuth: [] responses: '200': - description: Plan result + description: Position Details content: application/json: schema: type: object properties: - planValueInUSD: + indexId: + type: integer + format: int64 + example: 1 + totalInvestedInUSD: type: string - example: "123" - planValueInBTC: + example: "114.555" + currentInvestedInUSD: type: string - example: "0.1" + description: current invest + example: "101.2" pnlInUSD: type: string - example: "120" + description: PNL of the plan in USD based on current amount + example: "101.2" roi: type: string - example: "2.3" - plan: + description: ROI of the plan based on current amount + example: "1.023" + assetAllocation: type: array items: type: object properties: - planId: - type: integer - example: 12345 - planType: - type: string - example: "SINGLE" - editAllowed: + targetAsset: type: string - example: "true" - creationDateTime: - type: integer - format: int64 - example: 1648378800000 - firstExecutionDateTime: - type: integer - format: int64 - example: 1648378800000 - nextExecutionDateTime: - type: integer - format: int64 - example: 1648378800000 - status: + description: for pie chart + example: "ADA" + allocation: type: string - example: "ONGOING" - lastUpdatedDateTime: - type: integer - format: int64 - example: 1648378800000 + example: "10" + required: + - targetAsset + - allocation + details: + type: array + items: + type: object + properties: targetAsset: type: string - example: "BTC" - totalTargetAmount: - type: string - example: "0.111" - sourceAsset: + example: "ADA" + averagePriceInUSD: type: string - example: "BUSD" + description: average price of the asset in USD + example: "3.4" totalInvestedInUSD: type: string - example: "4.555" - subscriptionAmount: - type: string - example: "0.1" - subscriptionCycle: - type: string - example: "WEEKLY" - subscriptionStartDay: + description: total source asset invested for this target asset in equivilent of USD + example: "222.21" + currentInvestedInUSD: type: string - example: "1" - subscriptionStartWeekday: + description: current invest + example: "101.2" + purchasedAmount: type: string - example: "MON" - subscriptionStartTime: + description: purchased amount of target asset + example: "122.2" + pnlInUSD: type: string - example: "1" - sourceWallet: + description: PNL denominated in USD + example: "109.2" + roi: type: string - example: "SPOT_WALLET" - flexibleAllowedToUse: + description: ROI calculated in decimal + example: "0.2" + percentage: type: string - example: "false" - planValueInUSD: + description: asset allocation in the plan. If it's single plan, then it's 100 + example: "10" + availableAmount: type: string - example: "101.2" - pnlInUSD: + example: "122.12345678" + redeemedAmount: type: string - example: "101.2" - roi: + example: "122" + assetValueInUSD: type: string - example: "1.02" + example: "101" required: - - planId - - planType - - editAllowed - - creationDateTime - - firstExecutionDateTime - - nextExecutionDateTime - - status - - lastUpdatedDateTime - targetAsset - - totalTargetAmount - - sourceAsset + - averagePriceInUSD - totalInvestedInUSD - - subscriptionAmount - - subscriptionCycle - - subscriptionStartDay - - subscriptionStartWeekday - - subscriptionStartTime - - sourceWallet - - flexibleAllowedToUse - - planValueInUSD + - currentInvestedInUSD + - purchasedAmount - pnlInUSD - roi + - percentage + - availableAmount + - redeemedAmount + - assetValueInUSD + required: + - indexId + - totalInvestedInUSD + - currentInvestedInUSD + - pnlInUSD + - roi + - assetAllocation + - details + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/error' + '401': + description: Unauthorized Request + content: + application/json: + schema: + $ref: '#/components/schemas/error' + /sapi/v1/lending/auto-invest/one-off: + post: + summary: One Time Transaction(TRADE) + description: |- + One time transaction + + Weight(IP): 1 + tags: + - Auto-Invest + parameters: + - name: sourceType + in: query + required: true + schema: + type: string + example: "MAIN_SITE" + - name: requestId + in: query + schema: + type: string + example: "TR12354859" + - name: subscriptionAmount + in: query + required: true + schema: + type: number + format: float + example: 10.1 + - name: sourceAsset + in: query + required: true + schema: + type: string + example: "USDT" + - name: flexibleAllowedToUse + in: query + schema: + type: boolean + example: true + - name: planId + in: query + schema: + type: integer + format: int64 + example: 12345 + - name: indexId + in: query + schema: + type: integer + format: int64 + example: 1 + - name: details + in: query + schema: + type: array + items: + type: object + properties: + targetAsset: + type: string + example: "BTC" + percentage: + type: integer + example: 40 + - $ref: '#/components/parameters/recvWindow' + - $ref: '#/components/parameters/timestamp' + - $ref: '#/components/parameters/signature' + security: + - ApiKeyAuth: [] + responses: + '200': + description: transaction result + content: + application/json: + schema: + type: object + properties: + transactionId: + type: integer + format: int64 + example: 12345 + waitSecond: + type: integer + format: int32 + example: 5 required: - - planValueInUSD - - planValueInBTC - - pnlInUSD - - roi - - plan + - transactionId + - waitSecond '400': description: Bad Request content: @@ -22409,25 +21461,28 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/lending/auto-invest/plan/id: + /sapi/v1/lending/auto-invest/one-off/status: get: - summary: Query holding details of the plan + summary: Query One-Time Transaction Status (USER_DATA) description: |- - Query holding details of the plan + Transaction status for one-time transaction Weight(IP): 1 tags: - Auto-Invest parameters: - - name: planId + - name: transactionId in: query + required: true schema: type: integer format: int64 + example: 12345 - name: requestId in: query schema: type: string + example: "TR12354859" - $ref: '#/components/parameters/recvWindow' - $ref: '#/components/parameters/timestamp' - $ref: '#/components/parameters/signature' @@ -22435,152 +21490,84 @@ paths: - ApiKeyAuth: [] responses: '200': - description: Plan result + description: transaction result content: application/json: schema: type: object properties: - planValueInUSD: - type: string - example: "123" - planValueInBTC: - type: string - example: "0.1" - pnlInUSD: - type: string - example: "120" - roi: + transactionId: + type: integer + format: int64 + example: 12345 + status: type: string - example: "2.3" - plan: - type: array - items: - type: object - properties: - planId: - type: integer - example: 12345 - planType: - type: string - example: "SINGLE" - editAllowed: - type: string - example: "true" - flexibleAllowedToUse: - type: string - example: "false" - creationDateTime: - type: integer - format: int64 - example: 1648378800000 - firstExecutionDateTime: - type: integer - format: int64 - example: 1648378800000 - nextExecutionDateTime: - type: integer - format: int64 - example: 1648378800000 - status: - type: string - example: "ONGOING" - targetAsset: - type: string - example: "BTC" - sourceAsset: - type: string - example: "BUSD" - totalInvestedInUSD: - type: string - example: "4.555" - planValueInUSD: - type: string - example: "101.2" - pnlInUSD: - type: string - example: "101.2" - roi: - type: string - example: "1.02" - details: - type: array - items: - type: object - properties: - targetAsset: - type: string - example: "ADA" - averagePriceInUSD: - type: string - example: "3.4" - totalInvestedInUSD: - type: string - example: "222.21" - purchasedAmount: - type: string - example: "122.12345678" - purchasedAmountUnit: - type: string - example: "ADA" - pnlInUSD: - type: string - example: "109.2" - roi: - type: string - example: "0.1" - percentage: - type: string - example: "50" - assetStatus: - type: string - example: "ACTIVE" - availableAmount: - type: string - example: "122.12345678" - availableAmountUnit: - type: string - example: "ADA" - redeemedAmout: - type: string - example: "122.12345678" - redeemedAmoutUnit: - type: string - example: "ADA" - assetValueInUSD: - type: string - example: "101.2" - required: - - targetAsset - - averagePriceInUSD - - totalInvestedInUSD - - purchasedAmount - - purchasedAmountUnit - - pnlInUSD - - roi - - percentage - - assetStatus - - availableAmount - - availableAmountUnit - - redeemedAmout - - redeemedAmoutUnit - - assetValueInUSD - required: - - planId - - planType - - editAllowed - - flexibleAllowedToUse - - creationDateTime - - firstExecutionDateTime - - nextExecutionDateTime - - status - - targetAsset - - sourceAsset - - totalInvestedInUSD - - planValueInUSD - - pnlInUSD - - roi - - details + example: "SUCCESS" + required: + - transactionId + - status + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/error' + '401': + description: Unauthorized Request + content: + application/json: + schema: + $ref: '#/components/schemas/error' + /sapi/v1/lending/auto-invest/redeem: + post: + summary: Index Linked Plan Redemption (TRADE) + description: |- + To redeem index-Linked plan holdings + + Weight(IP): 1 + tags: + - Auto-Invest + parameters: + - name: indexId + in: query + description: PORTFOLIO plan's Id + required: true + schema: + type: integer + format: int64 + example: 123456 + - name: requestId + in: query + description: sourceType + unique, transactionId and requestId cannot be empty at the same time + schema: + type: string + example: "TR12354859" + - name: redemptionPercentage + in: query + description: user redeem percentage,10/20/100. + required: true + schema: + type: integer + example: 10 + - $ref: '#/components/parameters/recvWindow' + - $ref: '#/components/parameters/timestamp' + - $ref: '#/components/parameters/signature' + security: + - ApiKeyAuth: [] + responses: + '200': + description: Redemption result + content: + application/json: + schema: + type: object + properties: + redemptionId: + type: integer + format: int64 + example: 12345 + required: + - redemptionId '400': description: Bad Request content: @@ -22593,35 +21580,35 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/lending/auto-invest/history/list: + /sapi/v1/lending/auto-invest/redeem/history: get: - summary: Query subscription transaction history + summary: Index Linked Plan Redemption History (USER_DATA) description: |- - Query subscription transaction history of a plan + Get the history of Index Linked Plan Redemption transactions + + Max 30 day difference between startTime and endTime + If no startTime and endTime, default to show past 30 day records Weight(IP): 1 tags: - Auto-Invest parameters: - - name: planId + - name: requestId in: query + required: true schema: type: integer format: int64 + example: 12345 - $ref: '#/components/parameters/startTime' - $ref: '#/components/parameters/endTime' - - name: targetAsset - in: query - schema: - type: number - format: int64 - - name: planType + - $ref: '#/components/parameters/current' + - name: asset in: query schema: type: string - enum: [SINGLE, PORTFOLIO, INDEX, ALL] + example: "BTC" - $ref: '#/components/parameters/size' - - $ref: '#/components/parameters/current' - $ref: '#/components/parameters/recvWindow' - $ref: '#/components/parameters/timestamp' - $ref: '#/components/parameters/signature' @@ -22629,7 +21616,7 @@ paths: - ApiKeyAuth: [] responses: '200': - description: Plan result + description: Redemption history content: application/json: schema: @@ -22637,82 +21624,199 @@ paths: items: type: object properties: - id: + indexId: type: integer format: int64 - example: 12345 - targetAsset: - type: string - example: "BTC" - planType: - type: string - example: "SINGLE" - planName: + example: 1 + indexName: type: string - example: "BTC" - planId: - type: integer - format: int64 - example: 1234 - transactionDateTime: + example: "BINANCE TOP 10 EW" + redemptionId: type: integer format: int64 - example: 1648378800000 - transactionStatus: + example: 11 + status: type: string example: "SUCCESS" - failedType: - type: string - example: "INSUFFICIENT_BALANCE" - sourceAsset: - type: string - example: "BUSD" - sourceAssetAmount: - type: string - example: "297.12345" - targetAssetAmount: - type: string - example: "297.12345" - sourceWallet: + asset: type: string - example: "SPOT_WALLET" - flexibleUsed: + example: "BTC" + amount: type: string - example: "false" + example: "0.005" + redemptionDateTime: + type: integer + format: int64 + example: 1648378800000 transactionFee: type: string - example: "0.002" + example: "0" transactionFeeUnit: type: string - example: "BUSD" - executionPrice: + example: "USDT" + required: + - indexId + - indexName + - redemptionId + - status + - asset + - amount + - redemptionDateTime + - transactionFee + - transactionFeeUnit + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/error' + '401': + description: Unauthorized Request + content: + application/json: + schema: + $ref: '#/components/schemas/error' + /sapi/v1/lending/auto-invest/rebalance/history: + get: + summary: Index Linked Plan Rebalance Details (USER_DATA) + description: |- + Get the history of Index Linked Plan Redemption transactions + + Max 30 day difference between startTime and endTime + If no startTime and endTime, default to show past 30 day records + + Weight(IP): 1 + tags: + - Auto-Invest + parameters: + - $ref: '#/components/parameters/startTime' + - $ref: '#/components/parameters/endTime' + - $ref: '#/components/parameters/current' + - $ref: '#/components/parameters/size' + - $ref: '#/components/parameters/recvWindow' + - $ref: '#/components/parameters/timestamp' + - $ref: '#/components/parameters/signature' + security: + - ApiKeyAuth: [] + responses: + '200': + description: Rebalance Details + content: + application/json: + schema: + type: array + items: + type: object + properties: + indexId: + type: integer + format: int64 + example: 1 + indexName: type: string - example: "2342" - executionType: + example: "BINANCE TOP 10 EW" + rebalanceId: + type: integer + format: int64 + example: 11 + status: type: string - example: "RECURRING" - subscriptionCycle: + example: "SUCCESS" + rebalanceFee: type: string - example: "WEEKLY" + example: "10" + rebalanceFeeUnit: + type: string + example: "USDT" + transactionDetails: + type: array + items: + type: object + properties: + asset: + type: string + example: "BTC" + transactionDateTime: + type: integer + format: int64 + example: 1648378800000 + rebalanceDirection: + type: string + example: "BUY" + rebalanceAmount: + type: string + example: "0.005" + required: + - asset + - transactionDateTime + - rebalanceDirection + - rebalanceAmount required: - - id - - targetAsset - - planType - - planName - - planId - - transactionDateTime - - transactionStatus - - failedType - - sourceAsset - - sourceAssetAmount - - targetAssetAmount - - sourceWallet - - flexibleUsed - - transactionFee - - transactionFeeUnit - - executionPrice - - executionType - - subscriptionCycle + - indexId + - indexName + - rebalanceId + - status + - rebalanceFee + - rebalanceFeeUnit + - transactionDetails + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/error' + '401': + description: Unauthorized Request + content: + application/json: + schema: + $ref: '#/components/schemas/error' + /sapi/v2/eth-staking/eth/stake: + post: + summary: Subscribe ETH Staking V2(TRADE) + description: |- + Stake ETH to get WBETH + + - You need to open Enable Spot & Margin Trading permission for the API Key which requests this endpoint. + + Weight(IP): 150 + tags: + - Staking + parameters: + - name: amount + in: query + required: true + description: Amount in ETH, limit 4 decimals + schema: + type: number + format: double + - $ref: '#/components/parameters/recvWindow' + - $ref: '#/components/parameters/timestamp' + - $ref: '#/components/parameters/signature' + security: + - ApiKeyAuth: [] + responses: + '200': + description: Subscribed WBETH + content: + application/json: + schema: + type: object + properties: + success: + type: boolean + example: true + wbethAmount: + type: string + example: "0.23092091" + conversionRatio: + type: string + example: "1.001212342342" + description: ETH amount per 1 WBETH + required: + - success + - wbethAmount + - conversionRatio '400': description: Bad Request content: @@ -22725,22 +21829,31 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/lending/auto-invest/index/info: - get: - summary: Query Index Details(USER_DATA) + /sapi/v1/eth-staking/eth/redeem: + post: + summary: Redeem ETH (TRADE) description: |- - Query index details + Redeem WBETH or BETH and get ETH - Weight(IP): 1 + - You need to open Enable Spot & Margin Trading permission for the API Key which requests this endpoint. + + Weight(IP): 150 tags: - - Auto-Invest + - Staking parameters: - - name: indexId + - name: asset + in: query + required: false + description: WBETH or BETH, default to BETH + schema: + type: string + - name: amount in: query required: true + description: Amount in BETH, limit 8 decimals schema: - type: integer - format: int64 + type: number + format: double - $ref: '#/components/parameters/recvWindow' - $ref: '#/components/parameters/timestamp' - $ref: '#/components/parameters/signature' @@ -22748,41 +21861,111 @@ paths: - ApiKeyAuth: [] responses: '200': - description: Index result + description: Returned ETH content: application/json: schema: type: object properties: - indexId: + success: + type: boolean + example: true + arrivalTime: type: integer format: int64 - example: 1 - indexName: + example: 1575018510000 + ethAmount: type: string - example: "BINANCE TOP 10 EW" - status: + example: "0.23092091" + conversionRatio: type: string - example: "RUNNING" - assetAllocation: + example: "1.00121234" + required: + - success + - arrivalTime + - ethAmount + - conversionRatio + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/error' + '401': + description: Unauthorized Request + content: + application/json: + schema: + $ref: '#/components/schemas/error' + /sapi/v1/eth-staking/eth/history/stakingHistory: + get: + summary: Get ETH staking history (USER_DATA) + description: |- + - The time between startTime and endTime cannot be longer than 3 months. + - If startTime and endTime are both not sent, then the last 30 days' data will be returned. + - If startTime is sent but endTime is not sent, the next 30 days' data beginning from startTime will be returned. + - If endTime is sent but startTime is not sent, the 30 days' data before endTime will be returned. + + Weight(IP): 150 + tags: + - Staking + parameters: + - $ref: '#/components/parameters/startTime' + - $ref: '#/components/parameters/endTime' + - $ref: '#/components/parameters/current' + - $ref: '#/components/parameters/size' + - $ref: '#/components/parameters/recvWindow' + - $ref: '#/components/parameters/timestamp' + - $ref: '#/components/parameters/signature' + security: + - ApiKeyAuth: [] + responses: + '200': + description: ETH staking history + content: + application/json: + schema: + type: object + properties: + rows: type: array items: type: object properties: - targetAsset: + time: + type: integer + format: int64 + example: 1575018510000 + asset: type: string - example: "ADA" - allocation: + example: "ETH" + amount: type: string - example: "10" + example: "21312.23223" + status: + type: string + example: "SUCCESS" + description: PENDING, SUCCESS, FAILED + distributeAmount: + type: string + example: "21286.42584" + conversionRatio: + type: string + example: "1.00121234" required: - - targetAsset - - allocation + - time + - asset + - amount + - status + - distributeAmount + - conversionRatio + total: + type: integer + format: int64 + example: 1 required: - - indexId - - indexName - - status - - assetAllocation + - rows + - total '400': description: Bad Request content: @@ -22795,22 +21978,23 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/lending/auto-invest/index/user-summary: + /sapi/v1/eth-staking/eth/history/redemptionHistory: get: - summary: Query Index Linked Plan Position Details(USER_DATA) + summary: Get ETH redemption history (USER_DATA) description: |- - Details on users Index-Linked plan position details + - The time between startTime and endTime cannot be longer than 3 months. + - If startTime and endTime are both not sent, then the last 30 days' data will be returned. + - If startTime is sent but endTime is not sent, the next 30 days' data beginning from startTime will be returned. + - If endTime is sent but startTime is not sent, the 30 days' data before endTime will be returned. - Weight(IP): 1 + Weight(IP): 150 tags: - - Auto-Invest + - Staking parameters: - - name: indexId - in: query - required: true - schema: - type: integer - format: int64 + - $ref: '#/components/parameters/startTime' + - $ref: '#/components/parameters/endTime' + - $ref: '#/components/parameters/current' + - $ref: '#/components/parameters/size' - $ref: '#/components/parameters/recvWindow' - $ref: '#/components/parameters/timestamp' - $ref: '#/components/parameters/signature' @@ -22818,111 +22002,143 @@ paths: - ApiKeyAuth: [] responses: '200': - description: Position Details + description: ETH redemption history content: application/json: schema: type: object properties: - indexId: - type: integer - format: int64 - example: 1 - totalInvestedInUSD: - type: string - example: "114.555" - currentInvestedInUSD: - type: string - description: current invest - example: "101.2" - pnlInUSD: - type: string - description: PNL of the plan in USD based on current amount - example: "101.2" - roi: - type: string - description: ROI of the plan based on current amount - example: "1.023" - assetAllocation: + rows: type: array items: type: object properties: - targetAsset: + time: + type: integer + format: int64 + example: 1575018510000 + arrivalTime: + type: integer + format: int64 + example: 1575018510000 + asset: type: string - description: for pie chart - example: "ADA" - allocation: + example: "BETH" + amount: type: string - example: "10" + example: "21312.23223" + status: + type: string + example: "SUCCESS" + description: PENDING, SUCCESS, FAILED + distributeAsset: + type: string + example: "ETH" + distributeAmount: + type: string + example: "21338.0699" + conversionRatio: + type: string + example: "1.00121234" required: - - targetAsset - - allocation - details: + - time + - arrivalTime + - asset + - amount + - status + - distributeAsset + - distributeAmount + - conversionRatio + total: + type: integer + format: int64 + example: 1 + required: + - rows + - total + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/error' + '401': + description: Unauthorized Request + content: + application/json: + schema: + $ref: '#/components/schemas/error' + /sapi/v1/eth-staking/eth/history/rewardsHistory: + get: + summary: Get BETH rewards distribution history(USER_DATA) + description: |- + - The time between startTime and endTime cannot be longer than 3 months. + - If startTime and endTime are both not sent, then the last 30 days' data will be returned. + - If startTime is sent but endTime is not sent, the next 30 days' data beginning from startTime will be returned. + - If endTime is sent but startTime is not sent, the 30 days' data before endTime will be returned. + + Weight(IP): 150 + tags: + - Staking + parameters: + - $ref: '#/components/parameters/startTime' + - $ref: '#/components/parameters/endTime' + - $ref: '#/components/parameters/current' + - $ref: '#/components/parameters/size' + - $ref: '#/components/parameters/recvWindow' + - $ref: '#/components/parameters/timestamp' + - $ref: '#/components/parameters/signature' + security: + - ApiKeyAuth: [] + responses: + '200': + description: BETH rewards distribution history + content: + application/json: + schema: + type: object + properties: + rows: type: array items: type: object properties: - targetAsset: - type: string - example: "ADA" - averagePriceInUSD: - type: string - description: average price of the asset in USD - example: "3.4" - totalInvestedInUSD: - type: string - description: total source asset invested for this target asset in equivilent of USD - example: "222.21" - currentInvestedInUSD: - type: string - description: current invest - example: "101.2" - purchasedAmount: - type: string - description: purchased amount of target asset - example: "122.2" - pnlInUSD: - type: string - description: PNL denominated in USD - example: "109.2" - roi: + time: + type: integer + format: int64 + example: 1575018510000 + asset: type: string - description: ROI calculated in decimal - example: "0.2" - percentage: + example: "ETH" + holding: type: string - description: asset allocation in the plan. If it's single plan, then it's 100 - example: "10" - availableAmount: + example: "2.3223" + description: BETH holding balance + amount: type: string - example: "122.12345678" - redeemedAmount: + example: "0.23223" + description: Distributed rewards + annualPercentageRate: type: string - example: "122" - assetValueInUSD: + example: "0.5" + description: 0.5 means 50% here + status: type: string - example: "101" + example: "SUCCESS" required: - - targetAsset - - averagePriceInUSD - - totalInvestedInUSD - - currentInvestedInUSD - - purchasedAmount - - pnlInUSD - - roi - - percentage - - availableAmount - - redeemedAmount - - assetValueInUSD + - time + - asset + - holding + - amount + - annualPercentageRate + - status + total: + type: integer + format: int64 + example: 1 required: - - indexId - - totalInvestedInUSD - - currentInvestedInUSD - - pnlInUSD - - roi - - assetAllocation - - details + - rows + - total '400': description: Bad Request content: @@ -22935,70 +22151,14 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/lending/auto-invest/one-off: - post: - summary: One Time Transaction(TRADE) + /sapi/v1/eth-staking/eth/quota: + get: + summary: Get current ETH staking quota (USER_DATA) description: |- - One time transaction - - Weight(IP): 1 + Weight(IP): 150 tags: - - Auto-Invest + - Staking parameters: - - name: sourceType - in: query - required: true - schema: - type: string - example: "MAIN_SITE" - - name: requestId - in: query - schema: - type: string - example: "TR12354859" - - name: subscriptionAmount - in: query - required: true - schema: - type: number - format: float - example: 10.1 - - name: sourceAsset - in: query - required: true - schema: - type: string - example: "USDT" - - name: flexibleAllowedToUse - in: query - schema: - type: boolean - example: true - - name: planId - in: query - schema: - type: integer - format: int64 - example: 12345 - - name: indexId - in: query - schema: - type: integer - format: int64 - example: 1 - - name: details - in: query - schema: - type: array - items: - type: object - properties: - targetAsset: - type: string - example: "BTC" - percentage: - type: integer - example: 40 - $ref: '#/components/parameters/recvWindow' - $ref: '#/components/parameters/timestamp' - $ref: '#/components/parameters/signature' @@ -23006,23 +22166,23 @@ paths: - ApiKeyAuth: [] responses: '200': - description: transaction result + description: Eth staking quota content: application/json: schema: type: object properties: - transactionId: - type: integer - format: int64 - example: 12345 - waitSecond: - type: integer - format: int32 - example: 5 + leftStakingPersonalQuota: + type: string + example: "1000" + description: Show min(Daily available limit, total personal staking quota) + leftRedemptionPersonalQuota: + type: string + example: "1000" + description: Show min(Daily personal redeem quota, total redemption limit) required: - - transactionId - - waitSecond + - leftStakingPersonalQuota + - leftRedemptionPersonalQuota '400': description: Bad Request content: @@ -23035,28 +22195,23 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/lending/auto-invest/one-off/status: + /sapi/v1/eth-staking/eth/history/rateHistory: get: - summary: Query One-Time Transaction Status (USER_DATA) + summary: Get WBETH Rate History (USER_DATA) description: |- - Transaction status for one-time transaction + - The time between startTime and endTime cannot be longer than 3 months. + - If startTime and endTime are both not sent, then the last 30 days' data will be returned. + - If startTime is sent but endTime is not sent, the next 30 days' data beginning from startTime will be returned. + - If endTime is sent but startTime is not sent, the 30 days' data before endTime will be returned. - Weight(IP): 1 + Weight(IP): 150 tags: - - Auto-Invest + - Staking parameters: - - name: transactionId - in: query - required: true - schema: - type: integer - format: int64 - example: 12345 - - name: requestId - in: query - schema: - type: string - example: "TR12354859" + - $ref: '#/components/parameters/startTime' + - $ref: '#/components/parameters/endTime' + - $ref: '#/components/parameters/current' + - $ref: '#/components/parameters/size' - $ref: '#/components/parameters/recvWindow' - $ref: '#/components/parameters/timestamp' - $ref: '#/components/parameters/signature' @@ -23064,22 +22219,108 @@ paths: - ApiKeyAuth: [] responses: '200': - description: transaction result + description: WBETH Rate History content: application/json: schema: type: object properties: - transactionId: + rows: + type: array + items: + type: object + properties: + annualPercentageRate: + type: string + example: "0.5" + description: BETH APR + exchangeRate: + type: string + example: "1.00121234" + description: BETH value per 1 WBETH + time: + type: integer + format: int64 + example: 1575018510000 + required: + - annualPercentageRate + - exchangeRate + - time + total: type: integer format: int64 - example: 12345 - status: + example: 1 + required: + - rows + - total + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/error' + '401': + description: Unauthorized Request + content: + application/json: + schema: + $ref: '#/components/schemas/error' + /sapi/v2/eth-staking/account: + get: + summary: ETH Staking account V2(USER_DATA) + description: |- + Weight(IP): 150 + tags: + - Staking + parameters: + - $ref: '#/components/parameters/recvWindow' + - $ref: '#/components/parameters/timestamp' + - $ref: '#/components/parameters/signature' + security: + - ApiKeyAuth: [] + responses: + '200': + description: ETH Staking account + content: + application/json: + schema: + type: object + properties: + holdingInETH: type: string - example: "SUCCESS" + example: "1.22330928" + holdings: + type: object + properties: + wbethAmount: + type: string + example: "1.10928781" + bethAmount: + type: string + example: "1.90002112" + required: + - wbethAmount + - bethAmount + thirtyDaysProfitInETH: + type: string + example: "0.22330928" + profit: + type: object + properties: + amountFromWBETH: + type: string + example: "0.12330928" + amountFromBETH: + type: string + example: "0.1" + required: + - amountFromWBETH + - amountFromBETH required: - - transactionId - - status + - holdingInETH + - holdings + - thirtyDaysProfitInETH + - profit '400': description: Bad Request content: @@ -23092,37 +22333,78 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/lending/auto-invest/redeem: + /sapi/v1/eth-staking/wbeth/wrap: post: - summary: Index Linked Plan Redemption (TRADE) + summary: Wrap BETH(TRADE) description: |- - To redeem index-Linked plan holdings - - Weight(IP): 1 + - You need to open Enable Spot & Margin Trading permission for the API Key which requests this endpoint. + + Weight(IP): 150 tags: - - Auto-Invest + - Staking parameters: - - name: indexId - in: query - description: PORTFOLIO plan's Id - required: true - schema: - type: integer - format: int64 - example: 123456 - - name: requestId - in: query - description: sourceType + unique, transactionId and requestId cannot be empty at the same time - schema: - type: string - example: "TR12354859" - - name: redemptionPercentage + - name: amount in: query - description: user redeem percentage,10/20/100. required: true + description: Amount in BETH, limit 4 decimals schema: - type: integer - example: 10 + type: number + format: double + - $ref: '#/components/parameters/recvWindow' + - $ref: '#/components/parameters/timestamp' + - $ref: '#/components/parameters/signature' + security: + - ApiKeyAuth: [] + responses: + '200': + description: Wrap BETH + content: + application/json: + schema: + type: object + properties: + success: + type: boolean + example: true + wbethAmount: + type: string + example: "0.22330928" + exchangeRate: + type: string + example: "1.001212343432" + required: + - success + - wbethAmount + - exchangeRate + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/error' + '401': + description: Unauthorized Request + content: + application/json: + schema: + $ref: '#/components/schemas/error' + /sapi/v1/eth-staking/wbeth/history/wrapHistory: + get: + summary: Get WBETH wrap history (USER_DATA) + description: |- + - The time between startTime and endTime cannot be longer than 3 months. + - If startTime and endTime are both not sent, then the last 30 days' data will be returned. + - If startTime is sent but endTime is not sent, the next 30 days' data beginning from startTime will be returned. + - If endTime is sent but startTime is not sent, the 30 days' data before endTime will be returned. + + Weight(IP): 150 + tags: + - Staking + parameters: + - $ref: '#/components/parameters/startTime' + - $ref: '#/components/parameters/endTime' + - $ref: '#/components/parameters/current' + - $ref: '#/components/parameters/size' - $ref: '#/components/parameters/recvWindow' - $ref: '#/components/parameters/timestamp' - $ref: '#/components/parameters/signature' @@ -23130,18 +22412,56 @@ paths: - ApiKeyAuth: [] responses: '200': - description: Redemption result + description: WBETH wrap history content: application/json: schema: type: object properties: - redemptionId: + rows: + type: array + items: + type: object + properties: + time: + type: integer + format: int64 + example: 1575018510000 + fromAsset: + type: string + example: "BETH" + fromAmount: + type: string + example: "21312.23223" + toAsset: + type: string + example: "WBETH" + toAmount: + type: string + example: "21312.23223" + exchangeRate: + type: string + example: "1.01243253" + description: BETH amount per 1 WBETH + status: + type: string + example: "SUCCESS" + description: PENDING, SUCCESS, FAILED + required: + - time + - fromAsset + - fromAmount + - toAsset + - toAmount + - exchangeRate + - status + total: type: integer format: int64 - example: 12345 + example: 1 required: - - redemptionId + - rows + - total '400': description: Bad Request content: @@ -23154,34 +22474,22 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/lending/auto-invest/redeem/history: + /sapi/v1/eth-staking/wbeth/history/unwrapHistory: get: - summary: Index Linked Plan Redemption History (USER_DATA) + summary: Get WBETH unwrap history (USER_DATA) description: |- - Get the history of Index Linked Plan Redemption transactions - - Max 30 day difference between startTime and endTime - If no startTime and endTime, default to show past 30 day records + - The time between startTime and endTime cannot be longer than 3 months. + - If startTime and endTime are both not sent, then the last 30 days' data will be returned. + - If startTime is sent but endTime is not sent, the next 30 days' data beginning from startTime will be returned. + - If endTime is sent but startTime is not sent, the 30 days' data before endTime will be returned. - Weight(IP): 1 + Weight(IP): 150 tags: - - Auto-Invest + - Staking parameters: - - name: requestId - in: query - required: true - schema: - type: integer - format: int64 - example: 12345 - $ref: '#/components/parameters/startTime' - $ref: '#/components/parameters/endTime' - $ref: '#/components/parameters/current' - - name: asset - in: query - schema: - type: string - example: "BTC" - $ref: '#/components/parameters/size' - $ref: '#/components/parameters/recvWindow' - $ref: '#/components/parameters/timestamp' @@ -23190,54 +22498,56 @@ paths: - ApiKeyAuth: [] responses: '200': - description: Redemption history + description: WBETH unwrap history content: application/json: schema: - type: array - items: - type: object - properties: - indexId: - type: integer - format: int64 - example: 1 - indexName: - type: string - example: "BINANCE TOP 10 EW" - redemptionId: - type: integer - format: int64 - example: 11 - status: - type: string - example: "SUCCESS" - asset: - type: string - example: "BTC" - amount: - type: string - example: "0.005" - redemptionDateTime: - type: integer - format: int64 - example: 1648378800000 - transactionFee: - type: string - example: "0" - transactionFeeUnit: - type: string - example: "USDT" - required: - - indexId - - indexName - - redemptionId - - status - - asset - - amount - - redemptionDateTime - - transactionFee - - transactionFeeUnit + type: object + properties: + rows: + type: array + items: + type: object + properties: + time: + type: integer + format: int64 + example: 1575018510000 + fromAsset: + type: string + example: "WBETH" + fromAmount: + type: string + example: "21312.23223" + toAsset: + type: string + example: "BETH" + toAmount: + type: string + example: "21312.23223" + exchangeRate: + type: string + example: "1.01243253" + description: BETH amount per 1 WBETH + status: + type: string + example: "SUCCESS" + description: PENDING, SUCCESS, FAILED + required: + - time + - fromAsset + - fromAmount + - toAsset + - toAmount + - exchangeRate + - status + total: + type: integer + format: int64 + example: 1 + required: + - rows + - total '400': description: Bad Request content: @@ -23250,18 +22560,18 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/lending/auto-invest/rebalance/history: + /sapi/v1/eth-staking/eth/history/wbethRewardsHistory: get: - summary: Index Linked Plan Rebalance Details (USER_DATA) + summary: Get WBETH rewards history(USER_DATA) description: |- - Get the history of Index Linked Plan Redemption transactions - - Max 30 day difference between startTime and endTime - If no startTime and endTime, default to show past 30 day records + - The time between startTime and endTime cannot be longer than 3 months. + - If startTime and endTime are both not sent, then the last 30 days' data will be returned. + - If startTime is sent but endTime is not sent, the next 30 days' data beginning from startTime will be returned. + - If endTime is sent but startTime is not sent, the 30 days' data before endTime will be returned. - Weight(IP): 1 + Weight(IP): 150 tags: - - Auto-Invest + - Staking parameters: - $ref: '#/components/parameters/startTime' - $ref: '#/components/parameters/endTime' @@ -23274,65 +22584,52 @@ paths: - ApiKeyAuth: [] responses: '200': - description: Rebalance Details + description: WBETH rewards history content: application/json: schema: - type: array - items: - type: object - properties: - indexId: - type: integer - format: int64 - example: 1 - indexName: - type: string - example: "BINANCE TOP 10 EW" - rebalanceId: - type: integer - format: int64 - example: 11 - status: - type: string - example: "SUCCESS" - rebalanceFee: - type: string - example: "10" - rebalanceFeeUnit: - type: string - example: "USDT" - transactionDetails: - type: array - items: - type: object - properties: - asset: - type: string - example: "BTC" - transactionDateTime: - type: integer - format: int64 - example: 1648378800000 - rebalanceDirection: - type: string - example: "BUY" - rebalanceAmount: - type: string - example: "0.005" - required: - - asset - - transactionDateTime - - rebalanceDirection - - rebalanceAmount - required: - - indexId - - indexName - - rebalanceId - - status - - rebalanceFee - - rebalanceFeeUnit - - transactionDetails + type: object + properties: + estRewardsInETH: + type: string + example: "1.23230920" + rows: + type: array + items: + type: object + properties: + time: + type: integer + format: int64 + example: 1575018510000 + amountInETH: + type: string + example: "0.23223" + description: Estimated rewards accrued within WBETH + holding: + type: string + example: "2.3223" + description: WBETH holding balance + holdingInETH: + type: string + example: "2.4231" + annualPercentageRate: + type: string + example: "0.5" + required: + - time + - amountInETH + - holding + - holdingInETH + - annualPercentageRate + total: + type: integer + format: int64 + example: 1 + required: + - estRewardsInETH + - rows + - total '400': description: Bad Request content: @@ -24588,8 +23885,270 @@ paths: format: int64 example: 2 required: - - rows - - total + - rows + - total + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/error' + '401': + description: Unauthorized Request + content: + application/json: + schema: + $ref: '#/components/schemas/error' + /sapi/v1/simple-earn/locked/history/rewardsRecord: + get: + summary: Get Locked Rewards History (USER_DATA) + description: |- + Weight(IP): 150 + tags: + - Simple Earn + parameters: + - name: positionId + in: query + schema: + type: string + - name: asset + in: query + schema: + type: string + - $ref: '#/components/parameters/startTime' + - $ref: '#/components/parameters/endTime' + - $ref: '#/components/parameters/size' + - $ref: '#/components/parameters/recvWindow' + - $ref: '#/components/parameters/timestamp' + - $ref: '#/components/parameters/signature' + security: + - ApiKeyAuth: [] + responses: + '200': + description: Locked Rewards History + content: + application/json: + schema: + type: object + properties: + rows: + type: array + items: + type: object + properties: + positionId: + type: string + example: "123123" + time: + type: integer + format: int64 + example: 1577257222000 + asset: + type: string + example: "BNB" + lockPeriod: + type: string + example: "30" + amount: + type: string + example: "21312.23223" + required: + - positionId + - time + - asset + - lockPeriod + - amount + total: + type: integer + format: int64 + example: 1 + required: + - rows + - total + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/error' + '401': + description: Unauthorized Request + content: + application/json: + schema: + $ref: '#/components/schemas/error' + /sapi/v1/simple-earn/flexible/setAutoSubscribe: + post: + summary: Set Flexible Auto Subscribe (USER_DATA) + description: |- + Weight(IP): 150 + tags: + - Simple Earn + parameters: + - name: productId + in: query + required: true + schema: + type: string + - name: autoSubscribe + in: query + required: true + description: "true or false" + schema: + type: boolean + - $ref: '#/components/parameters/recvWindow' + - $ref: '#/components/parameters/timestamp' + - $ref: '#/components/parameters/signature' + security: + - ApiKeyAuth: [] + responses: + '200': + description: Flexible Product Subscription Response + content: + application/json: + schema: + type: object + properties: + success: + type: boolean + example: true + required: + - success + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/error' + '401': + description: Unauthorized Request + content: + application/json: + schema: + $ref: '#/components/schemas/error' + /sapi/v1/simple-earn/locked/setAutoSubscribe: + post: + summary: Set Locked Auto Subscribe (USER_DATA) + description: |- + Weight(IP): 150 + tags: + - Simple Earn + parameters: + - name: positionId + in: query + required: true + schema: + type: string + - name: autoSubscribe + in: query + required: true + description: "true or false" + schema: + type: boolean + - $ref: '#/components/parameters/recvWindow' + - $ref: '#/components/parameters/timestamp' + - $ref: '#/components/parameters/signature' + security: + - ApiKeyAuth: [] + responses: + '200': + description: Locked Auto Subscribe + content: + application/json: + schema: + type: object + properties: + success: + type: boolean + example: true + required: + - success + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/error' + '401': + description: Unauthorized Request + content: + application/json: + schema: + $ref: '#/components/schemas/error' + /sapi/v1/simple-earn/flexible/personalLeftQuota: + get: + summary: Get Flexible Personal Left Quota (USER_DATA) + description: |- + Weight(IP): 150 + tags: + - Simple Earn + parameters: + - name: productId + in: query + required: true + schema: + type: string + - $ref: '#/components/parameters/recvWindow' + - $ref: '#/components/parameters/timestamp' + - $ref: '#/components/parameters/signature' + security: + - ApiKeyAuth: [] + responses: + '200': + description: Flexible Personal Left Quota + content: + application/json: + schema: + type: object + properties: + leftPersonalQuota: + type: string + example: "1000" + required: + - leftPersonalQuota + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/error' + '401': + description: Unauthorized Request + content: + application/json: + schema: + $ref: '#/components/schemas/error' + /sapi/v1/simple-earn/locked/personalLeftQuota: + get: + summary: Get Locked Personal Left Quota (USER_DATA) + description: |- + Weight(IP): 150 + tags: + - Simple Earn + parameters: + - name: projectId + in: query + required: true + schema: + type: string + - $ref: '#/components/parameters/recvWindow' + - $ref: '#/components/parameters/timestamp' + - $ref: '#/components/parameters/signature' + security: + - ApiKeyAuth: [] + responses: + '200': + description: Locked Personal Left Quota + content: + application/json: + schema: + type: object + properties: + leftPersonalQuota: + type: string + example: "1000" + required: + - leftPersonalQuota '400': description: Bad Request content: @@ -24602,25 +24161,25 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/simple-earn/locked/history/rewardsRecord: + /sapi/v1/simple-earn/flexible/subscriptionPreview: get: - summary: Get Locked Rewards History (USER_DATA) + summary: Get Flexible Subscription Preview (USER_DATA) description: |- Weight(IP): 150 tags: - Simple Earn parameters: - - name: positionId + - name: productId in: query + required: true schema: type: string - - name: asset + - name: amount in: query + required: true schema: - type: string - - $ref: '#/components/parameters/startTime' - - $ref: '#/components/parameters/endTime' - - $ref: '#/components/parameters/size' + type: number + format: double - $ref: '#/components/parameters/recvWindow' - $ref: '#/components/parameters/timestamp' - $ref: '#/components/parameters/signature' @@ -24628,46 +24187,37 @@ paths: - ApiKeyAuth: [] responses: '200': - description: Locked Rewards History + description: Flexible Subscription Preview content: application/json: schema: type: object properties: - rows: - type: array - items: - type: object - properties: - positionId: - type: string - example: "123123" - time: - type: integer - format: int64 - example: 1577257222000 - asset: - type: string - example: "BNB" - lockPeriod: - type: string - example: "30" - amount: - type: string - example: "21312.23223" - required: - - positionId - - time - - asset - - lockPeriod - - amount - total: - type: integer - format: int64 - example: 1 + totalAmount: + type: string + example: "1232.32230982" + rewardAsset: + type: string + example: "BUSD" + airDropAsset: + type: string + example: "BETH" + estDailyBonusRewards: + type: string + example: "0.22759183" + estDailyRealTimeRewards: + type: string + example: "0.22759183" + estDailyAirdropRewards: + type: string + example: "0.22759183" required: - - rows - - total + - totalAmount + - rewardAsset + - airDropAsset + - estDailyBonusRewards + - estDailyRealTimeRewards + - estDailyAirdropRewards '400': description: Bad Request content: @@ -24680,23 +24230,28 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/simple-earn/flexible/setAutoSubscribe: - post: - summary: Set Flexible Auto Subscribe (USER_DATA) + /sapi/v1/simple-earn/locked/subscriptionPreview: + get: + summary: Get Locked Subscription Preview (USER_DATA) description: |- Weight(IP): 150 tags: - Simple Earn parameters: - - name: productId + - name: projectId in: query required: true schema: type: string - - name: autoSubscribe + - name: amount in: query required: true - description: "true or false" + schema: + type: number + format: double + - name: autoSubscribe + in: query + description: "true or false, default true." schema: type: boolean - $ref: '#/components/parameters/recvWindow' @@ -24706,17 +24261,55 @@ paths: - ApiKeyAuth: [] responses: '200': - description: Flexible Product Subscription Response + description: Locked Product Subscription Response content: application/json: schema: - type: object - properties: - success: - type: boolean - example: true - required: - - success + type: array + items: + type: object + properties: + rewardAsset: + type: string + example: "AXS" + totalRewardAmt: + type: string + example: "5.17181528" + extraRewardAsset: + type: string + example: "BNB" + estTotalExtraRewardAmt: + type: string + example: "5.17181528" + nextPay: + type: string + example: "1.29295383" + nextPayDate: + type: string + example: "1646697600000" + valueDate: + type: string + example: "1646697600000" + rewardsEndDate: + type: string + example: "1651449600000" + deliverDate: + type: string + example: "1651536000000" + nextSubscriptionDate: + type: string + example: "1651536000000" + required: + - rewardAsset + - totalRewardAmt + - extraRewardAsset + - estTotalExtraRewardAmt + - nextPay + - nextPayDate + - valueDate + - rewardsEndDate + - deliverDate + - nextSubscriptionDate '400': description: Bad Request content: @@ -24729,25 +24322,23 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/simple-earn/locked/setAutoSubscribe: - post: - summary: Set Locked Auto Subscribe (USER_DATA) + /sapi/v1/simple-earn/flexible/history/rateHistory: + get: + summary: Get Rate History (USER_DATA) description: |- Weight(IP): 150 tags: - Simple Earn parameters: - - name: positionId + - name: productId in: query required: true schema: type: string - - name: autoSubscribe - in: query - required: true - description: "true or false" - schema: - type: boolean + - $ref: '#/components/parameters/startTime' + - $ref: '#/components/parameters/endTime' + - $ref: '#/components/parameters/current' + - $ref: '#/components/parameters/size' - $ref: '#/components/parameters/recvWindow' - $ref: '#/components/parameters/timestamp' - $ref: '#/components/parameters/signature' @@ -24755,17 +24346,42 @@ paths: - ApiKeyAuth: [] responses: '200': - description: Locked Auto Subscribe + description: Rate History content: application/json: schema: type: object properties: - success: - type: boolean - example: true + rows: + type: array + items: + type: object + properties: + productId: + type: string + example: "BUSD001" + asset: + type: string + example: "BUSD" + annualPercentageRate: + type: string + example: "0.00006408" + time: + type: integer + format: int64 + example: 1577233578000 + required: + - productId + - asset + - annualPercentageRate + - time + total: + type: integer + format: int64 + example: 1 required: - - success + - rows + - total '400': description: Bad Request content: @@ -24778,9 +24394,9 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/simple-earn/flexible/personalLeftQuota: + /sapi/v1/simple-earn/flexible/history/collateralRecord: get: - summary: Get Flexible Personal Left Quota (USER_DATA) + summary: Get Collateral Record (USER_DATA) description: |- Weight(IP): 150 tags: @@ -24788,9 +24404,12 @@ paths: parameters: - name: productId in: query - required: true schema: type: string + - $ref: '#/components/parameters/startTime' + - $ref: '#/components/parameters/endTime' + - $ref: '#/components/parameters/current' + - $ref: '#/components/parameters/size' - $ref: '#/components/parameters/recvWindow' - $ref: '#/components/parameters/timestamp' - $ref: '#/components/parameters/signature' @@ -24798,17 +24417,55 @@ paths: - ApiKeyAuth: [] responses: '200': - description: Flexible Personal Left Quota + description: Collateral Record content: application/json: schema: type: object properties: - leftPersonalQuota: - type: string - example: "1000" + rows: + type: array + items: + type: object + properties: + amount: + type: string + example: "100.00000000" + productId: + type: string + example: "BUSD001" + asset: + type: string + example: "USDT" + createTime: + type: integer + format: int64 + example: 1575018510000 + type: + type: string + example: "REPAY" + productName: + type: string + example: "USDT" + orderId: + type: integer + format: int64 + example: 26055 + required: + - amount + - productId + - asset + - createTime + - type + - productName + - orderId + total: + type: integer + format: int64 + example: 1 required: - - leftPersonalQuota + - rows + - total '400': description: Bad Request content: @@ -24821,19 +24478,58 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/simple-earn/locked/personalLeftQuota: + + /sapi/v1/dci/product/list: get: - summary: Get Locked Personal Left Quota (USER_DATA) + summary: Get Dual Investment product list(USER_DATA) description: |- - Weight(IP): 150 + Get Dual Investment product list + + Weight(IP): 1 tags: - - Simple Earn + - Dual Investment parameters: - - name: projectId + - name: optionType + in: query + required: true + description: Input CALL or PUT + schema: + type: string + enum: ['CALL', 'PUT'] + - name: exercisedCoin + in: query + required: true + description: |- + Target exercised asset, e.g.: + if you subscribe to a high sell product (call option), you should input: + - optionType: CALL, + - exercisedCoin: USDT, + - investCoin: BNB; + + if you subscribe to a low buy product (put option), you should input: + - optionType: PUT, + - exercisedCoin: BNB, + - investCoin: USDT; + schema: + type: string + - name: investCoin in: query required: true + description: |- + Asset used for subscribing, e.g.: + if you subscribe to a high sell product (call option), you should input: + - optionType: CALL, + - exercisedCoin: USDT, + - investCoin: BNB; + + if you subscribe to a low buy product (put option), you should input: + - optionType: PUT, + - exercisedCoin: BNB, + - investCoin: USDT; schema: type: string + - $ref: '#/components/parameters/smallPageSize' + - $ref: '#/components/parameters/pageIndex' - $ref: '#/components/parameters/recvWindow' - $ref: '#/components/parameters/timestamp' - $ref: '#/components/parameters/signature' @@ -24841,17 +24537,103 @@ paths: - ApiKeyAuth: [] responses: '200': - description: Locked Personal Left Quota + description: Dual Investment product list content: application/json: schema: type: object properties: - leftPersonalQuota: - type: string - example: "1000" + total: + type: integer + format: int64 + example: 1 + list: + type: array + items: + type: object + properties: + id: + type: string + example: "741590" + investCoin: + type: string + example: "USDT" + exercisedCoin: + type: string + example: "BNB" + strikePrice: + type: string + example: "380" + duration: + type: integer + format: int32 + example: 4 + settleDate: + type: integer + format: int64 + example: 1709020800000 + purchaseDecimal: + type: integer + format: int32 + example: 8 + purchaseEndTime: + type: integer + format: int64 + example: 1708934400000 + canPurchase: + type: boolean + example: true + apr: + type: string + example: "0.6076" + orderId: + type: integer + format: int64 + example: 8257205859 + minAmount: + type: string + example: "0.1" + maxAmount: + type: string + example: "25265.7" + createTimestamp: + type: integer + format: int64 + example: 1708560084000 + optionType: + type: string + example: "PUT" + isAutoCompoundEnable: + type: boolean + example: true + autoCompoundPlanList: + type: array + items: + type: string + example: + - "STANDARD" + - "ADVANCE" + required: + - id + - investCoin + - exercisedCoin + - strikePrice + - duration + - settleDate + - purchaseDecimal + - purchaseEndTime + - canPurchase + - apr + - orderId + - minAmount + - maxAmount + - createTimestamp + - optionType + - isAutoCompoundEnable + - autoCompoundPlanList required: - - leftPersonalQuota + - total + - list '400': description: Bad Request content: @@ -24864,25 +24646,38 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/simple-earn/flexible/subscriptionPreview: - get: - summary: Get Flexible Subscription Preview (USER_DATA) + /sapi/v1/dci/product/subscribe: + post: + summary: Subscribe Dual Investment products(USER_DATA) description: |- - Weight(IP): 150 + Subscribe Dual Investment products + + - `Products are not available.` means that the APR changes to lower value, or the orders are not available. + - `Failed` is a system or network errors. + + Weight(IP): 1 tags: - - Simple Earn + - Dual Investment parameters: - - name: productId + - name: id in: query required: true + description: get id from /sapi/v1/dci/product/list schema: type: string - - name: amount + - name: orderId + in: query + required: true + description: get orderId from /sapi/v1/dci/product/list + schema: + type: string + - name: depositAmount in: query required: true schema: type: number format: double + - $ref: '#/components/parameters/autoCompoundPlan' - $ref: '#/components/parameters/recvWindow' - $ref: '#/components/parameters/timestamp' - $ref: '#/components/parameters/signature' @@ -24890,37 +24685,71 @@ paths: - ApiKeyAuth: [] responses: '200': - description: Flexible Subscription Preview + description: Dual Investment product subscription response content: application/json: schema: type: object properties: - totalAmount: + positionId: + type: integer + format: int64 + example: 10208824 + investCoin: type: string - example: "1232.32230982" - rewardAsset: + example: "BNB" + exercisedCoin: type: string - example: "BUSD" - airDropAsset: + example: "USDT" + subscriptionAmount: type: string - example: "BETH" - estDailyBonusRewards: + example: "0.002" + duration: + type: integer + format: int32 + example: 4 + autoCompoundPlan: type: string - example: "0.22759183" - estDailyRealTimeRewards: + description: STANDARD, ADVANCED, this field won't display when autocompound is set to None + example: "STANDARD" + strikePrice: type: string - example: "0.22759183" - estDailyAirdropRewards: + example: "380" + settleDate: + type: integer + format: int64 + example: 1709020800000 + purchaseStatus: type: string - example: "0.22759183" + example: "PURCHASE_SUCCESS" + apr: + type: string + example: "0.7397" + orderId: + type: integer + format: int64 + example: 8259117597 + purchaseTime: + type: integer + format: int64 + example: 1708677583874 + optionType": + type: string + example: "CALL" required: - - totalAmount - - rewardAsset - - airDropAsset - - estDailyBonusRewards - - estDailyRealTimeRewards - - estDailyAirdropRewards + - positionId + - investCoin + - exercisedCoin + - subscriptionAmount + - duration + - autoCompoundPlan + - strikePrice + - settleDate + - purchaseStatus + - apr + - orderId + - purchaseTime + - optionType '400': description: Bad Request content: @@ -24933,30 +24762,32 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/simple-earn/locked/subscriptionPreview: + /sapi/v1/dci/product/positions: get: - summary: Get Locked Subscription Preview (USER_DATA) + summary: Get Dual Investment positions(USER_DATA) description: |- - Weight(IP): 150 + Get Dual Investment positions (batch) + + Weight(IP): 1 tags: - - Simple Earn + - Dual Investment parameters: - - name: projectId + - name: status in: query - required: true + description: |- + - PENDING: Products are purchasing, will give results later; + - PURCHASE_SUCCESS: purchase successfully; + - SETTLED: Products are finish settling; + - PURCHASE_FAIL: fail to purchase; + - REFUNDING: refund ongoing; + - REFUND_SUCCESS: refund to spot account successfully; + - SETTLING: Products are settling. + If don't fill this field, will response all the position status. schema: type: string - - name: amount - in: query - required: true - schema: - type: number - format: double - - name: autoSubscribe - in: query - description: "true or false, default true." - schema: - type: boolean + enum: ['PENDING', 'PURCHASE_SUCCESS', 'SETTLED', 'PURCHASE_FAIL', 'REFUNDING', 'REFUND_SUCCESS', 'SETTLING'] + - $ref: '#/components/parameters/smallPageSize' + - $ref: '#/components/parameters/pageIndex' - $ref: '#/components/parameters/recvWindow' - $ref: '#/components/parameters/timestamp' - $ref: '#/components/parameters/signature' @@ -24964,55 +24795,81 @@ paths: - ApiKeyAuth: [] responses: '200': - description: Locked Product Subscription Response + description: Dual Investment product list content: application/json: schema: - type: array - items: - type: object - properties: - rewardAsset: - type: string - example: "AXS" - totalRewardAmt: - type: string - example: "5.17181528" - extraRewardAsset: - type: string - example: "BNB" - estTotalExtraRewardAmt: - type: string - example: "5.17181528" - nextPay: - type: string - example: "1.29295383" - nextPayDate: - type: string - example: "1646697600000" - valueDate: - type: string - example: "1646697600000" - rewardsEndDate: - type: string - example: "1651449600000" - deliverDate: - type: string - example: "1651536000000" - nextSubscriptionDate: - type: string - example: "1651536000000" - required: - - rewardAsset - - totalRewardAmt - - extraRewardAsset - - estTotalExtraRewardAmt - - nextPay - - nextPayDate - - valueDate - - rewardsEndDate - - deliverDate - - nextSubscriptionDate + type: object + properties: + total: + type: integer + format: int64 + example: 1 + list: + type: array + items: + type: object + properties: + id: + type: string + example: "741590" + investCoin: + type: string + example: "USDT" + exercisedCoin: + type: string + example: "BNB" + subscriptionAmount: + type: string + example: "0.5" + strikePrice: + type: string + example: "380" + duration: + type: integer + format: int32 + example: 4 + settleDate: + type: integer + format: int64 + example: 1709020800000 + purchaseStatus: + type: string + example: "PURCHASE_SUCCESS" + apr: + type: string + example: "0.0365" + orderId: + type: integer + format: int64 + example: 7973677530 + purchaseEndTime: + type: integer + format: int64 + example: 1708329600000 + optionType: + type: string + example: "PUT" + autoCompoundPlan: + type: string + example: "STANDARD" + required: + - id + - investCoin + - exercisedCoin + - subscriptionAmount + - strikePrice + - duration + - settleDate + - purchaseStatus + - apr + - orderId + - purchaseEndTime + - optionType + - autoCompoundPlan + required: + - total + - list '400': description: Bad Request content: @@ -25025,23 +24882,16 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/simple-earn/flexible/history/rateHistory: + /sapi/v1/dci/product/accounts: get: - summary: Get Rate History (USER_DATA) + summary: Check Dual Investment accounts(USER_DATA) description: |- - Weight(IP): 150 + Check Dual Investment accounts + + Weight(IP): 1 tags: - - Simple Earn + - Dual Investment parameters: - - name: productId - in: query - required: true - schema: - type: string - - $ref: '#/components/parameters/startTime' - - $ref: '#/components/parameters/endTime' - - $ref: '#/components/parameters/current' - - $ref: '#/components/parameters/size' - $ref: '#/components/parameters/recvWindow' - $ref: '#/components/parameters/timestamp' - $ref: '#/components/parameters/signature' @@ -25049,42 +24899,23 @@ paths: - ApiKeyAuth: [] responses: '200': - description: Rate History + description: Dual Investment accounts content: application/json: schema: type: object properties: - rows: - type: array - items: - type: object - properties: - productId: - type: string - example: "BUSD001" - asset: - type: string - example: "BUSD" - annualPercentageRate: - type: string - example: "0.00006408" - time: - type: integer - format: int64 - example: 1577233578000 - required: - - productId - - asset - - annualPercentageRate - - time - total: - type: integer - format: int64 - example: 1 + totalAmountInBTC: + type: string + description: Total BTC amounts in Dual Investment + example: "0.01067982" + totalAmountInUSDT: + type: string + description: Total USDT equivalents in BTC in Dual Investment + example: "77.13289230" required: - - rows - - total + - totalAmountInBTC + - totalAmountInUSDT '400': description: Bad Request content: @@ -25097,22 +24928,28 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - /sapi/v1/simple-earn/flexible/history/collateralRecord: - get: - summary: Get Collateral Record (USER_DATA) + /sapi/v1/dci/product/auto_compound/edit-status: + post: + summary: Change Auto-Compound status(USER_DATA) description: |- - Weight(IP): 150 + Change Auto-Compound status + + - 15:31 ~ 16:00 UTC+8 This function is disabled + + Weight(IP): 1 + + Rate Limit: Maximum 1 time/s per account tags: - - Simple Earn + - Dual Investment parameters: - - name: productId + - name: positionId in: query + required: true + description: Get positionId from /sapi/v1/dci/product/positions schema: - type: string - - $ref: '#/components/parameters/startTime' - - $ref: '#/components/parameters/endTime' - - $ref: '#/components/parameters/current' - - $ref: '#/components/parameters/size' + type: integer + format: int64 + - $ref: '#/components/parameters/autoCompoundPlan' - $ref: '#/components/parameters/recvWindow' - $ref: '#/components/parameters/timestamp' - $ref: '#/components/parameters/signature' @@ -25120,55 +24957,22 @@ paths: - ApiKeyAuth: [] responses: '200': - description: Collateral Record + description: Change Auto-Compound status response content: application/json: schema: type: object properties: - rows: - type: array - items: - type: object - properties: - amount: - type: string - example: "100.00000000" - productId: - type: string - example: "BUSD001" - asset: - type: string - example: "USDT" - createTime: - type: integer - format: int64 - example: 1575018510000 - type: - type: string - example: "REPAY" - productName: - type: string - example: "USDT" - orderId: - type: integer - format: int64 - example: 26055 - required: - - amount - - productId - - asset - - createTime - - type - - productName - - orderId - total: - type: integer - format: int64 - example: 1 + positionId: + type: string + example: 123456789 + autoCompoundPlan: + type: string + description: NONE, STANDARD, ADVANCED + example: "ADVANCED" required: - - rows - - total + - positionId + - autoCompoundPlan '400': description: Bad Request content: @@ -25180,7 +24984,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/error' + $ref: '#/components/schemas/error' components: parameters: getCrossMargingTransferHistoryType: @@ -25661,6 +25465,16 @@ components: schema: type: string example: '["BTCUSDT","BNBBTC"]' + tickerType: + name: type + in: query + description: |- + Supported values: FULL or MINI. + If none provided, the default is FULL + schema: + type: string + enum: ['FULL', 'MINI'] + example: 'FULL' permissions: name: permissions in: query @@ -25890,6 +25704,12 @@ components: description: Number of pages, minimum 10, maximum 200 schema: type: string + smallPageSize: + name: pageSize + in: query + description: MIN 1, MAX 100; Default 100 + schema: + type: string configId: name: configId in: query @@ -26180,14 +26000,6 @@ components: in: query schema: type: string - bswapClaimType: - name: type - in: query - description: '0: Swap rewards, 1: Liquidity rewards, default to 0' - schema: - type: integer - format: int32 - example: 0 optionalTrailingDelta: name: trailingDelta in: query @@ -26195,16 +26007,6 @@ components: schema: type: number format: double - product: - name: product - in: query - required: true - description: |- - * `STAKING` - for Locked Staking - * `F_DEFI` - for flexible DeFi Staking - * `L_DEFI` - for locked DeFi Staking - schema: - type: string productId: name: productId in: query @@ -26262,6 +26064,17 @@ components: schema: type: boolean example: true + autoCompoundPlan: + name: autoCompoundPlan + in: query + description: |- + NONE: switch off the plan, + STANDARD: standard plan, + ADVANCED: advanced plan; + required: true + schema: + type: string + enum: ['NONE', 'STANDARD', 'ADVANCE'] schemas: account: type: object @@ -27815,6 +27628,87 @@ components: - firstId - lastId - count + dayTickerList: + type: array + items: + $ref: '#/components/schemas/dayTicker' + dayTicker: + type: object + properties: + symbol: + type: string + example: BTCUSDT + priceChange: + type: string + example: '-83.13000000' + description: Absolute price change + priceChangePercent: + type: string + example: '-0.317' + description: Relative price change in percent + weightedAvgPrice: + type: string + example: '26234.58803036' + description: quoteVolume / volume + openPrice: + type: string + example: '26304.80000000' + highPrice: + type: string + example: '26397.46000000' + lowPrice: + type: string + example: '26088.34000000' + lastPrice: + type: string + example: '26221.67000000' + volume: + type: string + description: Volume in base asset + example: '18495.35066000' + quoteVolume: + type: string + example: '485217905.04210480' + description: Volume in quote asset + openTime: + type: integer + format: int64 + example: 1695686400000 + closeTime: + type: integer + format: int64 + example: 1695772799999 + firstId: + type: integer + format: int64 + example: 3220151555 + description: Trade ID of the first trade in the interval + lastId: + type: integer + format: int64 + example: 3220849281 + description: Trade ID of the last trade in the interval + count: + type: integer + format: int64 + example: 697727 + description: Number of trades in the interval + required: + - symbol + - priceChange + - priceChangePercent + - weightedAvgPrice + - openPrice + - highPrice + - lowPrice + - lastPrice + - volume + - quoteVolume + - openTime + - closeTime + - firstId + - lastId + - count myTrade: type: object properties: @@ -28615,126 +28509,6 @@ components: - unrealizedProfit required: - deliveryPositionRiskVos - bswapAddLiquidityPreviewCombination: - type: object - properties: - quoteAsset: - type: string - example: "USDT" - baseAsset: - type: string - example: "BUSD" - quoteAmt: - type: integer - format: int64 - example: 300000 - baseAmt: - type: integer - format: int64 - example: 299975 - price: - type: number - format: double - example: 1.00008334 - share: - type: number - format: double - example: 1.23 - required: - - quoteAsset - - baseAsset - - quoteAmt - - baseAmt - - price - - share - bswapAddLiquidityPreviewSingle: - type: object - properties: - quoteAsset: - type: string - example: "USDT" - quoteAmt: - type: integer - format: int64 - example: 300000 - price: - type: number - format: double - example: 1.00008334 - share: - type: number - format: double - example: 1.23 - slippage: - type: number - format: double - example: 0.00007245 - fee: - type: number - format: double - example: 120 - required: - - quoteAsset - - quoteAmt - - price - - share - - slippage - - fee - bswapRmvLiquidityPreviewCombination: - type: object - properties: - quoteAsset: - type: string - example: "USDT" - baseAsset: - type: string - example: "BUSD" - quoteAmt: - type: integer - format: int64 - example: 300000 - baseAmt: - type: integer - format: int64 - example: 299975 - price: - type: number - format: double - example: 1.00008334 - required: - - quoteAsset - - baseAsset - - quoteAmt - - baseAmt - - price - bswapRmvLiquidityPreviewSingle: - type: object - properties: - quoteAsset: - type: string - example: "USDT" - quoteAmt: - type: integer - format: int64 - example: 300000 - price: - type: number - format: double - example: 1.00008334 - slippage: - type: number - format: double - example: 0.00007245 - fee: - type: number - format: double - example: 120 - required: - - quoteAsset - - quoteAmt - - price - - slippage - - fee error: type: object properties: