Bullish Trading Accounts API

The trading-accounts API from Bullish — 2 operation(s) for trading-accounts.

OpenAPI Specification

bullish-trading-accounts-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  description: REST API specification for the Bullish Trading API.
  version: 1.0.0
  title: Bullish Trading Trading Accounts API
  contact:
    name: Bullish Help Center
    email: support@bullish.com
    url: https://support.bullish.com
servers:
- url: https://api.exchange.bullish.com/trading-api
  description: PRODUCTION
- url: https://registered.api.exchange.bullish.com/trading-api
  description: PRODUCTION
- url: https://prod.access.bullish.com/trading-api
  description: PRODUCTION (Direct Connect)
- url: https://api.bugbounty.bullish.com/trading-api
  description: SECURITY SANDBOX
- url: https://api.simnext.bullish-test.com/trading-api
  description: API SANDBOX
- url: https://registered.api.simnext.bullish-test.com/trading-api
  description: API SANDBOX
- url: https://simnext.access.bullish.com/trading-api
  description: API SANDBOX (Direct Connect)
tags:
- name: trading-accounts
  x-displayName: Trading Accounts
paths:
  /v1/accounts/trading-accounts:
    get:
      tags:
      - trading-accounts
      summary: Get All Trading Accounts Details
      description: 'Gets details for all trading accounts accessible by the API key used in the request. It requires [bearer token](/rest/authentication#add-authenticated-request-header) in authorization header. The trading account''s id will be used in all other REST API


        **Ratelimited:** `True`

        '
      operationId: getTradingAccounts
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                minItems: 0
                maxItems: 25
                items:
                  $ref: '#/components/schemas/TradingAccountResponse'
        '401':
          description: Not Authenticated
        '403':
          description: Access Forbidden
        '429':
          description: Too Many Requests
        '500':
          description: Internal Server Error
      security:
      - jwtTokenAuth: []
  /v1/accounts/trading-accounts/{tradingAccountId}:
    get:
      tags:
      - trading-accounts
      summary: Get Trading Account Details by ID
      description: 'Gets details for specific trading account by `tradingAccountId` and API key used in the request. It requires [bearer token](/rest/authentication#add-authenticated-request-header) in authorization header.


        **Ratelimited:** `True`

        '
      operationId: getTradingAccountById
      parameters:
      - in: path
        name: tradingAccountId
        description: Id of the trading account
        schema:
          $ref: '#/components/schemas/TradingAccountId'
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TradingAccountResponse'
        '400':
          description: Bad Request Parameter
        '401':
          description: Not Authenticated
        '403':
          description: Access Forbidden
        '404':
          description: Resource Not Found
        '429':
          description: Too Many Requests
        '500':
          description: Internal Server Error
      security:
      - jwtTokenAuth: []
components:
  schemas:
    MarginProfile:
      properties:
        initialMarketRiskMultiplierPct:
          description: market risk multiplier used to calculate initial margin requirement of the account
          type: string
          example: '200.00'
        warningMarketRiskMultiplierPct:
          description: market risk multiplier used to calculate warning margin requirement of the account
          type: string
          example: '150.00'
        liquidationMarketRiskMultiplierPct:
          description: market risk multiplier used to calculate liquidation margin requirement of the account
          type: string
          example: '100.00'
        fullLiquidationMarketRiskMultiplierPct:
          description: market risk multiplier used to calculate full liquidation margin requirement of the account
          type: string
          example: '75.00'
        defaultedMarketRiskMultiplierPct:
          description: market risk multiplier used to calculate defaulted margin requirement of the account
          type: string
          example: '50.00'
    TradingAccountId:
      description: unique trading account ID
      type: string
      example: '111000000000001'
    TradingAccountResponse:
      type: object
      required:
      - isBorrowing
      - isLending
      - isPrimaryAccount
      - maxInitialLeverage
      - rateLimitToken
      - tradingAccountDescription
      - tradingAccountId
      - tradingAccountName
      - isDefaulted
      - riskLimitUSD
      - totalBorrowedUSD
      - totalCollateralUSD
      - initialMarginUSD
      - warningMarginUSD
      - liquidationMarginUSD
      - fullLiquidationMarginUSD
      - defaultedMarginUSD
      - endCustomerId
      - isConcentrationRiskEnabled
      - liquidityAddonUSD
      - marketRiskUSD
      - marginProfile
      - totalLiabilitiesUSD
      - tradeFeeRate
      properties:
        isBorrowing:
          description: whether the trading account is borrowing
          type: string
          example: 'false'
        isLending:
          description: whether the trading account is lending
          type: string
          example: 'false'
        makerFee:
          description: Deprecated and no longer accurate. See `tradeFeeRate` instead
          type: string
          example: '0.00000000'
          deprecated: true
        takerFee:
          description: Deprecated and no longer accurate. See `tradeFeeRate` instead
          type: string
          example: '0.00020000'
          deprecated: true
        maxInitialLeverage:
          description: max initial leverage
          type: string
          example: '1'
        tradingAccountId:
          description: id of the trading account
          allOf:
          - $ref: '#/components/schemas/TradingAccountId'
        tradingAccountName:
          description: name of the trading account
          type: string
          example: algo trading account
        tradingAccountDescription:
          description: description of the trading account
          type: string
          example: algo trading account with experimental strategy
        isPrimaryAccount:
          description: whether this is the primary account
          type: string
          example: 'false'
        rateLimitToken:
          description: unique rate limit token of the trading account
          type: string
          example: 97d98951b12fb11f330dd9cb1b807d888c702679ee602edcf1ebc6bac17ad63d
        isDefaulted:
          description: whether the trading account is defaulted
          type: string
          example: 'false'
        tradeFeeRate:
          description: Trade fees per `feeGroupId` for this trading account
          type: array
          minItems: 0
          items:
            allOf:
            - $ref: '#/components/schemas/TradeFeeRate'
        riskLimitUSD:
          description: The maximum allowed borrowing for this trading account (in USD currency)
          type: string
          example: '10000.0000'
        totalLiabilitiesUSD:
          description: The The total liabilities for this trading account (in USD currency)
          type: string
          example: '14000.0000'
        totalBorrowedUSD:
          description: total borrowed across all assets in this trading account displayed in the reference asset in USD
          type: string
          example: '12000.0000'
        totalCollateralUSD:
          description: total collateral across all assets in this trading account displayed in the reference asset in USD
          type: string
          example: '13000.0000'
        initialMarginUSD:
          description: The minimum margin one must maintain in order to be able to purposefully increase risk
          type: string
          example: '0000.0000'
        warningMarginUSD:
          description: The minimum margin when the customer will receive warning via email/notifications over UI
          type: string
          example: '0000.0000'
        liquidationMarginUSD:
          description: The minimum value of margin one must maintain in order to avoid liquidation
          type: string
          example: '0000.0000'
        fullLiquidationMarginUSD:
          description: The value of margin when full liquidation occurs
          type: string
          example: '0000.0000'
        defaultedMarginUSD:
          description: The value of margin when this trading account will be moved into a Defaulted state
          type: string
          example: '0000.0000'
        endCustomerId:
          description: The end customer id used for self trade prevention (default is institution id, max 32 characters)
          type: string
          example: PrimeBroker
        isConcentrationRiskEnabled:
          description: whether concentration risk checks are enforced for an account when sending new orders. By default, concentration risk checks will apply to all accounts
          type: string
          example: 'true'
        liquidityAddonUSD:
          description: expected market impact of unwinding the portfolio in the case of a liquidation event
          type: string
          example: '1000.0000'
        marketRiskUSD:
          description: the worst possible loss on the portfolio based on scenario analysis
          type: string
          example: '2000.0000'
        marginProfile:
          description: Contains the market risk multipliers applied to a trading account to derive the five individual Margin Requirement values
          allOf:
          - $ref: '#/components/schemas/MarginProfile'
    TradeFeeRate:
      type: object
      required:
      - feeGroupId
      - makerFee
      - takerFee
      - makerOtcFee
      - takerOtcFee
      - brokerFee
      properties:
        feeGroupId:
          type: integer
          description: Identifier for this particular fee tier
          example: 1
        makerFee:
          type: string
          description: Maker Fee in decimal value
          example: '0.00005000'
        takerFee:
          type: string
          description: Taker Fee in decimal value
          example: '0.00005000'
        makerOtcFee:
          type: string
          description: OTC Maker Fee in decimal value
          example: '0.00005000'
        takerOtcFee:
          type: string
          description: OTC Taker Fee in decimal value
          example: '0.00005000'
        brokerFee:
          type: string
          description: Fee charged for brokered OTC trade in decimal value
          example: '0.00005000'
        auctionFee:
          type: string
          description: Fee charged for auction trade in decimal value
          example: '0.00005000'
  securitySchemes:
    jwtTokenAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
x-tagGroups:
- name: Public Endpoints
  tags:
  - general
  - asset-data
  - market-data
  - market-history-data
  - index-price-data
  - derivatives-public
  - auction-public
- name: Private Endpoints
  tags:
  - session-management
  - trading-accounts
  - account-assets
  - orders
  - trades
  - amm-instructions
  - transfer
  - custody
  - derivatives
  - market-maker-protection
  - history
  - otc
  - idb
  - portfolio-margin-simulator