Moralis Token Dex Swap

Hi,

Iโ€™m new to programming and very interested in crypto. I have a question regarding the Token dex Swap Dapp from Moralis. How can I use this Dapp?

Will I be able to charge my own fees or should it be ideally be part of another Dapp? Will I also be able to add other tokens to it?

Thank you for taking the time and going through. Replies are much appreciated.

1 Like

Hi @Nebula

Connect your crypto wallet to the site. Select the tokens you want to trade and then just trade them.

This dex will mostly be part of your other website. You can add your own fees using 1inch API. So when users trade you will receive a portion of fees to your wallet.

Yes, you can. If the token has an liquidity pair then you can trade the token

1 Like

Thank you for the reply.

This dex will mostly be part of your other website.

I would like to know what sort of other website can have a dex swap? Could it be something like gaming or a defi product? What would you suggest would be easier to implement?

Usage of Dex will depend on your usecase. If your project requires users to swap tokens with other tokens then you can use dex in your project.

I am not sure what you mean by easier to implement. The example tutorial which you are referring to is a react project. So you can easily copy the code to your project and customise it as per your requirement.

1 Like

Usage of Dex will depend on your usecase.

Thank you for the reply. I am thinking of implementing a staking Dapp along with a Dex Swap.

Do I need my own liquidity to operate a Dex Swap? (I am thinking its not needed)

Does the Moralis Staking API support all chains like the Dex? or if it doesnโ€™t can I use another API like Blockdaemon with Moralis?

1 Like

You can use 1inch API for swap. They will get the liquidity data from their pools.

We donโ€™t have a staking API. The tutorial that I shared uses 1inch API so have a look at their docs for more details on supported chains.

1 Like

Thank you for your replies. I have another question. When I run the final Moralis Dex Swap Repo ( https://github.com/IAmJaysWay/dexFinal) in live server, the web page is blank, I am not seeing the finished product. Am I missing something?

It could be possible you are seeing some error in browser console or your code editor console. Can you check that?

1 Like

Yes, I am getting errors in the console

.

Can you give me some idea on what these are about?

Did you start your backend node server with the dex code?
And may I also know how you have started the frontend server?

I just git cloned the final repo on vs code https://github.com/IAmJaysWay/dexFinal and then opened the index html with live share

This project is not an vanilla js project. You will have to use NPM to run the project.
Install the packages using npm i command and run the project using npm run dev command in terminal.

Thank you, yes I completely overlooked that. Will install the packages