> ## Documentation Index
> Fetch the complete documentation index at: https://perps-api.vooi.io/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Build the payload the user must sign to approve a broker on the given exchange



## OpenAPI

````yaml https://vooi-api-app.fly.dev/swagger/json post /exchange/broker/prepare
openapi: 3.1.0
info:
  title: VOOI API
  description: Unified perps API
  version: '1.0'
  contact: {}
servers:
  - url: https://perps-api.vooi.io
security: []
tags: []
paths:
  /exchange/broker/prepare:
    post:
      tags:
        - Exchange / Broker
      summary: >-
        Build the payload the user must sign to approve a broker on the given
        exchange
      operationId: ExchangeBrokerController_prepareApproveBroker
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PrepareApproveBrokerBodyDto'
      responses:
        '200':
          description: >-
            Per-exchange prepare payload. Response shape depends on the
            `exchange` field of the request body:

            - **hyperliquid** → `{ pendingData: { action, nonce }, signData:
            <EIP-712 typed data> }`

            - **lighter** / **robinhood** → `{ pendingData: { txInfo, txType },
            signData: <hex message> }`

            - **aster** → `{ pendingData: { asterChain, builder, builderName,
            maxFeeRate, nonce, user }, signData: <EIP-712 typed data> }`
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: >-
                      #/components/schemas/PrepareHyperliquidApproveBrokerResponseDto
                  - $ref: >-
                      #/components/schemas/PrepareLighterApproveBrokerResponseDto
                  - $ref: '#/components/schemas/PrepareAsterApproveBrokerResponseDto'
        '503':
          description: ExchangeApiError
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseDTO'
      security:
        - bearer: []
components:
  schemas:
    PrepareApproveBrokerBodyDto:
      oneOf:
        - type: object
          properties:
            identifier:
              type: string
              description: >-
                Builder Ethereum address. Omit if your account is registered
                through a broker — the configured builder address is used
                automatically. If provided alongside a configured broker, it
                must match exactly.
              example: '0x1234567890abcdef1234567890abcdef12345678'
            maxFeeBps:
              description: >-
                Builder fee in basis points. Omit if your account is registered
                through a broker — the configured fee is used automatically. If
                provided alongside a configured broker, it must match exactly.
              example: '1.5'
              type: string
              pattern: ^\d+(\.\d+)?$
            exchange:
              type: string
              enum:
                - aster
          required:
            - exchange
          title: PrepareAsterApproveBrokerBody
        - type: object
          properties:
            identifier:
              type: string
              description: >-
                Builder Ethereum address. Omit if your account is registered
                through a broker — the configured builder address is used
                automatically. If provided alongside a configured broker, it
                must match exactly.
              example: '0x1234567890abcdef1234567890abcdef12345678'
            maxFeeBps:
              description: >-
                Builder fee in basis points. Omit if your account is registered
                through a broker — the configured fee is used automatically. If
                provided alongside a configured broker, it must match exactly.
              example: '1.5'
              type: string
              pattern: ^\d+(\.\d+)?$
            exchange:
              type: string
              enum:
                - hyperliquid
          required:
            - exchange
          title: PrepareHyperliquidApproveBrokerBody
        - type: object
          properties:
            exchange:
              type: string
              enum:
                - lighter
            identifier:
              type: string
              pattern: ^\d+$
              example: '42'
              description: >-
                Integrator account index. Omit if your account is registered
                through a broker — the configured integrator index is used
                automatically. If provided alongside a configured broker, it
                must match exactly.
            maxFeeBps:
              description: >-
                Builder fee in basis points. Omit if your account is registered
                through a broker — the configured fee is used automatically. If
                provided alongside a configured broker, it must match exactly.
              example: '2'
              type: string
              pattern: ^[1-9]\d*$
          required:
            - exchange
          title: PrepareLighterApproveBrokerBody
        - type: object
          properties:
            exchange:
              type: string
              enum:
                - robinhood
            identifier:
              type: string
              pattern: ^\d+$
              example: '42'
              description: >-
                Integrator account index. Omit if your account is registered
                through a broker — the configured integrator index is used
                automatically. If provided alongside a configured broker, it
                must match exactly.
            maxFeeBps:
              description: >-
                Builder fee in basis points. Omit if your account is registered
                through a broker — the configured fee is used automatically. If
                provided alongside a configured broker, it must match exactly.
              example: '2'
              type: string
              pattern: ^[1-9]\d*$
          required:
            - exchange
          title: PrepareRobinhoodApproveBrokerBody
      title: PrepareApproveBrokerBody
      type: object
    PrepareHyperliquidApproveBrokerResponseDto:
      type: object
      properties:
        pendingData:
          type: object
          properties:
            action:
              type: object
              propertyNames:
                type: string
              additionalProperties:
                $ref: '#/components/schemas/Json'
              description: >-
                Hyperliquid approveBuilderFee action to be replayed in the
                execute step.
            nonce:
              type: number
              description: Nonce (timestamp in ms) used for replay protection.
          required:
            - action
            - nonce
          title: HyperliquidApproveBrokerPendingData
          description: Opaque payload to pass back to the execute endpoint.
        signData:
          type: object
          properties:
            domain:
              type: object
              properties:
                chainId:
                  type: number
                name:
                  type: string
                verifyingContract:
                  type: string
                  description: Ethereum address
                  example: '0x1234567890abcdef1234567890abcdef12345678'
                version:
                  type: string
              required:
                - name
                - version
            message:
              type: object
              propertyNames:
                type: string
              additionalProperties: {}
            primaryType:
              type: string
            types:
              type: object
              propertyNames:
                type: string
              additionalProperties:
                type: array
                items:
                  type: object
                  properties:
                    name:
                      type: string
                    type:
                      type: string
                  required:
                    - name
                    - type
          required:
            - domain
            - message
            - primaryType
            - types
          description: EIP-712 typed data to sign with the main wallet.
      required:
        - pendingData
        - signData
      title: PrepareHyperliquidApproveBrokerResponse
    PrepareLighterApproveBrokerResponseDto:
      type: object
      properties:
        pendingData:
          type: object
          properties:
            txInfo:
              type: string
              description: Serialized transaction info.
            txType:
              type: number
              description: Transaction type identifier.
          required:
            - txInfo
            - txType
          title: LighterApproveBrokerPendingData
          description: Opaque transaction data to pass back in execute step.
        signData:
          type: string
          description: Hex message to sign with the Ethereum wallet.
      required:
        - pendingData
        - signData
      title: PrepareLighterApproveBrokerResponse
    PrepareAsterApproveBrokerResponseDto:
      type: object
      properties:
        pendingData:
          type: object
          properties:
            asterChain:
              type: string
              description: Aster chain identifier (e.g. "Mainnet").
            builder:
              type: string
              description: Builder (broker) EVM address, lowercased.
            builderName:
              type: string
              description: Human-readable builder name (may be empty).
            maxFeeRate:
              type: string
              description: >-
                Maximum fee rate the builder may charge, as a decimal string
                (e.g. "0.0015").
            nonce:
              type: number
              description: Nonce (timestamp in microseconds) used for replay protection.
            user:
              type: string
              description: Aster master user address.
          required:
            - asterChain
            - builder
            - builderName
            - maxFeeRate
            - nonce
            - user
          title: AsterApproveBrokerPendingData
          description: Opaque payload to pass back to the execute endpoint.
        signData:
          type: object
          properties:
            domain:
              type: object
              properties:
                chainId:
                  type: number
                name:
                  type: string
                verifyingContract:
                  type: string
                  description: Ethereum address
                  example: '0x1234567890abcdef1234567890abcdef12345678'
                version:
                  type: string
              required:
                - name
                - version
            message:
              type: object
              propertyNames:
                type: string
              additionalProperties: {}
            primaryType:
              type: string
            types:
              type: object
              propertyNames:
                type: string
              additionalProperties:
                type: array
                items:
                  type: object
                  properties:
                    name:
                      type: string
                    type:
                      type: string
                  required:
                    - name
                    - type
          required:
            - domain
            - message
            - primaryType
            - types
          description: EIP-712 typed data to sign with the master wallet.
      required:
        - pendingData
        - signData
      title: PrepareAsterApproveBrokerResponse
    ErrorResponseDTO:
      type: object
      properties:
        message:
          type: string
          example: 'Invalid order id: 123'
        statusCode:
          example: 503
          type: number
      required:
        - message
      title: ErrorResponse
    Json:
      description: Any JSON value
      title: Json
      anyOf:
        - type: string
        - type: number
        - type: boolean
        - type: 'null'
        - type: array
          items:
            $ref: '#/components/schemas/Json'
        - type: object
          propertyNames:
            type: string
          additionalProperties:
            $ref: '#/components/schemas/Json'
  securitySchemes:
    bearer:
      scheme: bearer
      bearerFormat: JWT
      type: http

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.