Inspiration

XDC is a network for finance , and we have built defi tools to take XDC a level up in category of DeFi. We have also built a collection of smart-contracts as npm package that would be helpful for anyone who wants to build on top of XDC-Chain.

What it does

XDC-Dex gives offers a varity of DeFi features for your daily use built on top of XDC-Chain.

XDC-Fi offers following features:

  • Swapping: XDC-Fi consists of an entire swap that allows you to swap your tokens in the smoothest way possible, giving you a uniswap like swapping experience

  • Staking: XDC-Fi allows you to stake your tokens in the smart contract as well as unstake them whenever needed, it also allows you to claim the rewards whenever the user wished.

  • Lending: XDC-Fi allows users to lend different tokens including customly deployed ones, users can also borrow, withdraw, Repay and supply tokens by interacting with the lending-contract.

  • Liquidity Pool: XDC-Fi allows users to create pool as well as adding and removing liquidity with three different tokens by depositing amount.

  • Stable Coin: XDC-Fi stableCoin allows users to get 1 USD worth of XDC tokens by fetching the price from the coingecko api. In the future this feature will be improved on a lot.

  • Price Oracle: XDC-Fi has on chain pricefeeds from the pools not making users reliant on other protocols at all and simplifying the process with this feature.

  • Bridge: Bridge from Goereli ETH Testnet to the XDC Apothem testnet to bridge the tokens (Not Live yet)

How we built it

XDC-Fi project contains a total of 22 smart-contracts, each contract responsible for a certain functionality. We integrated these contracts with a user friendly front-end to offer seamless DEX like experience. The front-end is built using NextJs and TailwindCSS and for smart-contracts we used Solidity.

We also built a collection of reusable smart-contracts as npm-package, using which anyone can build more DeFi tools on top of XDC Chain

https://www.npmjs.com/package/xdefi-contracts

Checkout our smart-contract workflow here for more details:

https://app.flowmapp.com/share/projects/ba9dc7e4-55da-4e13-847c-c230a9bfd089/userflow/87a22c20-1304-49b7-8585-93924226cec6

The frontend is built with Next.js and React.js. , We are using Wagmi.js & ethers.js for integration with the blockchain . Figma was used to create UI UX of the platform . Tailwind CSS was used to design the platform .

The Backend Server contains the code for bridge , which ensure the proper working of the bridge and transfer of tokens when initiated , listens for the event and react accordingly

Note

The contracts are deployed on XDC Apothem Testnet for demo purposes and are fully working with all the features live. The Swap contracts are fit to go Mainnet live , but other contracts are still not ready for mainnet deployment , although they are working . There maybe certain vulnerabilities in the Smart contract code , which needs a proper audit as it belongs to DEFI space before they are deployed to mainnet , and we don't want to rush the deployement . We plan to launch the platform on Main net in the near future as soon as everything goes well . Keeping the Time constraint in mind , we tried our best to create this project with all the various feature and tools ,and made them properly working , it was a real challenge for us .

Challenges we ran into

We had some issues while integrating contracts on the XDC chain, but we are happy that we were able to resolve those on time . The main issue came up when metamask was not able to record the tx response properly and we had to use XDC Pay wallet for the deployement and the transactions .

Accomplishments that we're proud of

We were able finish the integration on time submit a working project, this makes us proud. We are very happy to contribute to XDC chain with a variety of DeFi tools combined in a DEX .

What we learned

Working with XDC Chain on a this large of a project was new to us, we learnt to deploy and integrate smart-contracts with XDC chain.

What's next for XDC-DEX

XDC-Fi has been an amazing project to learn from and the chain XDC is quiet a fascinating chain with most of it's own tools to work with and as emerging and enthusiastic builders we are all up for the challenge to improve and consistently work on the product. We are also planning on adding more stuff to build on for users to make building in DeFi with XDC a lot more convenient and easier.

Built With

Share this project:

Updates