Skip to main content

SuperSwap

SuperSwap is Hypermid’s dedicated cross-chain bridge and swap protocol. It enables token swaps between SuperSwap-supported chains using the same Hypermid API endpoints.

Supported Chains

ChainChain IDStatus
PulseChain369Active
Ethereum1Active
Base8453Active
Arbitrum42161Active
Polygon137Active
Optimism10Active
Unichain130Active
SonicComing Soon
SolanaComing Soon
BitcoinComing Soon

Endpoints You’ll Use

StepEndpointPurpose
1GET /v1/quoteGet the swap price and route
2POST /v1/executeGet transaction data to sign
3GET /v1/statusTrack swap progress
3bPOST /v1/inbound-receiver/registerRegister inbound deposit (only needed for inbound multi-step)

Inbound Swaps (Any Chain → PulseChain)

Inbound swaps deliver tokens to PulseChain. There are two types depending on the source token.

Inbound — Single Step

When: The source token is USDC on a supported chain (Base, Ethereum, Arbitrum, etc.) User signs: 1 transaction How it works: USDC is bridged directly to PulseChain and swapped to the desired token. One signature, fully automatic.
// USDC on Base → PLS on PulseChain (single step)
const quote = await client.getQuote({
  fromChain: 8453,          // Base
  toChain: 369,             // PulseChain
  fromToken: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", // USDC on Base
  toToken: "0xA1077a294dDE1B09bB078844df40758a5D0f9a27",   // PLS
  fromAmount: "5000000",    // $5 USDC
  fromAddress: "0xYourWallet",
  slippage: 0.03,
});

// Sign and broadcast — that's it
const tx = await wallet.sendTransaction(quote.data.transactionRequest);

Inbound — Multi-Step

When: The source token is NOT USDC (e.g., ETH, WBTC, or any token on any chain) User signs: 1 transaction + 1 gasless wallet signature (confirmation) How it works: Hypermid first swaps the source token to USDC, then bridges to PulseChain. After the swap transaction confirms, the user signs a gasless confirmation message so Hypermid can route the funds.
// ETH on Base → PLS on PulseChain (multi-step)
const quote = await client.getQuote({
  fromChain: 8453,
  toChain: 369,
  fromToken: "0x0000000000000000000000000000000000000000", // ETH
  toToken: "0xA1077a294dDE1B09bB078844df40758a5D0f9a27",  // PLS
  fromAmount: "1000000000000000", // 0.001 ETH
  fromAddress: "0xYourWallet",
  slippage: 0.03,
});

// Step 1: Sign the swap transaction
const txHash = await wallet.sendTransaction(
  quote.data.steps[0].transactionRequest
);
await publicClient.waitForTransactionReceipt({ hash: txHash });

// Step 2: Confirm the deposit (gasless — no transaction fee)
// The quote response includes afterStep1 with the signing instructions
if (quote.data.afterStep1) {
  const signature = await wallet.signTypedData({
    ...quote.data.afterStep1.eip712,
    message: { ...quote.data.afterStep1.eip712.message, txHash },
  });

  await fetch(quote.data.afterStep1.action, {
    method: "POST",
    headers: { "Content-Type": "application/json" },
    body: JSON.stringify({
      ...quote.data.afterStep1.body,
      txHash,
      signature,
    }),
  });
}

// Done — Hypermid bridges and swaps automatically (~5-7 min)
How do I know if it’s single or multi-step? Check the quote response:
  • If it has a transactionRequest at the top level → single step
  • If it has steps array and afterStep1multi-step

Outbound Swaps (PulseChain → Any Chain)

Outbound swaps send tokens from PulseChain to another chain. The user always signs just one transaction on PulseChain.

Outbound — Single Step

When: The destination token is USDC User signs: 1 transaction on PulseChain How it works: PLS is swapped to a stablecoin, bridged, and USDC arrives on the destination chain.
// PLS on PulseChain → USDC on Base (single step)
const quote = await client.getQuote({
  fromChain: 369,           // PulseChain
  toChain: 8453,            // Base
  fromToken: "0xA1077a294dDE1B09bB078844df40758a5D0f9a27", // PLS
  toToken: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",  // USDC on Base
  fromAmount: "200000000000000000000000", // 200,000 PLS
  fromAddress: "0xYourWallet",
  slippage: 0.03,
});

// Sign and broadcast — USDC arrives on Base in ~3-5 minutes
const tx = await wallet.sendTransaction(quote.data.transactionRequest);

Outbound — Multi-Step

When: The destination token is NOT USDC (e.g., ETH, WBTC, or any non-stablecoin) User signs: 1 transaction on PulseChain How it works: PLS is swapped to a stablecoin, bridged to the destination chain, then swapped to the desired token. The user still signs only one transaction — the backend handles the destination swap automatically.
// PLS on PulseChain → ETH on Base (multi-step, still 1 signature)
const quote = await client.getQuote({
  fromChain: 369,
  toChain: 8453,
  fromToken: "0xA1077a294dDE1B09bB078844df40758a5D0f9a27", // PLS
  toToken: "0x0000000000000000000000000000000000000000",    // ETH on Base
  fromAmount: "200000000000000000000000",
  fromAddress: "0xYourWallet",
  slippage: 0.03,
});

// Sign and broadcast — ETH arrives on Base in ~5-7 minutes
const tx = await wallet.sendTransaction(quote.data.transactionRequest);
Outbound is always 1 signature. Unlike inbound multi-step, outbound multi-step doesn’t require a confirmation step — the backend handles the destination swap automatically.

Universal Code (Handles All Cases)

This single function handles all four swap types:
async function superSwap(params: {
  fromChain: number;
  toChain: number;
  fromToken: string;
  toToken: string;
  fromAmount: string;
  fromAddress: string;
}) {
  // 1. Get quote
  const quote = await client.getQuote({ ...params, slippage: 0.03 });
  if (!quote.data) throw new Error(quote.error?.message || "No route found");

  // 2. Sign the transaction
  const txRequest = quote.data.steps?.[0]?.transactionRequest
    || quote.data.transactionRequest;
  const txHash = await wallet.sendTransaction(txRequest);
  await publicClient.waitForTransactionReceipt({ hash: txHash });

  // 3. Confirm deposit if needed (only inbound multi-step)
  if (quote.data.afterStep1) {
    const signature = await wallet.signTypedData({
      ...quote.data.afterStep1.eip712,
      message: { ...quote.data.afterStep1.eip712.message, txHash },
    });
    await fetch(quote.data.afterStep1.action, {
      method: "POST",
      headers: { "Content-Type": "application/json" },
      body: JSON.stringify({ ...quote.data.afterStep1.body, txHash, signature }),
    });
  }

  // 4. Track status
  while (true) {
    const status = await client.getStatus({
      txHash, fromChain: params.fromChain, toChain: params.toChain,
    });
    if (status.data.status === "DONE") return status.data;
    if (status.data.status === "FAILED") throw new Error("Swap failed");
    await new Promise(r => setTimeout(r, 10000));
  }
}

// Usage — same function for all 4 swap types:
await superSwap({ fromChain: 8453, toChain: 369, fromToken: "0x833...", toToken: "0xA10...", fromAmount: "5000000", fromAddress: "0xYou" });
await superSwap({ fromChain: 369, toChain: 8453, fromToken: "0xA10...", toToken: "0x833...", fromAmount: "200000...", fromAddress: "0xYou" });

Timing

Swap TypeEstimated Time
Inbound — Single Step~3-5 minutes
Inbound — Multi-Step~5-7 minutes
Outbound — Single Step~3-5 minutes
Outbound — Multi-Step~5-7 minutes
If the destination swap isn’t available after 3 retries, the bridged stablecoin is returned to the user automatically.

Pricing

All fees are included in the quote. estimate.toAmount is what you receive — no hidden costs.

Status Values

StatusSubStatusDescription
PENDINGWAIT_SOURCE_CONFIRMATIONSTransaction submitted
PENDINGBRIDGE_IN_PROGRESSCross-chain transfer (~3-5 min)
PENDINGSWAP_IN_PROGRESSDEX swap on destination chain
DONECOMPLETEDTokens delivered to user
DONEFALLBACK_SENTSwap unavailable — stablecoin returned
FAILEDBRIDGE_TIMEOUTBridge didn’t complete in 30 min
TokenSymbolDecimals
PulseChainPLS18
HEXHEX8
PulseXPLSX18
IncentiveINC18
HedronHDRN9
Tether USDUSDT6
DaiDAI18
For PLS, use the WPLS address 0xA1077a294dDE1B09bB078844df40758a5D0f9a27 or the zero address. The API handles both.