Skip to main content

Iframe Integration

KyberDMM can be used within other sites as an iframe. An iframe shows an exact version of the KyberDMM frontend site. After the initial integration, no further work is needed for updates as the exchange site is updated over time.

The interface allows users to buy, sell, send, or provide liquidity for available tokens. This is useful if your application provides services around these tokens, or if your application requires users to acquire some token in order to use some service. (For example, users can buy USDC through a KyberDMM iframe on your site, then allow users to stake/lend that USDC on your site).

Example#

<iframe
src="https://dmm.exchange/#/swap?theme=dark"
height="700px"
width="400px"
style="
border: 0;
margin: 0 auto;
display: block;
border-radius: 10px;
"
/>

Using the code above should show the following in your page:

iframe

Further Example#

You can customize the selected page, as well as selected custom tokens, using URL query parameters

Linking to a USDC <-> KNC swap page would look something like the following code. To link to a token of your choice, replace the address after inputCurrency or outputCurrency with the token address you want to link to.

<iframe
src="https://dmm.exchange/#/swap?inputCurrency=0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48&outputCurrency=0xdeFA4e8a7bcBA345F687a2f1456F5Edd9CE97202"
height="700px"
width="400px"
style="
border: 0;
margin: 0 auto;
display: block;
border-radius: 10px;
"
/>