LlamaSwap / interface

Frontend for LlamaSwap
https://swap.defillama.com
85 stars 77 forks source link

Join the community & report bugs

If you wish to report an issue, please join our Discord

If you want to learn about LlamaSwap, read the Twitter Thread

Integration

The best way to integrate is through an iframe of our page, like this:

<iframe
    title="LlamaSwap Widget"
    name="LlamaSwap Widget"
    src="https://swap.defillama.com?chain=ethereum"
    width="450px"
    height="565px"
    allow="fullscreen"
    marginwidth="0"
    marginheight="0"
    frameborder="0"
    scrolling="no"
    loading="eager"
></iframe>

The widget is responsive, so you can change the width and height in any way you want and the widget will adjust to fit the space. On top of that, you can customize the widget by adding the following params to the query url:

Note: only tokens that are part of our token lists are accepted in from and to, this is to prevent scammers linking to llamaswap with fake tokens loaded (eg a fake USDC)

API integration

Widget integrations are preferred cause:

But if you'd prefer to instead integrate through our API please contact @0xngmi on discord through defillama's discord and ask for an api key. We are forced to use api keys because many of the underlying aggregators have rate limits, so we have to control the volume of requests we send to them.

Running the app locally

yarn install
yarn dev

Visit: http://localhost:3000/