Swap Pay is an SDK that turns fragmented token balances into smooth payments using EIP-5792
We’ve all been there: you want to buy something in Web3, you have enough funds, but not in the exact asset the merchant wants. Suddenly, you’re clicking approvals, swapping between tokens, and watching transactions fail — all for what should have been a simple checkout.
Swap Pay is an SDK that makes Web3 checkouts easy. Users can view all the tokens in their wallet priced in real time thanks to Chainlink Data Feeds. This gives the user full visibility of the value of their fragmented balances. At checkout, they simply choose how much of each token to contribute toward the total, paid in PYUSD. Using EIP-5792, instead of going through multiple swaps, approvals, and transactions, the user only has to execute one transaction.
For developers, all of this is exposed through a lightweight SDK, making it effortless to integrate into any dApp or marketplace. The result is a checkout flow that feels seamless for the user, guarantees the merchant gets the asset they want, and saves both sides from the inefficiencies of today’s Web3 payments.
The frontend is built in React with TypeScript, using Tailwind CSS and DaisyUI.
The contracts are written in Solidity, compiled and deployed with Hardhat, and use Chainlink Data Feeds to value ERC-20 token balances in real time on-chain.
The system employs PYUSD (PayPal USD) as the settlement asset, with the treasury paying the target contract and generating automatic cashback if the token basket exceeds the required value.
A React SDK was developed to expose these functions easily, and EIP-5792 is used to bundle approvals, transfers, and payments into a single transaction.