WDK logoWDK documentation

Symbiosis Swidge Overview

Use the Symbiosis community Swidge module for same-chain and cross-chain asset routes.

Community modules are developed and maintained independently by third-party contributors.

Tether and the WDK Team do not endorse or assume responsibility for their code, security, or maintenance. Use your own judgment and proceed at your own risk.

Use @symbiosis-finance/wdk-protocol-swidge-symbiosis@1.2.0 when your wallet needs a WDK SwidgeProtocol provider for routes served by Symbiosis. The module uses the public Symbiosis REST API for discovery, quotes, execution payloads, and cross-chain status.

The released source is tagged v1.2.0 and maintained by Symbiosis.

When to use it

Use this module when your application needs:

  • same-chain swaps, cross-chain bridges, or combined swap-and-bridge routes;
  • runtime chain and token discovery;
  • exact-input quotes;
  • EVM or Bitcoin source execution through a compatible WDK wallet account;
  • cross-chain settlement status mapped to WDK status values.

The module can quote TON, Tron, and Solana source routes, but it cannot execute those source transaction formats through WDK wallet accounts in this release.

Responsibility model

AreaOwner
Wallet keys, source address, approval, signing, and transaction broadcastWDK wallet account
Chain and token catalogs, route payloads, deposit addresses, and settlement statusSymbiosis API
Input validation, quote review, user confirmation, fee policy, retries, and status pollingHost application

Discovery is not a route guarantee

getSupportedChains() and getSupportedTokens(options?) read provider-maintained catalogs. getSupportedTokens() filters the token catalog by toChain when present, otherwise by fromChain. It does not prove that a specific token pair currently has liquidity.

Call quoteSwidge() for the requested pair before presenting a route. Treat the returned quote as indicative because execution obtains a fresh response.

Quote and execution model

quoteSwidge() calls the Symbiosis quote endpoint and does not write to the wallet.

swidge() calls the Symbiosis swap endpoint again. The execution amounts, fees, spender, transaction payload, or Bitcoin deposit address can differ from the earlier quote. The method checks configured fee caps on this fresh response and then proceeds to the route-specific wallet writes.

swidge() does not expose the fresh execution response for a separate confirmation step. Show the indicative quote, recipient, destination chain, refund address, and selected slippage before calling it. Configure the applicable fee caps, and do not treat the earlier quote as reserved or bound to execution.

For a non-native EVM input token, swidge() can:

  1. Read the current allowance.
  2. Reset a non-zero insufficient allowance to zero and, when the account supports receipt lookup, wait for that approval receipt.
  3. Approve the spender returned by Symbiosis for the input amount and, when supported, wait for that receipt.
  4. Broadcast the route transaction.

The method returns after the source transaction is broadcast. Use getSwidgeStatus(result.id) to track destination settlement or a refund.

Source execution support

Source route typeExecution behavior
evmOptionally approves the input ERC-20, then sends the API-provided calldata transaction.
btcTransfers the input amount to the generated deposit address. Configure a suitable refund address.
tonQuote only; swidge() throws UnsupportedRouteError.
tronQuote only; swidge() throws UnsupportedRouteError.
solanaQuote only; swidge() throws UnsupportedRouteError.

Destination support is provider-controlled. Use runtime discovery and a successful quote instead of maintaining a static route list.

Integrator limitations

  • Only exact-input routes are supported. Passing toTokenAmount throws ExactOutNotSupportedError.
  • fromTokenAmount must convert to a positive integer bigint; invalid, zero, and negative values throw ValidationError before an API request.
  • The module does not validate slippage ranges or the formats of recipient, refund, and partner addresses. Validate those application inputs before calling the provider.
  • Discovery responses are cached for ten minutes per protocol instance. The cache duration is not configurable.
  • Monero and Zcash are excluded from discovery and chain resolution because their provider routes use third-party custodial integrations outside this module's scope.
  • A status lookup returning HTTP 404 is mapped to pending. A newly submitted operation and a genuinely unknown ID are therefore indistinguishable through this method.
  • API requests time out after timeoutMs (30 seconds by default). The module does not retry or back off automatically.
  • The package documents /v2/swap as rate-limited to one request per second. Bitcoin execution also uses that endpoint to generate a deposit address.
  • If allowance lookup fails, the module falls back to sending an approval without a reset. That direct approval can still fail for a token with an existing non-zero allowance, so ensure allowance reads work or manage the reset in the application.
  • If the wallet does not expose transaction-receipt lookup, the module cannot wait for approval confirmation before submitting the route transaction.
  • A fee whose description is exactly Partner fee maps to affiliate; every other fee maps to protocol. No fee maps to network, so maxNetworkFeeBps does not constrain a separately reported network cost and maxProtocolFeeBps does not constrain the affiliate fee.
  • Quote-only construction without an account uses recipient as both the source sender and destination recipient.
  • The package exposes ESM and Bare entrypoints but does not declare a Node.js engines range.

Next steps


Need Help?

On this page