Skip to main content
POST
/
v1
/
exchange
/
stablefx
/
signatures
/
funding
/
presign
Generate funding presign data
curl --request POST \
  --url https://api.circle.com/v1/exchange/stablefx/signatures/funding/presign \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "contractTradeIds": [
    "10",
    "11",
    "12"
  ],
  "fundingMode": "gross",
  "funderAddress": "0x1234567890abcdef1234567890abcdef12345678",
  "recipientAddress": "0xabcdef1234567890abcdef1234567890abcdef12"
}
'
{
  "deliverables": [
    {
      "amount": "100.00"
    }
  ],
  "receivables": [
    {
      "amount": "100.00"
    }
  ],
  "typedData": {
    "domain": {
      "name": "Permit2",
      "chainId": 11155111,
      "verifyingContract": "0xffd21ca8F0876DaFAD7de09404E0c1f868bbf1AE"
    },
    "types": {
      "EIP712Domain": [
        {
          "name": "name",
          "type": "string"
        },
        {
          "name": "chainId",
          "type": "uint256"
        },
        {
          "name": "verifyingContract",
          "type": "address"
        }
      ],
      "TokenPermissions": [
        {
          "name": "token",
          "type": "address"
        },
        {
          "name": "amount",
          "type": "uint256"
        }
      ],
      "SingleTradeWitness": [
        {
          "name": "id",
          "type": "uint256"
        }
      ],
      "PermitWitnessTransferFrom": [
        {
          "name": "permitted",
          "type": "TokenPermissions"
        },
        {
          "name": "spender",
          "type": "address"
        },
        {
          "name": "nonce",
          "type": "uint256"
        },
        {
          "name": "deadline",
          "type": "uint256"
        },
        {
          "name": "witness",
          "type": "SingleTradeWitness"
        }
      ]
    },
    "primaryType": "PermitWitnessTransferFrom",
    "message": {
      "permitted": {
        "token": "0xTOKEN",
        "amount": "1000"
      },
      "spender": "0xffd21ca8F0876DaFAD7de09404E0c1f868bbf1AE",
      "nonce": 42,
      "deadline": 1735689600,
      "witness": {
        "id": "10"
      }
    }
  }
}

Authorizations

Authorization
string
header
required

Circle's API Keys are formatted in the following structure "PREFIX:ID:SECRET". All three parts are requred to make a successful request.

Body

application/json

Request body for generating funding presign data

contractTradeIds
string[]
required

List of contract trade IDs. Exactly one contract trade ID is supported when fundingMode is delegate.

Minimum array length: 1
Example:
["10", "11", "12"]
type
enum<string>
required

The type of trader.

Available options:
maker,
taker
fundingMode
enum<string>
default:gross

Funding mode for the presign request. net is supported for maker funding requests only; delegate is supported for both maker and taker.

Available options:
gross,
net,
delegate
funderAddress
string

Address of the funder wallet that will deliver tokens on the trader's behalf. Required when fundingMode is delegate.

Example:

"0x1234567890abcdef1234567890abcdef12345678"

recipientAddress
string

Address that receives the delivered tokens. Required when fundingMode is delegate.

Example:

"0xabcdef1234567890abcdef1234567890abcdef12"

Response

200 - application/json

Funding presign data generated successfully

Response containing Permit2 EIP-712 typed data for funding operations. For gross and net funding modes, contains the trader's Permit2 typed data along with deliverables and receivables. For delegate funding mode, contains separate typed-data payloads for the trader and the funder. No discriminator is defined because the response body carries no fundingMode field; the variant is determined by the fundingMode sent in the request, and the two variants have mutually exclusive required properties.

deliverables
object[]
required

Aggregated assets that the trader needs to deliver.

receivables
object[]
required

Aggregated assets that the trader expects to receive after fee deduction.

typedData
object
required

EIP-712 typed data structure for single Permit2 transfer