Generate a counterfactual deposit address

Returns a counterfactual deposit address that the user can send funds to in order to initiate a crosschain transfer. This address is deterministically computed based on the swap parameters. The user sends the input token to this address on the origin chain, and Across handles the crosschain transfer to the recipient on the destination chain. The response includes the deposit address, token details, and an optional swap transaction that must be executed before sending funds (e.g. for token approvals or wrapping). Note: Ethereum, Base and Arbitrum are the only supported origin chains and HyperEVM/HyperCore are the supported destination chains for now.

GET
/swap/counterfactual

Authorization

bearerAuth
AuthorizationBearer <token>

API key for authentication. Request your key at https://t.me/acrosstg.

In: header

Query Parameters

useDepositAddress*boolean

Must be set to true to use the deposit address flow.

Value intrue
inputToken*string

Contract address of the token to send on the origin chain.

outputToken*string

Contract address of the token to receive on the destination chain.

originChainId*integer

Chain ID of the origin chain where funds are sent.

Range1 <= value
Value in1 | 8453 | 42161
destinationChainId*integer

Chain ID of the destination chain where funds are received.

Range1 <= value
Value in999 | 1337
amount*string

Amount of input token to send, in the token's smallest unit (wei).

recipient*string

Address that will receive the output token on the destination chain.

refundAddress*string

Address to receive a refund on the origin chain if the deposit expires.

integratorId?string

2-byte hex-string that identifies the integrator. E.g., "0xdead".

Response Body

application/json

application/json

application/json

application/json

curl -X GET "https://app.across.to/api/swap/counterfactual?useDepositAddress=true&inputToken=0xaf88d065e77c8cC2239327C5EDb3A432268e5831&outputToken=0xb88339CB7199b77E23DB6E890353E22632Ba630f&originChainId=42161&destinationChainId=999&amount=1000000&recipient=0x3cA3451C40ECFb5Ecd05AEf33AD60BA8F03c238B&refundAddress=0x3cA3451C40ECFb5Ecd05AEf33AD60BA8F03c238B&integratorId=0xdead"
{
  "crossSwapType": "bridgeableToBridgeable",
  "amountType": "exactInput",
  "checks": {
    "allowance": {
      "token": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
      "spender": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
      "actual": "0",
      "expected": "1000000"
    },
    "balance": {
      "token": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
      "actual": "0",
      "expected": "1000000"
    }
  },
  "steps": {
    "bridge": {
      "inputAmount": "1000000",
      "outputAmount": "996878",
      "tokenIn": {
        "decimals": 6,
        "symbol": "USDC",
        "address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
        "name": "USD Coin",
        "chainId": 1
      },
      "tokenOut": {
        "decimals": 6,
        "symbol": "USDC",
        "address": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
        "name": "USD Coin",
        "chainId": 8453
      },
      "fees": {
        "amount": "3122",
        "pct": "3122000000000000",
        "token": {
          "decimals": 6,
          "symbol": "USDC",
          "address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
          "name": "USD Coin",
          "chainId": 1
        },
        "details": {
          "type": "across",
          "relayerCapital": {
            "amount": "100",
            "pct": "100000000000000",
            "token": {
              "decimals": 6,
              "symbol": "USDC",
              "address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
              "name": "USD Coin",
              "chainId": 1
            }
          },
          "destinationGas": {
            "amount": "3022",
            "pct": "3022000000000000",
            "token": {
              "decimals": 6,
              "symbol": "USDC",
              "address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
              "name": "USD Coin",
              "chainId": 1
            }
          },
          "lp": {
            "amount": "0",
            "pct": "0",
            "token": {
              "decimals": 6,
              "symbol": "USDC",
              "address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
              "name": "USD Coin",
              "chainId": 1
            }
          }
        }
      },
      "provider": "across"
    }
  },
  "inputToken": {
    "decimals": 6,
    "symbol": "USDC",
    "address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
    "name": "USD Coin",
    "chainId": 1
  },
  "outputToken": {
    "decimals": 6,
    "symbol": "USDC",
    "address": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
    "name": "USD Coin",
    "chainId": 8453
  },
  "refundToken": {
    "decimals": 6,
    "symbol": "USDC",
    "address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
    "name": "USD Coin",
    "chainId": 1
  },
  "fees": {
    "total": {
      "amount": "3100",
      "amountUsd": "0.0031",
      "token": {
        "decimals": 6,
        "symbol": "USDC",
        "address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
        "name": "USD Coin",
        "chainId": 1
      },
      "pct": "3100480574489046",
      "details": {
        "type": "total-breakdown",
        "swapImpact": {
          "amount": "-21",
          "amountUsd": "-0.00002151609",
          "token": {
            "decimals": 6,
            "symbol": "USDC",
            "address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
            "name": "USD Coin",
            "chainId": 1
          },
          "pct": "-21519425510954"
        },
        "app": {
          "amount": "0",
          "amountUsd": "0.0",
          "token": {
            "decimals": 6,
            "symbol": "USDC",
            "address": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
            "name": "USD Coin",
            "chainId": 8453
          },
          "pct": "0"
        },
        "bridge": {
          "amount": "3122",
          "amountUsd": "0.00312151609",
          "token": {
            "decimals": 6,
            "symbol": "USDC",
            "address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
            "name": "USD Coin",
            "chainId": 1
          },
          "pct": "3122000000000000",
          "details": {
            "type": "across",
            "lp": {
              "amount": "0",
              "amountUsd": "0.0",
              "token": {
                "decimals": 6,
                "symbol": "USDC",
                "address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
                "name": "USD Coin",
                "chainId": 1
              },
              "pct": "0"
            },
            "relayerCapital": {
              "amount": "100",
              "amountUsd": "0.0000999845",
              "token": {
                "decimals": 6,
                "symbol": "USDC",
                "address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
                "name": "USD Coin",
                "chainId": 1
              },
              "pct": "100000000000000"
            },
            "destinationGas": {
              "amount": "1367388295297",
              "amountUsd": "0.00302153159",
              "token": {
                "chainId": 8453,
                "address": "0x0000000000000000000000000000000000000000",
                "decimals": 18,
                "symbol": "ETH"
              },
              "pct": "3022000000000000"
            }
          }
        }
      }
    },
    "totalMax": {
      "amount": "3100",
      "amountUsd": "0.0031",
      "token": {
        "decimals": 6,
        "symbol": "USDC",
        "address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
        "name": "USD Coin",
        "chainId": 1
      },
      "pct": "3100480574489046",
      "details": {
        "type": "max-total-breakdown",
        "maxSwapImpact": {
          "amount": "-21",
          "amountUsd": "-0.00002151609",
          "token": {
            "decimals": 6,
            "symbol": "USDC",
            "address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
            "name": "USD Coin",
            "chainId": 1
          },
          "pct": "-21519425510954"
        },
        "app": {
          "amount": "0",
          "amountUsd": "0.0",
          "token": {
            "decimals": 6,
            "symbol": "USDC",
            "address": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
            "name": "USD Coin",
            "chainId": 8453
          },
          "pct": "0"
        },
        "bridge": {
          "amount": "3122",
          "amountUsd": "0.00312151609",
          "token": {
            "decimals": 6,
            "symbol": "USDC",
            "address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
            "name": "USD Coin",
            "chainId": 1
          },
          "pct": "3122000000000000",
          "details": {
            "type": "across",
            "lp": {
              "amount": "0",
              "amountUsd": "0.0",
              "token": {
                "decimals": 6,
                "symbol": "USDC",
                "address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
                "name": "USD Coin",
                "chainId": 1
              },
              "pct": "0"
            },
            "relayerCapital": {
              "amount": "100",
              "amountUsd": "0.0000999845",
              "token": {
                "decimals": 6,
                "symbol": "USDC",
                "address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
                "name": "USD Coin",
                "chainId": 1
              },
              "pct": "100000000000000"
            },
            "destinationGas": {
              "amount": "1367388295297",
              "amountUsd": "0.00302153159",
              "token": {
                "chainId": 8453,
                "address": "0x0000000000000000000000000000000000000000",
                "decimals": 18,
                "symbol": "ETH"
              },
              "pct": "3022000000000000"
            }
          }
        }
      }
    },
    "originGas": {
      "amount": "0",
      "amountUsd": "0.0",
      "token": {
        "chainId": 1,
        "address": "0x0000000000000000000000000000000000000000",
        "decimals": 18,
        "symbol": "ETH"
      }
    }
  },
  "inputAmount": "1000000",
  "maxInputAmount": "1000000",
  "expectedOutputAmount": "996878",
  "minOutputAmount": "996878",
  "expectedFillTime": 3,
  "swapTx": {
    "ecosystem": "evm",
    "simulationSuccess": true,
    "chainId": 1,
    "to": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
    "data": "0xa9059cbb000000000000000000000000ac3bc972c2bbb35d6e9ff991bc0dcac14f578a2200000000000000000000000000000000000000000000000000000000000f4240",
    "value": "0",
    "gas": "0"
  },
  "quoteExpiryTimestamp": 1775831987,
  "depositAddress": "0xAc3Bc972c2Bbb35d6E9FF991BC0dCAC14F578a22",
  "expiresAt": "2026-04-11T13:44:15.790Z",
  "ttl": 86400,
  "salt": "0xd999cb547bcb4e3259319ef3cb8cefac879d0ca1835a0429735107311eb64e03",
  "merkleRoot": "0x2c5d803f38a162829204d077941ea57a133f655099a510f6d195db1a70624982",
  "factoryAddress": "0x9cd343b1ce2798bfdc09debc83f9cbfad4a22772",
  "implementation": "0x116e1f29138b0a6417189ffdf4a17de223ae27c7",
  "leaves": {
    "cctp": {
      "hash": "0x998f22540bdbf1a1a490d1786241dc18a67564322e26e4cbcbb7c87f28283187",
      "implAddress": "0x50597a4426c6321c054cbf880f6bb4a8169082c8",
      "encodedParams": "0x00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000006000000000000000000000000d9dc78b969e9efb1e54b625c33a21aaf2509e6a1000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48000000000000000000000000d9dc78b969e9efb1e54b625c33a21aaf2509e6a1000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000003e8000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000000000000000000000000000003ca3451c40ecfb5ecd05aef33ad60ba8f03c238b000000000000000000000000833589fcd6edb6e08f4c7c32d4f71b54bda0291300000000000000000000000000000000000000000000000000000000ffffffff0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
      "abiType": "tuple(uint32 destinationDomain, bytes32 mintRecipient, bytes32 burnToken, bytes32 destinationCaller, uint256 cctpMaxFeeBps, uint32 minFinalityThreshold, uint256 maxBpsToSponsor, uint256 maxUserSlippageBps, bytes32 finalRecipient, bytes32 finalToken, uint32 destinationDex, uint8 accountCreationMode, uint8 executionMode, bytes actionData, uint256 executionFee)",
      "params": {
        "destinationDomain": 6,
        "mintRecipient": "0x000000000000000000000000d9dc78b969e9efb1e54b625c33a21aaf2509e6a1",
        "burnToken": "0x000000000000000000000000A0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
        "destinationCaller": "0x000000000000000000000000d9dc78b969e9efb1e54b625c33a21aaf2509e6a1",
        "cctpMaxFeeBps": "1",
        "minFinalityThreshold": 1000,
        "maxBpsToSponsor": "5",
        "maxUserSlippageBps": "0",
        "finalRecipient": "0x0000000000000000000000003cA3451C40ECFb5Ecd05AEf33AD60BA8F03c238B",
        "finalToken": "0x000000000000000000000000833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
        "destinationDex": 4294967295,
        "accountCreationMode": 1,
        "executionMode": 0,
        "actionData": "0x",
        "executionFee": "0"
      },
      "merkleProof": [
        "0x1fbbda592b5cd8d0964b6037062191c6064c8e97f49f0603a73e798ba7c57bd7"
      ]
    },
    "spokePool": {
      "hash": "0x5f24e0ba12b31073fd469be7ae5e844b54d7367a858a4cd5fcb86a64415c52bd",
      "implAddress": "0xc7b1662674b2226ce7943162f655897a40699ff9",
      "encodedParams": "0x00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000002105000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48000000000000000000000000833589fcd6edb6e08f4c7c32d4f71b54bda029130000000000000000000000003ca3451c40ecfb5ecd05aef33ad60ba8f03c238b00000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000de0b6b3a7640000000000000000000000000000000000000000000000000000000000000098968000000000000000000000000000000000000000000000000000000000000001f400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
      "abiType": "tuple(uint256 destinationChainId, bytes32 inputToken, bytes32 outputToken, bytes32 recipient, bytes message, uint256 stableExchangeRate, uint256 maxFeeFixed, uint256 maxFeeBps, uint256 executionFee)",
      "params": {
        "destinationChainId": "8453",
        "inputToken": "0x000000000000000000000000A0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
        "outputToken": "0x000000000000000000000000833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
        "recipient": "0x0000000000000000000000003cA3451C40ECFb5Ecd05AEf33AD60BA8F03c238B",
        "message": "0x",
        "stableExchangeRate": "1000000000000000000",
        "maxFeeFixed": "10000000",
        "maxFeeBps": "500",
        "executionFee": "0"
      },
      "merkleProof": [
        "0x0feac6ceb2b7afe2b3fb358335c733e742ed16271818d80add352e06caff2e7f",
        "0x998f22540bdbf1a1a490d1786241dc18a67564322e26e4cbcbb7c87f28283187"
      ]
    },
    "withdraw": {
      "hash": "0x0feac6ceb2b7afe2b3fb358335c733e742ed16271818d80add352e06caff2e7f",
      "implAddress": "0x679d43e1d304001538bf083d421484fd67c00a45",
      "encodedParams": "0x000000000000000000000000e7de86ecd99918384fcba79eaef23efaaf10e43e0000000000000000000000003ca3451c40ecfb5ecd05aef33ad60ba8f03c238b",
      "abiType": "tuple(address admin, address user)",
      "params": {
        "admin": "0xe7de86ecd99918384fcba79eaef23efaaf10e43e",
        "user": "0x3cA3451C40ECFb5Ecd05AEf33AD60BA8F03c238B"
      },
      "merkleProof": [
        "0x5f24e0ba12b31073fd469be7ae5e844b54d7367a858a4cd5fcb86a64415c52bd",
        "0x998f22540bdbf1a1a490d1786241dc18a67564322e26e4cbcbb7c87f28283187"
      ]
    }
  },
  "id": "znq4r-1775828648649-10338c845dcb"
}
{
  "type": "AcrossApiError",
  "code": "INVALID_PARAM",
  "status": 400,
  "message": "Invalid parameter"
}
{
  "type": "AcrossApiError",
  "code": "FORBIDDEN_API_KEY",
  "status": 403,
  "message": "Invalid or missing API key",
  "id": "hxlzg-1774404706014-af527ab9002e"
}
{
  "type": "AcrossApiError",
  "code": "INTERNAL_SERVER_ERROR",
  "status": 500,
  "message": "Internal server error"
}