Working with HyperCore

This guide provides a comprehensive overview for developers on how to use the Across Swap API to bridge USDT-SPOT to/from HyperCore, integrated via HyperEVM. We will be focusing on how using the Swap API abstracts away all complexities to ensure a smooth developer and user experience.

Important Parameters for the Swap API Call

To bridge USDT-SPOT to/from HyperCore, you make a standard call to the /swap/approval endpoint. The key is to specify HyperCore destinationChainId: 1337 and USDT-SPOT outputToken: 0x200000000000000000000000000000000000010C in the destination parameters.

While using the GET /swap/chains endpoint, you will see HyperCore listed with chainId: 1337 .

Next up, we will look at 2 major use cases of the /swap/approval call while working with HyperCore.

From any EVM chain (like Arbitrum) to HyperCore

https://app.across.to/api/swap/approval?
tradeType=exactInput&
inputToken=0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9&
originChainId=42161& // arbitrum
outputToken=0x200000000000000000000000000000000000010C& // USDT-SPOT
destinationChainId=1337& // HyperCore
depositor=0x9A8f92a830A5cB89a3816e3D267CB7791c16b04D&
amount=1000000
Output
{
  "crossSwapType": "bridgeableToBridgeableIndirect",
  "amountType": "exactInput",
  "checks": {
    "allowance": {
      "token": "0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9",
      "spender": "0xe35e9842fceaCA96570B734083f4a58e8F7C5f2A",
      "actual": "115792089237316195423570985008687907853269984665640564039457584007807744139935",
      "expected": "1000000"
    },
    "balance": {
      "token": "0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9",
      "actual": "12607096",
      "expected": "1000000"
    }
  },
  "steps": {
    "bridge": {
      "inputAmount": "1000000",
      "outputAmount": "998773",
      "tokenIn": {
        "decimals": 6,
        "symbol": "USDT",
        "address": "0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9",
        "name": "Tether USD",
        "chainId": 42161
      },
      "tokenOut": {
        "symbol": "USDT",
        "name": "Tether USD",
        "decimals": 6,
        "address": "0xB8CE59FC3717ada4C02eaDF9682A9e934F625ebb",
        "chainId": 999,
        "coingeckoId": "tether"
      },
      "fees": {
        "totalRelay": {
          "total": "1227",
          "pct": "1227000000000000",
          "token": {
            "decimals": 6,
            "symbol": "USDT",
            "address": "0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9",
            "name": "Tether USD",
            "chainId": 42161
          }
        },
        "relayerCapital": {
          "total": "100",
          "pct": "100000000000000",
          "token": {
            "decimals": 6,
            "symbol": "USDT",
            "address": "0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9",
            "name": "Tether USD",
            "chainId": 42161
          }
        },
        "relayerGas": {
          "total": "1127",
          "pct": "1127000000000000",
          "token": {
            "decimals": 6,
            "symbol": "USDT",
            "address": "0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9",
            "name": "Tether USD",
            "chainId": 42161
          }
        },
        "lp": {
          "total": "0",
          "pct": "0",
          "token": {
            "decimals": 6,
            "symbol": "USDT",
            "address": "0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9",
            "name": "Tether USD",
            "chainId": 42161
          }
        }
      }
    }
  },
  "inputToken": {
    "decimals": 6,
    "symbol": "USDT",
    "address": "0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9",
    "name": "Tether USD",
    "chainId": 42161
  },
  "outputToken": {
    "symbol": "USDT-SPOT",
    "name": "Tether USD",
    "decimals": 8,
    "address": "0x200000000000000000000000000000000000010C",
    "chainId": 1337,
    "coingeckoId": "tether"
  },
  "refundToken": {
    "decimals": 6,
    "symbol": "USDT",
    "address": "0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9",
    "name": "Tether USD",
    "chainId": 42161
  },
  "fees": {
    "total": {
      "amount": "1226",
      "amountUsd": "0.001226999999999978",
      "pct": "1226999999999978",
      "token": {
        "decimals": 6,
        "symbol": "USDT",
        "address": "0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9",
        "name": "Tether USD",
        "chainId": 42161
      }
    },
    "originGas": {
      "amount": "3176078275684",
      "amountUsd": "0.013793803233643881",
      "token": {
        "chainId": 42161,
        "address": "0x0000000000000000000000000000000000000000",
        "decimals": 18,
        "symbol": "ETH"
      }
    },
    "destinationGas": {
      "amount": "25607816405362",
      "amountUsd": "0.001127",
      "pct": "1127000000000000",
      "token": {
        "chainId": 999,
        "address": "0x0000000000000000000000000000000000000000",
        "decimals": 18,
        "symbol": "HYPE"
      }
    },
    "relayerCapital": {
      "amount": "100",
      "amountUsd": "0.0001",
      "pct": "100000000000000",
      "token": {
        "decimals": 6,
        "symbol": "USDT",
        "address": "0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9",
        "name": "Tether USD",
        "chainId": 42161
      }
    },
    "lpFee": {
      "amount": "0",
      "amountUsd": "0.0",
      "pct": "0",
      "token": {
        "decimals": 6,
        "symbol": "USDT",
        "address": "0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9",
        "name": "Tether USD",
        "chainId": 42161
      }
    },
    "relayerTotal": {
      "amount": "1227",
      "amountUsd": "0.001227",
      "pct": "1227000000000000",
      "token": {
        "decimals": 6,
        "symbol": "USDT",
        "address": "0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9",
        "name": "Tether USD",
        "chainId": 42161
      }
    },
    "app": {
      "amount": "0",
      "amountUsd": "0.0",
      "pct": "0",
      "token": {
        "symbol": "USDT-SPOT",
        "name": "Tether USD",
        "decimals": 8,
        "address": "0x200000000000000000000000000000000000010C",
        "chainId": 1337,
        "coingeckoId": "tether"
      }
    }
  },
  "inputAmount": "1000000",
  "maxInputAmount": "1000000",
  "expectedOutputAmount": "99877300",
  "minOutputAmount": "99877300",
  "expectedFillTime": 2,
  "swapTx": {
    "simulationSuccess": true,
    "chainId": 42161,
    "to": "0xe35e9842fceaCA96570B734083f4a58e8F7C5f2A",
    "data": "0xad5...0073c0de",
    "gas": "100484",
    "maxFeePerGas": "31607801",
    "maxPriorityFeePerGas": "1"
  },
  "id": "kwnvz-1760078642040-c3005198326d"
}

This is a standard crosschain swap that settles on HyperEVM before being credited to HyperCore:

  1. Deposit on Origin: The user's transaction calls the SpokePool on the origin chain, emitting a FundsDeposited event.

  2. Fill on HyperEVM: An Across relayer fills the deposit, which emits a FilledRelay event.

  3. Automatic Deposit to HyperCore: The Across API automatically appends a destination action to the relay. This action calls a specialized function on HyperEVM which, in turn, credits the user's USDT-SPOT balance on HyperCore. You do not need to specify this action in your API call.


From HyperEVM to HyperCore

https://app.across.to/api/swap/approval?
tradeType=exactInput&
inputToken=0xB8CE59FC3717ada4C02eaDF9682A9e934F625ebb&
originChainId=999& // HyperEVM
outputToken=0x200000000000000000000000000000000000010C& // USDT-SPOT
destinationChainId=1337& // HyperCore
depositor=0x9A8f92a830A5cB89a3816e3D267CB7791c16b04D&
amount=1000000
Output
{
  "crossSwapType": "bridgeableToBridgeable",
  "amountType": "exactInput",
  "checks": {
    "allowance": {
      "token": "0xB8CE59FC3717ada4C02eaDF9682A9e934F625ebb",
      "spender": "0xB8CE59FC3717ada4C02eaDF9682A9e934F625ebb",
      "actual": "1000000",
      "expected": "1000000"
    },
    "balance": {
      "token": "0xB8CE59FC3717ada4C02eaDF9682A9e934F625ebb",
      "actual": "8705262",
      "expected": "1000000"
    }
  },
  "steps": {
    "bridge": {
      "inputAmount": "1000000",
      "outputAmount": "100000000",
      "tokenIn": {
        "decimals": 6,
        "symbol": "USDT",
        "address": "0xB8CE59FC3717ada4C02eaDF9682A9e934F625ebb",
        "name": "Tether USD",
        "chainId": 999
      },
      "tokenOut": {
        "decimals": 8,
        "symbol": "USDT-SPOT",
        "address": "0x200000000000000000000000000000000000010C",
        "name": "Tether USD",
        "chainId": 1337
      },
      "fees": {
        "totalRelay": {
          "pct": "0",
          "total": "0",
          "token": {
            "decimals": 6,
            "symbol": "USDT",
            "address": "0xB8CE59FC3717ada4C02eaDF9682A9e934F625ebb",
            "name": "Tether USD",
            "chainId": 999
          }
        },
        "relayerCapital": {
          "pct": "0",
          "total": "0",
          "token": {
            "decimals": 6,
            "symbol": "USDT",
            "address": "0xB8CE59FC3717ada4C02eaDF9682A9e934F625ebb",
            "name": "Tether USD",
            "chainId": 999
          }
        },
        "relayerGas": {
          "pct": "0",
          "total": "0",
          "token": {
            "decimals": 6,
            "symbol": "USDT",
            "address": "0xB8CE59FC3717ada4C02eaDF9682A9e934F625ebb",
            "name": "Tether USD",
            "chainId": 999
          }
        },
        "lp": {
          "pct": "0",
          "total": "0",
          "token": {
            "decimals": 6,
            "symbol": "USDT",
            "address": "0xB8CE59FC3717ada4C02eaDF9682A9e934F625ebb",
            "name": "Tether USD",
            "chainId": 999
          }
        }
      }
    }
  },
  "inputToken": {
    "decimals": 6,
    "symbol": "USDT",
    "address": "0xB8CE59FC3717ada4C02eaDF9682A9e934F625ebb",
    "name": "Tether USD",
    "chainId": 999
  },
  "outputToken": {
    "decimals": 8,
    "symbol": "USDT-SPOT",
    "address": "0x200000000000000000000000000000000000010C",
    "name": "Tether USD",
    "chainId": 1337
  },
  "refundToken": {
    "decimals": 6,
    "symbol": "USDT",
    "address": "0xB8CE59FC3717ada4C02eaDF9682A9e934F625ebb",
    "name": "Tether USD",
    "chainId": 999
  },
  "fees": {
    "total": {
      "amount": "0",
      "amountUsd": "0.0",
      "pct": "0",
      "token": {
        "decimals": 6,
        "symbol": "USDT",
        "address": "0xB8CE59FC3717ada4C02eaDF9682A9e934F625ebb",
        "name": "Tether USD",
        "chainId": 999
      }
    },
    "originGas": {
      "amount": "6604950000000",
      "amountUsd": "0.000291014097",
      "token": {
        "chainId": 999,
        "address": "0x0000000000000000000000000000000000000000",
        "decimals": 18,
        "symbol": "HYPE"
      }
    },
    "destinationGas": {
      "amount": "0",
      "amountUsd": "0.0",
      "pct": "0",
      "token": {
        "chainId": 1337,
        "address": "0x0000000000000000000000000000000000000000",
        "decimals": 18,
        "symbol": "HYPE"
      }
    },
    "relayerCapital": {
      "amount": "0",
      "amountUsd": "0.0",
      "pct": "0",
      "token": {
        "decimals": 6,
        "symbol": "USDT",
        "address": "0xB8CE59FC3717ada4C02eaDF9682A9e934F625ebb",
        "name": "Tether USD",
        "chainId": 999
      }
    },
    "lpFee": {
      "amount": "0",
      "amountUsd": "0.0",
      "pct": "0",
      "token": {
        "decimals": 6,
        "symbol": "USDT",
        "address": "0xB8CE59FC3717ada4C02eaDF9682A9e934F625ebb",
        "name": "Tether USD",
        "chainId": 999
      }
    },
    "relayerTotal": {
      "amount": "0",
      "amountUsd": "0.0",
      "pct": "0",
      "token": {
        "decimals": 6,
        "symbol": "USDT",
        "address": "0xB8CE59FC3717ada4C02eaDF9682A9e934F625ebb",
        "name": "Tether USD",
        "chainId": 999
      }
    },
    "app": {
      "amount": "0",
      "amountUsd": "0.0",
      "pct": "0",
      "token": {
        "decimals": 8,
        "symbol": "USDT-SPOT",
        "address": "0x200000000000000000000000000000000000010C",
        "name": "Tether USD",
        "chainId": 1337
      }
    }
  },
  "inputAmount": "1000000",
  "maxInputAmount": "1000000",
  "expectedOutputAmount": "100000000",
  "minOutputAmount": "100000000",
  "expectedFillTime": 0,
  "swapTx": {
    "simulationSuccess": true,
    "chainId": 999,
    "to": "0xB8CE59FC3717ada4C02eaDF9682A9e934F625ebb",
    "data": "0xa9059c...0000f424073c0de",
    "value": "0",
    "gas": "44033",
    "maxFeePerGas": "150000000",
    "maxPriorityFeePerGas": "0"
  },
  "id": "sx2pv-1760078744204-3531c066a03e"
}

This flow is a direct deposit rather than a traditional crosschain swap:

  1. Direct Deposit: The user deposits on HyperEVM with an attached transfer function for HyperCore. You do not need to specify this action in your API call.

  2. Credit on HyperCore: This function immediately executes the logic to credit the user's USDT-SPOT balance on HyperCore. This is a single, synchronous transaction with no FundsDeposited or FilledRelay events.


Read the API Reference and in case you face any errors or need support, please feel free to reach out to us.

Last updated