Back to Templates

Multi-Chain Token Swap Relayer with Li.Fi

Created by

Created by: 1Shot API || oneshotapi

1Shot API

Last update

Last update a day ago

Share


gasstationdemo.gif

Swap Tokens with Li.Fi

The growing popularity of agentic payments has lead to the development of protocols like x402 where agents and humans can pay for internet resources over standard http protocols using stablecoins.

This workflow lets you run your own swap relayer where callers can provide an x402-compatible payment header and a desired destination network to instantly receive gas tokens. This setup is trust minimized - user's have the following guarantees:

  1. They will be the receiver of the swap.
  2. Only the amount of tokens the authorized will be swapped.

Setup

In order to run this relayer workflow, you will need an account on 1Shot API. You must then import the 1Shot Gas Station contract into your business for any chain you wish to support with your relayer.

Next, follow the directions in the worflow sticky notes to update the Payment Configs for the tokens you wish to support swaps for. Lastly, distrubute your webhook api endpoint to your users.