> ## 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.

# Build the Bridge2 deposit tx from a signed permit

> Build the Arbitrum tx that completes a USDC deposit to HL.

Takes the EIP-2612 permit signature returned by /deposit and returns
a fully-encoded `Bridge2.batchedDepositWithPermit` call. The integrator's
sponsor wallet (`sender`) broadcasts the returned tx — Compass does not
broadcast and does not hold gas keys.



## OpenAPI

````yaml /v2/combined_spec.json post /v2/global_markets_perps/deposit/sponsor_prepare
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/global_markets_perps/deposit/sponsor_prepare:
    post:
      tags:
        - Global Markets Perps
      summary: Build the Bridge2 deposit tx from a signed permit
      description: >-
        Build the Arbitrum tx that completes a USDC deposit to HL.


        Takes the EIP-2612 permit signature returned by /deposit and returns

        a fully-encoded `Bridge2.batchedDepositWithPermit` call. The
        integrator's

        sponsor wallet (`sender`) broadcasts the returned tx — Compass does not

        broadcast and does not hold gas keys.
      operationId: v2_global_markets_perps_deposit_sponsor_prepare
      requestBody:
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/GlobalMarketsPerpsDepositSponsorPrepareRequest
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/GlobalMarketsPerpsDepositSponsorPrepareResponse
        '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.global_markets_perps.global_markets_perps_deposit_sponsor_prepare(owner="0x06A9aF046187895AcFc7258450B15397CAc67400", amount_raw=100000000, deadline=1747097383, signature="0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", sender="0x4A83b4413CF41C3244027e1590E35a0F48403F0c")

                # 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.globalMarketsPerps.globalMarketsPerpsDepositSponsorPrepare({
                owner: "0x06A9aF046187895AcFc7258450B15397CAc67400",
                amountRaw: 100000000,
                deadline: 1747097383,
                signature: "0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
                sender: "0x4A83b4413CF41C3244027e1590E35a0F48403F0c",
              });

              console.log(result);
            }

            run();
components:
  schemas:
    GlobalMarketsPerpsDepositSponsorPrepareRequest:
      properties:
        owner:
          type: string
          title: Owner
          description: The user's EOA address on Arbitrum (the permit signer).
          default: '0x06A9aF046187895AcFc7258450B15397CAc67400'
          examples:
            - '0x06A9aF046187895AcFc7258450B15397CAc67400'
        amount_raw:
          type: integer
          exclusiveMinimum: 0
          title: Amount Raw
          description: USDC amount in raw 6-decimal units, as returned by /deposit.
          default: 100000000
          examples:
            - 100000000
        deadline:
          type: integer
          exclusiveMinimum: 0
          title: Deadline
          description: >-
            Permit deadline (unix seconds), as returned in the permit.message
            from /deposit.
          default: 1747097383
          examples:
            - 1747097383
        signature:
          type: string
          title: Signature
          description: >-
            The user's EIP-2612 permit signature (65-byte hex, 0x-prefixed or
            raw).
          default: >-
            0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
          examples:
            - >-
              0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
        sender:
          type: string
          title: Sender
          description: >-
            Sponsor wallet address that will broadcast the returned tx (used for
            `from` and nonce).
          default: '0x4A83b4413CF41C3244027e1590E35a0F48403F0c'
          examples:
            - '0x4A83b4413CF41C3244027e1590E35a0F48403F0c'
      type: object
      required:
        - owner
        - amount_raw
        - deadline
        - signature
        - sender
      title: GlobalMarketsPerpsDepositSponsorPrepareRequest
      description: |-
        Take a user's signed EIP-2612 USDC permit and build an Arbitrum tx
        that calls Bridge2.batchedDepositWithPermit.

        The customer broadcasts the returned tx from their own sponsor wallet —
        Compass does not hold gas keys (non-custodial).
      default:
        owner: '0x06A9aF046187895AcFc7258450B15397CAc67400'
        amount_raw: 100000000
        deadline: 1747097383
        signature: >-
          0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
        sender: '0x4A83b4413CF41C3244027e1590E35a0F48403F0c'
    GlobalMarketsPerpsDepositSponsorPrepareResponse:
      properties:
        transaction:
          $ref: '#/components/schemas/UnsignedTransaction'
          description: >-
            Unsigned Arbitrum tx calling Bridge2.batchedDepositWithPermit. Sign
            and broadcast from `sender`.
      type: object
      required:
        - transaction
      title: GlobalMarketsPerpsDepositSponsorPrepareResponse
      description: >-
        Fully-encoded Arbitrum tx that completes a HL Bridge2 deposit.


        Broadcast `transaction` from the `sender` wallet supplied in the
        request.

        After the receipt confirms, verify a USDC `Transfer` event was emitted —

        Bridge2 can silently no-op without reverting.
      example:
        transaction:
          chainId: '0xa4b1'
          data: 0x...
          from: '0x4A83b4413CF41C3244027e1590E35a0F48403F0c'
          gas: '0x30d40'
          maxFeePerGas: '0x59682f00'
          maxPriorityFeePerGas: '0x3b9aca00'
          nonce: '0x5'
          to: '0x2Df1c51E09aECF9cacB7bc98cB1742757f163dF7'
          value: '0x0'
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    UnsignedTransaction:
      properties:
        chainId:
          type: string
          title: Chainid
          description: The chain id of the transaction
        data:
          type: string
          title: Data
          description: The data of the transaction
        from:
          type: string
          title: From
          description: The sender of the transaction
        gas:
          anyOf:
            - type: string
            - type: 'null'
          title: Gas
          description: The gas of the transaction
        to:
          type: string
          title: To
          description: The recipient of the transaction
        value:
          type: string
          title: Value
          description: The value of the transaction
        nonce:
          type: string
          title: Nonce
          description: The nonce of the address
        maxFeePerGas:
          type: string
          title: Maxfeepergas
          description: The max fee per gas of the transaction
        maxPriorityFeePerGas:
          type: string
          title: Maxpriorityfeepergas
          description: The max priority fee per gas of the transaction
      type: object
      required:
        - chainId
        - data
        - from
        - gas
        - to
        - value
        - nonce
        - maxFeePerGas
        - maxPriorityFeePerGas
      title: UnsignedTransaction
      example:
        chainId: '0x2105'
        data: >-
          0x1688f0b900000000000000000000000029fcb43b46531bca003ddc8fcb67ffe91900c762000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000675f4a3d
        from: '0x4A83b4413CF41C3244027e1590E35a0F48403F0c'
        gas: '0x7a120'
        maxFeePerGas: '0x59682f00'
        maxPriorityFeePerGas: '0x3b9aca00'
        nonce: '0x5'
        to: '0x4e1DCf7AD4e460CfD30791CCC4F9c8a4f820ec67'
        value: '0x0'
    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
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        Your Compass API Key. Get your key
        [here](https://www.compasslabs.ai/dashboard).

````