Giter VIP home page Giter VIP logo

llamaswap-interface's Introduction

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:

  • chain: default chain (eg chain=ethereum). This parameter is required
  • from: token to sell, to use the gas token for the chain use 0x0000000000000000000000000000000000000000 (eg from=0x0000000000000000000000000000000000000000)
  • to: token to buy, to use the gas token for the chain use 0x0000000000000000000000000000000000000000 (eg to=0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48)
  • background: color of the background (eg background=rgb(10,20,30))

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:

  • Our widget handles all different dex integrations, which are quite different (cowswap requires signing a message while most others send a tx onchain)
  • Our widget shows warnings for price impact and other things that could impact negatively your users
  • In case there's any issue we can push a fix to everybody by just updating the site behind the iframe

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/

llamaswap-interface's People

Contributors

0xngmi avatar mintdart avatar vrtnd avatar ai-slave avatar charlie-eth avatar 0xstrobe avatar uiguy1368 avatar josojo avatar chenxsan avatar 0xsign avatar 48stephen avatar anxolin avatar brenopolanski avatar deepcryptodive avatar mounibec avatar nlordell avatar o-az avatar omahs avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.