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

# Deposit USDC to perpetual trading account

> Prepare a USDC deposit from Arbitrum via EIP-2612 Permit.

Returns EIP-712 typed data for the user to sign off-chain (no gas needed).
Compass does NOT broadcast the bridge tx — the integrator's own sponsor
wallet calls batchedDepositWithPermit on the HL Bridge2 contract on
Arbitrum after the user signs. See api_docs/v2/Products/Perpetual-Trading.mdx
"Deposit USDC" section for the bridge-broadcast code.



## OpenAPI

````yaml /v2/combined_spec.json post /v2/perpetual_trading/deposit
openapi: 3.1.0
info:
  title: Compass API
  description: Compass Labs DeFi API
  version: 0.0.1
servers:
  - url: https://api.compasslabs.ai
    description: Production server
security:
  - ApiKeyAuth: []
paths:
  /v2/perpetual_trading/deposit:
    post:
      tags:
        - Perpetual Trading
      summary: Deposit USDC to perpetual trading account
      description: >-
        Prepare a USDC deposit from Arbitrum via EIP-2612 Permit.


        Returns EIP-712 typed data for the user to sign off-chain (no gas
        needed).

        Compass does NOT broadcast the bridge tx — the integrator's own sponsor

        wallet calls batchedDepositWithPermit on the HL Bridge2 contract on

        Arbitrum after the user signs. See
        api_docs/v2/Products/Perpetual-Trading.mdx

        "Deposit USDC" section for the bridge-broadcast code.
      operationId: v2_perpetual_trading_deposit
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PerpetualTradingDepositRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PerpetualTradingDepositResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-codeSamples:
        - lang: python
          label: Python (SDK)
          source: |-
            from compass_api_sdk import CompassAPI


            with CompassAPI(
                api_key_auth="<YOUR_API_KEY_HERE>",
            ) as compass_api:

                res = compass_api.perpetual_trading.perpetual_trading_deposit(owner="0x06A9aF046187895AcFc7258450B15397CAc67400", amount="100.0")

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { CompassApiSDK } from "@compass-labs/api-sdk";

            const compassApiSDK = new CompassApiSDK({
              apiKeyAuth: "<YOUR_API_KEY_HERE>",
            });

            async function run() {
              const result = await compassApiSDK.perpetualTrading.perpetualTradingDeposit({
                owner: "0x06A9aF046187895AcFc7258450B15397CAc67400",
                amount: "100.0",
              });

              console.log(result);
            }

            run();
components:
  schemas:
    PerpetualTradingDepositRequest:
      properties:
        owner:
          type: string
          title: Owner
          description: The user's EOA address on Arbitrum
          default: '0x06A9aF046187895AcFc7258450B15397CAc67400'
          examples:
            - '0x06A9aF046187895AcFc7258450B15397CAc67400'
        amount:
          type: string
          title: Amount
          description: USDC amount to deposit (human-readable, e.g. '1000.0')
          default: '100.0'
          examples:
            - '100.0'
      type: object
      required:
        - owner
        - amount
      title: PerpetualTradingDepositRequest
      description: >-
        Request to deposit USDC from Arbitrum into the user's perpetual trading
        account.
      default:
        owner: '0x06A9aF046187895AcFc7258450B15397CAc67400'
        amount: '100.0'
    PerpetualTradingDepositResponse:
      properties:
        permit:
          $ref: '#/components/schemas/PermitTypedDataResponse-Output'
          description: EIP-712 typed data for the USDC permit — user signs this off-chain.
        amount_raw:
          type: integer
          title: Amount Raw
          description: >-
            USDC amount in raw 6-decimal units. Pass this and the signature to
            /deposit/sponsor_prepare.
        destination:
          type: string
          title: Destination
          description: >-
            Address that will be credited on Hyperliquid (equals the deposit
            owner EOA — HL keys accounts by EVM address).
      type: object
      required:
        - permit
        - amount_raw
        - destination
      title: PerpetualTradingDepositResponse
      description: >-
        EIP-2612 permit data the user signs to authorize a USDC bridge deposit.


        After signing, submit the signature to
        /v2/perpetual_trading/deposit/sponsor_prepare

        to get a ready-to-broadcast Arbitrum tx that calls
        Bridge2.batchedDepositWithPermit.

        The integrator's sponsor wallet broadcasts that tx — Compass does not
        broadcast.
      example:
        amount_raw: 1000000000
        destination: '0x1F31bAad9e2adC1Dc8B0FF8B0c2cF7D0e7d1A8c9'
        permit:
          domain:
            chainId: 42161
            name: USD Coin
            verifyingContract: '0xaf88d065e77c8cC2239327C5EDb3A432268e5831'
            version: '2'
          message:
            deadline: '1747097383'
            nonce: '5'
            owner: '0x1F31bAad9e2adC1Dc8B0FF8B0c2cF7D0e7d1A8c9'
            spender: '0x2Df1c51E09aECF9cacB7bc98cB1742757f163dF7'
            value: '1000000000'
          primaryType: Permit
          types:
            Permit:
              - name: owner
                type: address
              - name: spender
                type: address
              - name: value
                type: uint256
              - name: nonce
                type: uint256
              - name: deadline
                type: uint256
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    PermitTypedDataResponse-Output:
      properties:
        domain:
          $ref: >-
            #/components/schemas/compass__api_backend__v2__models__gas_sponsorship__permit_typed_data__EIP712Domain
          description: EIP-712 domain separator
        types:
          $ref: >-
            #/components/schemas/compass__api_backend__v2__models__gas_sponsorship__permit_typed_data__EIP712Types
          description: EIP-712 type definitions
        primaryType:
          type: string
          const: Permit
          title: Primarytype
          description: Primary type for the structured data
        message:
          $ref: '#/components/schemas/PermitMessage'
          description: Permit message data
      type: object
      required:
        - domain
        - types
        - primaryType
        - message
      title: PermitTypedDataResponse
      description: Response containing EIP-712 typed data for ERC-20 Permit signing.
      example:
        domain:
          chainId: 8453
          name: USD Coin
          verifyingContract: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913'
          version: '2'
        message:
          deadline: '1735689600'
          nonce: '0'
          owner: '0x4A83b4413CF41C3244027e1590E35a0F48403F0c'
          spender: '0x6B90E8B4E3E971E74C1A47a3a20976377E2dB4b1'
          value: '100000000'
        primaryType: Permit
        types:
          EIP712Domain:
            - name: name
              type: string
            - name: version
              type: string
            - name: chainId
              type: uint256
            - name: verifyingContract
              type: address
          Permit:
            - name: owner
              type: address
            - name: spender
              type: address
            - name: value
              type: uint256
            - name: nonce
              type: uint256
            - name: deadline
              type: uint256
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    compass__api_backend__v2__models__gas_sponsorship__permit_typed_data__EIP712Domain:
      properties:
        name:
          type: string
          title: Name
          description: Token name
        version:
          type: string
          title: Version
          description: Token version (usually '1' or '2')
        chainId:
          type: integer
          title: Chainid
          description: Chain ID
        verifyingContract:
          type: string
          title: Verifyingcontract
          description: Token contract address
      type: object
      required:
        - name
        - version
        - chainId
        - verifyingContract
      title: EIP712Domain
      description: The EIP-712 domain separator for ERC-20 Permit.
    compass__api_backend__v2__models__gas_sponsorship__permit_typed_data__EIP712Types:
      properties:
        EIP712Domain:
          items:
            $ref: '#/components/schemas/EIP712DomainField'
          type: array
          title: Eip712Domain
          description: EIP712Domain type definition
        Permit:
          items:
            $ref: '#/components/schemas/PermitField'
          type: array
          title: Permit
          description: Permit type definition
      type: object
      required:
        - EIP712Domain
        - Permit
      title: EIP712Types
      description: The type definitions for EIP-712 structured data (ERC-20 Permit).
    PermitMessage:
      properties:
        owner:
          type: string
          title: Owner
          description: Token owner address
        spender:
          type: string
          title: Spender
          description: Address authorized to spend tokens
        value:
          type: string
          title: Value
          description: Amount to approve (as string)
        nonce:
          type: string
          title: Nonce
          description: Current permit nonce for the owner
        deadline:
          type: string
          title: Deadline
          description: Permit expiry timestamp
      type: object
      required:
        - owner
        - spender
        - value
        - nonce
        - deadline
      title: PermitMessage
      description: The message data for an ERC-20 Permit.
    EIP712DomainField:
      properties:
        name:
          type: string
          title: Name
        type:
          type: string
          title: Type
      type: object
      required:
        - name
        - type
      title: EIP712DomainField
      description: A field in the EIP712Domain type definition.
    PermitField:
      properties:
        name:
          type: string
          title: Name
        type:
          type: string
          title: Type
      type: object
      required:
        - name
        - type
      title: PermitField
      description: A field in the Permit type definition.
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        Your Compass API Key. Get your key
        [here](https://www.compasslabs.ai/dashboard).

````