Telegram bot guide

Add a token swap to a Telegram bot

Most teams do not need a full DEX frontend. They need one clean execution path behind a bot command. Swapifie gives you the quote and transaction layer so the Telegram experience can stay product-led.

Implementation flow
1

Collect the trade intent inside Telegram, including chain, sell token, buy token, and amount.

2

Call the Swapifie quote endpoint from your backend and store the returned path ID.

3

Show the user the quoted route, estimated output, and any fee context inside the bot UI.

4

When the user confirms, call the assemble endpoint and hand the transaction payload to the connected wallet flow.

Why this pattern works
  • The bot owns intent capture and messaging.
  • Your backend owns API auth, policy, and analytics.
  • The user still signs with their own wallet.
  • The integration stays small enough for a fast MVP.
What to launch first
  • Start with one chain such as Base.
  • Support one input and one output token per command.
  • Log path IDs and final wallet confirmations.
  • Add fee and attribution logic before broad distribution.
Reference request
const quote = await fetch("https://www.swapifie.com/api/v1/quote", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "x-api-key": process.env.SWAPIFIE_API_KEY!,
  },
  body: JSON.stringify({
    chainId: 8453,
    userAddr: "0xYourUserWallet",
    slippageLimitPercent: 0.5,
    inputTokens: [
      { tokenAddress: "0x0000000000000000000000000000000000000000", amount: "10000000000000000" }
    ],
    outputTokens: [
      { tokenAddress: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", proportion: 1 }
    ]
  }),
}).then((res) => res.json())
Next steps