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

# Generate trade presign data

> Returns the EIP-712 Permit2 payload that the maker must sign for a trade.



## OpenAPI

````yaml openapi/stablefx.yaml get /v1/exchange/stablefx/signatures/presign/{tradeId}
openapi: 3.1.0
info:
  title: StableFX API
  description: >
    The StableFX API provides endpoints for trading stablecoins.


    ## Authentication

    All API requests require authentication using an API key.


    ## Base URL

    The base URL for all API endpoints is:
    `https://api.circle.com/v1/exchange/stablefx`
  version: 1.0.0
servers:
  - url: https://api.circle.com
    description: StableFX API server
security:
  - BearerAuth: []
tags:
  - name: Quotes
    description: Endpoints for creating and managing quotes
  - name: Trades
    description: Endpoints for creating and managing trades
  - name: Signatures
    description: Endpoints for retrieving presign typed data and registering signatures
  - name: Fees
    description: Endpoints for retrieving fees
  - name: Funding
    description: Endpoints for funding trades
  - name: Webhook Subscriptions
    description: Manage subscriptions to notifications
  - name: Settlement Advance
    description: Request, track, and repay settlement advances.
paths:
  /v1/exchange/stablefx/signatures/presign/{tradeId}:
    get:
      tags:
        - Signatures
      summary: Generate trade presign data
      description: >-
        Returns the EIP-712 Permit2 payload that the maker must sign for a
        trade.
      operationId: generateTradeSignatureData
      parameters:
        - in: path
          name: tradeId
          required: true
          description: The ID of the trade.
          schema:
            $ref: '#/components/schemas/Id'
        - in: query
          name: recipientAddress
          required: true
          description: The address of the recipient of the settlement tokens.
          schema:
            $ref: '#/components/schemas/BlockchainAddress'
      responses:
        '200':
          description: Signature data generated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TradePresignData'
      security:
        - BearerAuth: []
components:
  schemas:
    Id:
      type: string
      format: uuid
      description: System-generated unique identifier of the resource.
      example: c4d1da72-111e-4d52-bdbf-2e74a2d803d5
    BlockchainAddress:
      type: string
      description: A blockchain address
      example: '0x1234567890abcdef1234567890abcdef12345678'
    TradePresignData:
      type: object
      description: Permit2 EIP-712 Typed Data for Trade Registration
      required:
        - typedData
      properties:
        typedData:
          $ref: '#/components/schemas/TradeTypedData'
    TradeTypedData:
      type: object
      description: EIP-712 typed data for trade registration
      required:
        - domain
        - types
        - primaryType
        - message
      properties:
        domain:
          $ref: '#/components/schemas/Permit2EIP712Domain'
        types:
          type: object
          description: EIP-712 types definition
          required:
            - EIP712Domain
            - Consideration
          properties:
            EIP712Domain:
              type: array
              items:
                type: object
                properties:
                  name:
                    type: string
                  type:
                    type: string
            Consideration:
              type: array
              items:
                type: object
                properties:
                  name:
                    type: string
                  type:
                    type: string
            TraderDetails:
              type: array
              description: >-
                Type definition for trader (maker or taker) trades. Replaces the
                legacy TakerDetails and MakerDetails type definitions and adds
                the `authorizer` field.
              items:
                type: object
                properties:
                  name:
                    type: string
                  type:
                    type: string
              example:
                - name: consideration
                  type: Consideration
                - name: recipient
                  type: address
                - name: fee
                  type: uint256
                - name: authorizer
                  type: address
            TokenPermissions:
              type: array
              description: Type definition for token permissions
              items:
                type: object
                properties:
                  name:
                    type: string
                  type:
                    type: string
            PermitWitnessTransferFrom:
              type: array
              description: Type definition for permit witness transfer
              items:
                type: object
                properties:
                  name:
                    type: string
                  type:
                    type: string
        primaryType:
          type: string
          description: The primary type for the EIP-712 data to be signed
          enum:
            - PermitWitnessTransferFrom
          example: PermitWitnessTransferFrom
        message:
          $ref: '#/components/schemas/TradePermit2Message'
    Permit2EIP712Domain:
      type: object
      description: Permit2 EIP-712 domain separator
      required:
        - name
        - chainId
        - verifyingContract
      properties:
        name:
          type: string
          description: The name of the signing domain
          example: Permit2
        chainId:
          type: integer
          description: The chain ID of the network
          example: 11155111
        verifyingContract:
          type: string
          description: The address of the verifying contract
          example: '0xffd21ca8F0876DaFAD7de09404E0c1f868bbf1AE'
    TradePermit2Message:
      type: object
      description: The Permit2 message for trade registration
      required:
        - permitted
        - spender
        - nonce
        - deadline
        - witness
      properties:
        permitted:
          type: object
          description: Token permission details
          required:
            - token
            - amount
          properties:
            token:
              type: string
              description: The address of the token to be funded
              example: '0x3600000000000000000000000000000000000000'
            amount:
              type: string
              description: >-
                The prefunded risk buffer amount of tokens to be funded, as a
                string representation of a uint256
              example: '429000000'
        spender:
          type: string
          description: The address of the StableFX contract
          example: '0xa8f94168b4981840ba27d423f4ad6332bedee006'
        nonce:
          type: string
          description: >-
            A unique nonce for the signature to prevent replay attacks, as a
            string representation of a uint256
          example: '309585810'
        deadline:
          type: string
          format: epoch
          description: >-
            The validity period for the signature in epoch seconds, as a string
            representation of a uint256
          example: '1770302983'
        witness:
          type: object
          description: Witness data containing trade details
          required:
            - consideration
            - fee
            - authorizer
          properties:
            consideration:
              $ref: '#/components/schemas/TradeSignatureConsideration'
            recipient:
              type:
                - string
                - 'null'
              description: >-
                The address of the recipient of the trade. Only included in
                taker trades, null for maker trades.
              example: '0x1f531ce3c418bbd830d06138a9e5b5eacfdfb3d6'
            fee:
              type: string
              description: The fee for the trade, as a string representation of a uint256
              example: '80000'
            authorizer:
              type: string
              description: >-
                The authorizer is the address of the entity that authorizes the
                trade. For StableFX this does not need to be set and defaults to
                the zero-address sentinel.
              example: '0x0000000000000000000000000000000000000000'
    TradeSignatureConsideration:
      type: object
      description: EIP-712 typed data for a StableFX trade created from a quote.
      properties:
        quoteId:
          type: string
        base:
          type: string
        quote:
          type: string
        baseAmount:
          type: string
        quoteAmount:
          type: string
        maturity:
          type: string
          format: epoch
          description: >-
            The settlement maturity timestamp for the trade, as a string
            representation of a uint256
          example: '1716153600'
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: PREFIX:ID:SECRET
      description: >-
        Circle's API Keys are formatted in the following structure
        "PREFIX:ID:SECRET". All three parts are requred to make a successful
        request.

````