Integrate TibetSwap in Your Wallet
Your users get a better UX, you get some fees 😉
Example Widget
PoC. Experiment with your own UX.
Other inputs you can try:
Available tokens:
Loading...
Step-by-Step Integration Guide
Step 1
Show your creativity or go with the tried-and-tested
First, come up with an elegant way to know what the user wants to trade, and how much. You can use a traditional swap interface, copy the widget above, or build your own UX. Aim to have a solution that is simple, intuitive, and quick.
Step 2
First TibetSwap API call
Once you know the token, operation (buy/sell), and one amount (either the input or the output), you're ready to make the first API call. The quote endpoint will, as the name suggests, give you a quote, along with other useful information.
Step 3
Your cut - and hopefully ours
It's time to calculate fees. We highly recommend taking a percentage of the trade (e.g., 0.875% - just like Metamask!). We also humbly ask you to respect our 0.3% dev fee. See the example widget for more details about this step.
Step 4
Last confirmation from the user
You have all the info required to do a swap now, so it's time to ask the user for a final confirmation by showing them the amounts, price, price impact, fee, etc. Once they accept, simply generate the offer.
Step 5
Last request to our API
You have all the data required to make a call to this API endpoint. Send us the offer, as well as the fees, how we should distribute them, and the pair involved - we'll build the full spend bundle and broadcast it to the network.
Step 6
Confetti time!
You'll know if the trade went through from the response of the last API call. It's time to do something nice from the user - e.g., confetti. Your fee will arrive in your wallet as soon as the transaction is confirmed.
Questions? Issues?
DM me on twitter or join our Discord server.