Major PR
Major PR
Affiliated to
Swappy: A Unified Decentralized Platform for Token Swapping, Wallet Management & RAG Chat
Assistance
Submitted by,
Assistant Professor
This is to certify that Project Report on “Swappy: A Unified Decentralized Platform for Token
Swapping, Wallet Management & RAG Chat Assistance” is a record of major project work under the
curriculum of Maulana Abul Kalam Azad University of Technology(MAKAUT) for the MCA 2nd year
4th semester Examination, 2025 for the subject “ Major Project and Viva-voce(MCAN-482)’’ carried
out by Monajir Asraf -10271023014, Ashesh Karmakar -10271023007 and Souptik Nag –
10271023033, students of Kalyani Govt. Engineering College under the guidance of Dr. Indrajit
Bhattacharya as a requirement for the partial fulfilment of the Degree of Master of Computer
Application.
Supervisor
Head Department of Computer Application
Department of Computer Application Kalyani Government Engineering College
Kalyani Government Engineering College
Examiner
Departmental seal
Acknowledgement
We would like to express our sincere gratitude to everyone who supported and guided us
throughout the journey of our project.
First and foremost, we are deeply thankful to our respected Principal, Dr. Sourabh Kumar
Das, Principal, Kalyani Government Engineering College, for providing us with the
opportunity to undertake this project and for fostering an environment that encourages
innovation and learning.
We extend our heartfelt thanks to our Project Coordinator, Dr. Indrajit Bhattarcharya, for
their invaluable guidance, constructive feedback, and constant encouragement
throughout the project. Their expertise and insights were instrumental in shaping our
work.
We would also like to convey our gratitude to the esteemed faculty members of the
Department of Computer Applications. Their profound knowledge, continuous support,
and dedication to teaching have been a great source of inspiration and motivation for us.
Lastly, we thank our peers and everyone who directly or indirectly contributed to the
successful completion of this project.
The project covers smart contract development, wallet creation, token management,
and AI integration. It combines all major parts of a Web3 application and creates a full
working system for decentralized trading.
MOTIVATION
The goal of this project is to simplify and enhance the decentralized finance
experience. It aims to build a DEX that is small in scale but rich in functionality, offering
core DeFi features in a compact, educational, and developer-friendly way.
We are motivated by three main ideas:
1. User Control: Allow users to manage their assets without depending on third-party
custodians or external wallets.
2. Ease of Use: Provide a simpler interface with only essential options, reducing friction
for first-time users.
3. Learning Support: Use an integrated AI chatbot to guide users through blockchain
concepts and the platform itself.
By focusing on these points, the project becomes not only a tool but also a teaching
platform for understanding how decentralized trading and smart contracts work
INTRODUCTION
Decentralized finance (DeFi) is a growing field in blockchain technology that lets
users trade, invest, and manage digital assets without depending on banks or other
centralized institutions. Platforms like Uniswap, PancakeSwap, and SushiSwap have
shown how effective decentralized exchanges (DEXs) can be, allowing users to swap
tokens through smart contracts instead of using traditional order books. These platforms
use a model called Automated Market Maker (AMM), where users provide token pairs to
a shared pool. A pricing formula, usually based on the constant product model (x * y = k),
keeps the pool balanced. In return, users receive LP (liquidity provider) tokens, which
represent their share in the pool and can earn them rewards from trading fees.
This project is based on similar concepts but designed with a simpler and more
focused structure. It supports just three ERC-20 tokens, which include custom tokens and
optionally stablecoins like USDC or DAI. Users can swap these tokens directly through the
smart contract, add liquidity to the pool, and withdraw it whenever needed. The AMM
contract manages all logic on-chain, without any need for a central server. Unlike many
projects that rely only on third-party wallets like MetaMask, this system includes a custom-
built decentralized wallet. This wallet allows users to generate an account, store their
private key, and interact with the platform without needing browser extensions. However,
for flexibility, the system still supports integration with well-known wallets like MetaMask.
Another key part of this project is the addition of a Retrieval-Augmented Generation (RAG)
chatbot. This chatbot is trained to answer user questions about blockchain, token standards,
swapping, liquidity pools, and general DeFi concepts. It helps new users understand how
to use the platform and learn more about the underlying technology without leaving the
interface.
This project offers a simpler, fully self-contained system that combines these ideas
into one working application. It provides a full stack experience from smart contract logic
to user interface, wallet control, and an AI assistant. By keeping the system compact and
easy to understand, it becomes a practical tool for learning, testing, and demonstrating the
principles of decentralized applications. It also allows room for future expansion, such as
multi-token pools, analytics dashboards, or mobile wallet support.
NOVELTY
This project stands out by bringing together multiple decentralized technologies
into one unified platform. While DEXs, wallets, and AI chatbots exist independently, few
systems offer all three working seamlessly together in a simple, single application.
Key novel aspects include:
• A custom-built decentralized wallet fully integrated into the platform, offering an
alternative to MetaMask
• A lightweight AMM swap system that is fully on-chain and easy to understand,
designed for learning and testing
• A Retrieval-Augmented Generation (RAG) based chatbot that acts as a live assistant,
answering blockchain-related questions
• Support for both custom tokens and popular ERC-20 tokens like USDC or DAI in the
same swap system
• A full local development stack with smart contract deployment, testing, and frontend
integration
This makes the system both functional and instructional, providing value to users
and developers alike.
CONTRIBUTION
The major contributions of this project are:
1. A fully functional decentralized exchange (DEX) with support for token swaps and
liquidity pooling, built using Solidity and deployed on a local Ethereum blockchain.
2. Custom ERC-20 tokens (e.g., AGN, FLR, MGN) created and managed within the
platform to simulate a real token economy.
3. An Automated Market Maker (AMM) contract that uses the constant product
formula to handle pricing and swaps without any central control.
4. A custom decentralized wallet system that lets users create, import, and manage
Ethereum addresses directly in the browser without relying on third-party extensions.
5. Wallet integration support for common tools like MetaMask and WalletConnect,
offering flexibility to users.
6. An integrated RAG-based chatbot that improves user experience by explaining
terms, guiding actions, and answering common questions about blockchain and DeFi.
7. A clean, React-based frontend that provides a smooth user experience for swapping
tokens, adding liquidity, and interacting with the system.
8. Unit tests and scripts built with Hardhat to simulate real interactions, verify contract
logic, and ensure platform reliability.
Web 3.0 is the next stage of the internet. It is designed to be more open, secure, and
controlled by users instead of big companies. In Web 1.0, websites were simple and mostly
read-only. Web 2.0 added social media, apps, and user-generated content. However, most of
the data and control in Web 2.0 is held by a few large platforms like Google, Facebook, or
Amazon.
Web 3.0 changes that. It uses blockchain technology to give users more control over their own
data, identity, and digital assets. Instead of depending on a central server, Web 3.0 apps (often
called dApps) run on decentralized networks like Ethereum. This means no single person or
company owns or controls the whole system.
A big part of Web 3.0 is the use of smart contracts programs stored on a blockchain that
automatically carry out tasks. This allows for safe, peer-to-peer transactions without the need
for middlemen.
Web 3.0 also connects with technologies like cryptocurrencies, NFTs, and decentralized
finance (DeFi). It opens the door to a more private, secure, and user-friendly internet where
people can own and trade digital items freely.
Blockchain
Decentralized Finance
Decentralized Exchange
The system follows a Web3-based architecture, where the frontend communicates directly with
smart contracts on the blockchain, and the user’s wallet signs and sends all transactions. An AI
chatbot system runs alongside to provide helpful support.
These smart contracts are written in Solidity language. All contract logic is
transparent and immutable once deployed. At the very first the the Token smart
contract creates a custom ERC-20 token on the Ethereum blockchain. When deployed,
it mints an initial supply to the deployer's address. It also includes a mint() function
that allows to mint more tokens.
The Liquidity Pool contract manages a token pair pool used for swapping and
liquidity provisioning. It holds two ERC-20 tokens (token0 and token1) and maintains
their reserves. Users can add liquidity by depositing both tokens, and in return, they
receive pool shares (LP tokens) through an internal _mint function. They can also
remove liquidity, which burns their LP tokens and sends back a proportional share of
the reserves. The swap function allows users to trade one token for another based on
the constant product AMM formula, applying a 0.3% fee. The contract updates reserve
after every liquidity or swap operation and includes utility functions for square root
and minimum value calculations used during LP token minting.
o Blockchain Network:
This project follows a real-world development and deployment pipeline using the
Ethereum blockchain. Initially, all contracts were developed and tested on a local
blockchain using Hardhat. After verifying functionality and performance locally, the
contracts were then deployed to the Sepolia test network using Alchemy as the node
provider.
After successful local testing, the contracts were deployed to the Sepolia
Ethereum testnet, a live public test network. This helps simulate real-world
conditions like - Network latency, Real wallet use, Gas fees, Contract
immutability. For test network I used Sepolia as it is lightweight, fast, and
recommended by Ethereum for testing. It's supported by most wallets and tools
like Alchemy and Infura. The use of Alchemy and Sepolia also prepares the
system for future mainnet deployment with minimal changes.
• Token Creation:
The project includes the creation of a custom cryptocurrency token that follows
the ERC-20 standard, which is the most commonly used token format on the Ethereum
blockchain. These tokens serve as the foundation for all activities in the decentralized
exchange (DEX) platform, including swapping, liquidity provisioning, and balance
tracking.
When the token contract is deployed, it requires three inputs: a name, a symbol,
and an initial supply. The name and symbol are used for identification purposes across
wallets and exchanges. The initial supply defines the total number of tokens minted at
the time of deployment and is directly assigned to the deployer's address. This process
ensures that the creator or owner of the project receives all tokens at the start and can
then distribute or use them within the system.
The token supports all standard ERC-20 functions, such as transferring tokens
between users, approving other addresses to spend tokens on behalf of the holder, and
checking balances and total supply. These functionalities are inherited from
OpenZeppelin’s ERC-20 implementation, which ensures safety, reliability, and
compatibility with other Ethereum applications.
Additionally, the token includes a public minting function, which allows any
user to mint new tokens and assign them to a specific address. While this feature can
be helpful during development and testing—for example, to simulate a faucet or to
ensure all test accounts have sufficient balances—it would typically be restricted or
removed in a production environment to prevent unlimited token inflation. In this
project, the minting function has not been access-restricted, meaning anyone interacting
with the contract can generate new tokens.
The token behaves just like any standard cryptocurrency: users can hold it in
wallets, approve it for use in contracts (like the AMM), and use it for swaps or liquidity
provisioning. It works seamlessly with the other parts of the platform, including the
Automated Market Maker and Liquidity Pool contracts, and is easily recognized by
MetaMask and other Ethereum-compatible wallets.
x*y=k
Where:
This formula ensures that as more of one token is bought, its price increases in
relation to the other token, thus maintaining balance and reducing the chance of
draining the pool.
o Token Swap:
Token swapping is the primary function of the AMM in this platform. When
a user wants to trade one token for another, they interact directly with the liquidity
pool through the smart contract. The contract calculates how much of the output
token the user should receive based on the current reserves, using the constant
product formula with a small transaction fee (usually 0.3%).
o Liquidity provision
Liquidity provision allows users to contribute tokens to the AMM in order to
enable trading. This creates a liquidity pool to enable swapping those tokens.
• Smart Contract Deployment:
The deployment of smart contracts is a key step in making the decentralized
exchange (DEX) platform functional and accessible. This process involves compiling,
configuring, and deploying the core contracts, e.g. the ERC-20 tokens, the Automated
Market Maker (AMM), and the liquidity pool logic in a blockchain network where
users can interact with them via wallet interfaces. The entire deployment workflow is
built using Hardhat, that simplifies contract compilation, testing, and deployment.
Hardhat allows for both local simulation and live testnet deployment, making it ideal
for development and real-world testing.
The deployment process is as follows-
o Contract Compilation:
The smart contracts are written in Solidity language. Before deployment
they are compiled using Hardhat. This step ensures the contracts are translated into
bytecode and ABI (Application Binary Interface), which are required for blockchain
execution and frontend interaction.
• Testing:
Testing is a critical part of this project to ensure that all smart contracts behave
correctly and securely under different scenarios. It verifies the functionality of token
transfers, liquidity operations, token swaps, and edge cases such as insufficient liquidity
or invalid input. This project uses the Hardhat testing framework with Chai assertion
library which are widely used tools in the Ethereum development ecosystem.
The testing process for this project covers five key functional areas to ensure
correctness and robustness across all smart contract interactions. First, token
functionality is validated by testing token minting, transfers, balance updates, and
approval mechanisms required for contract-based token spending. Next, the liquidity
pool behavior is examined by adding token pairs with the correct ratio, accurately
minting LP tokens, updating internal reserves, and verifying proper return of tokens
during liquidity removal. The swap logic is rigorously tested to ensure that output
amounts are calculated correctly using the constant product formula, that swaps execute
properly without exceeding reserves, and that incorrect input tokens are safely rejected.
In addition, the integrity of the AMM contract is verified by preventing duplicate pool
creation, ensuring token order consistency (e.g., tokenA/tokenB vs tokenB/tokenA),
and validating all input token addresses. Finally, the testing includes edge case
handling, such as zero-value liquidity additions, token swaps with insufficient approval,
liquidity removal without LP tokens, and pool creation attempts using identical tokens.
Together, these tests confirm that the system operates securely and reliably under a wide
range of normal and abnormal conditions.
Exchange
✔ Should create a pool
✔ Should swap tokens
LiquidityPool
✔ Should add liquidity
✔ Should swap token0 for token1
Lock
Deployment
✔ Should set the right unlockTime
✔ Should set the right owner
✔ Should receive and store the funds to lock
✔ Should fail if the unlockTime is not in the future
Withdrawals
Validations
✔ Should revert with the right error if called too soon
✔ Should revert with the right error if called from another account
✔ Shouldn't fail if the unlockTime has arrived and the owner calls it
Events
✔ Should emit an event on withdrawals
Transfers
✔ Should transfer the funds to the owner
Token
✔ Should have correct name and symbol
✔ Should assign initial supply to owner
✔ Should allow minting
16 passing (1s)
All core functionalities were tested successfully, with expected behaviors as
Token minting, transferring, and approvals, pool creation and liquidity provision,
swapping logic with proper reserve management, rejection of invalid or unauthorized
actions. These tests confirm that the platform is functionally stable, user-interaction
safe, and performs accurate token accounting.
On Ethereum testnet now, but can be easily deployed on low-fee chains like-
BNB Smart Chain (PoSA) for faster finality and negligible gas fees, Polygon,
Avalanche, or Optimism for Layer 2 scalability and <1 sec confirmations. Offers
cheaper transactions than Uniswap on Ethereum mainnet.
4. Cross-Chain Ready
One of the most innovative and user-centric features of our project is the Swappy
Wallet, a browser extension-based Web3 wallet that brings decentralized asset management
directly to the user’s fingertips. Built entirely from scratch for this project, Swappy Wallet
functions similarly to well-known tools like MetaMask, but with a more focused and
minimal approach tailored specifically to our platform’s architecture. Unlike wallets that
require additional integration steps or third-party dependencies, Swappy Wallet operates as
a standalone extension, allowing users to manage their blockchain accounts independently.
Whether users want to swap tokens, transfer assets, manage NFTs, or simply check balances
they can do it all within this lightweight and secure extension. What truly sets Swappy
Wallet apart is its tight integration with our decentralized exchange (DEX) while still
remaining a fully independent tool. Users are not forced to rely on external wallets; instead,
they can create and manage their own wallet using a 12-word seed phrase, switch between
networks, and interact with smart contracts, all from within the browser, without leaving
the page.
This provides a streamlined, user-controlled, and developer-friendly experience,
making Swappy Wallet both a utility tool and an educational resource for anyone exploring
blockchain technology.
All of this is powered by Moralis API, which helps pull reliable token and NFT
data, including token names, symbols, and icons. This provides a cleaner and more user-
friendly display than raw contract data alone.
The frontend of our platform, including the Swappy Wallet browser extension, has
been built with a modern and modular technology stack designed for responsiveness,
scalability, and developer efficiency. Each technology was chosen with the goal of
offering a smooth user experience while maintaining high performance and ease of
maintenance.
1. React.js
React is the core framework used for building the user interface. Its component-
based architecture allows us to break the app into reusable pieces such as wallet
creation, dashboard, token list, and swap UI. It provides fast rendering with virtual
DOM and smooth updates to the UI based on changes in state or blockchain data.
React’s developer tools and community support made it the ideal choice for building a
complex Web3 interface.
2. Tailwind CSS
We used Tailwind CSS, a utility-first CSS framework, to design a clean and
responsive UI without writing bulky custom stylesheets. Tailwind allowed us to build
modern, mobile-friendly components directly in JSX using pre-defined utility classes.
The design system is consistent across the wallet and DEX interface, giving a
professional look and feel with minimal effort.
3. JavaScript (ES6+)
The entire frontend logic is written in modern JavaScript, using ES6+ features
such as arrow functions, async/await, destructuring, and modules. JavaScript drives all
wallet logic including seed phrase generation, key derivation, network switching, and
transaction signing.
4. ethers.js
ethers.js is the primary library used for interacting with the Ethereum blockchain
from the frontend.
▪ It allows the Swappy Wallet to:
▪ Create wallets using mnemonic phrases (BIP-39).
▪ Sign and send transactions directly from the browser.
▪ Fetch balances, contract states, and token metadata.
We preferred ethers.js over Web3.js due to its smaller size, better documentation,
and improved TypeScript support.
o /wallet/balance/:address – Returns the native token (ETH or MATIC) balance for the
user.
o /tokens/:address/:chain – Lists all ERC-20 tokens held by the wallet on a chosen
network.
o /nfts/:address/:chain – Fetches NFTs owned by the wallet address.
o /transactions/:address – Retrieves the latest activity or transaction history.
These routes take care of formatting, error handling, and API calls, so the
frontend only has to make simple HTTP requests to our server.
3. Supported Networks
We’ve connected the backend to the same networks supported by Swappy
Wallet:
Ethereum Mainnet and Sepolia Testnet
Polygon Mainnet and Mumbai Testnet
So no matter what chain the user is working on, they’ll see accurate data
pulled in real time.
When starting this project, we knew that simply building a decentralized exchange
wasn’t enough. We needed to rethink how users interact with it. Most platforms rely
heavily on third-party wallets like MetaMask, which, although powerful, come with their
own set of challenges. Users are often required to install separate browser extensions,
manually configure networks, approve every transaction through a pop-up, and sometimes
struggle with understanding what’s actually happening under the hood. For newcomers to
Web3, this can be overwhelming. Even for experienced users, the disconnection between
the exchange and the wallet often breaks the flow.
That’s where the idea for Swappy Wallet came in, not as a replacement for
MetaMask, but as an integrated, user-friendly companion that’s purpose-built for our DEX
ecosystem. Swappy Wallet is a browser extension that removes the need for external setup
or third-party connections. Users can create their own Ethereum-compatible wallets right
inside the extension, get a 12-word recovery phrase, and start managing their assets within
seconds. There’s no signup, no central server, and no dependency on external platforms.
Everything is self-contained, secure, and entirely under the user’s control.
But more than that, Swappy Wallet gives us something incredibly valuable:
freedom. Freedom to design the user experience exactly how we want it. We’re not
constrained by the limitations of someone else’s UI or feature roadmap. If we want to
support additional testnets like Sepolia or Mumbai, we can. If we want to allow custom
token additions or show NFTs directly in the wallet, we can do that too, and we did. This
freedom allowed us to create something that feels natural and intuitive, especially for
users who are just starting their journey into blockchain and decentralized finance.
We also see Swappy Wallet as an educational tool. It introduces users to concepts
like private key ownership, mnemonic phrases, and network switching in a way that’s
simple and approachable. Rather than requiring users to figure things out on their own
through multiple apps, we provide a cohesive, all-in-one experience. Everything from
wallet creation to token swapping happens in one place no jumping between tabs, no
external confirmations, no confusion.
• Wallet Integration
Wallet integration plays a crucial role in connecting users to the decentralized
application. In our project, we made sure to design the wallet integration in a way that is
smooth, intuitive, and flexible, catering to both new users and experienced developers.
Below is a detailed explanation of how wallet integration has been implemented in our
DEX platform.
Swappy Wallet, our custom browser extension, is fully integrated into the
platform to work right out of the box. As soon as the extension is installed and activated,
our application automatically detects the wallet’s presence. The connection process is
frictionless — there’s no need for manual imports or connection buttons. Once
connected, the DEX interface instantly reads the wallet address, displays the active
blockchain network, and fetches the balance of native tokens (like ETH or MATIC)
along with custom tokens. This tight coupling between the DEX and Swappy Wallet
creates a smooth user experience where interactions feel native, not bolted on.
Even though we built our own wallet, we also respect user choice. Some users
might already be comfortable using wallets like MetaMask or might prefer mobile-
based wallets that connect through WalletConnect. That’s why we made our DEX
flexible — it allows users to connect using either of these popular tools.
When a user chooses to connect through MetaMask, the platform triggers the
MetaMask extension to request access to the wallet. Similarly, for WalletConnect, a QR
code is generated so users can scan and connect from mobile wallets like Trust Wallet
or Rainbow. This level of support ensures that our DEX is open and inclusive, not
limited to just our internal tools.
▪ Automatic Network Detection and Switching
Every interaction with the smart contracts, whether it’s swapping tokens,
providing liquidity, or minting, requires the user’s approval through their wallet. With
Swappy Wallet, all of this happens inside the browser. When a transaction is initiated,
the wallet signs it locally using the user’s private key stored securely in the browser’s
local environment.
✓ “Create a Wallet” : for first-time users who don’t have an existing wallet.
✓ “Sign In With Seed Phrase” : for users recovering their wallet.
✓ “Connect Wallet” : for those who prefer MetaMask or WalletConnect.
The flow is linear and beginner-friendly. We’ve kept jargon to a minimum, used
simple UI prompts, and designed the experience to guide users step-by-step. This makes
the DEX approachable even for those who are new to blockchain.
Swappy Wallet - Working Architecture:
• RAG Chatbot:
o Detailed Workflow of the RAG Chatbot
The first step is to collect the source documents. These include guides,
explanations, FAQs, and concept notes about blockchain, smart contracts, ERC-20
tokens, and decentralized finance. These documents are cleaned and split into
smaller parts or chunks.
Each chunk is converted into a vector (numerical representation) using a
pre-trained embedding model. In this case, a Hugging Face model like all-MiniLM-
L6-v2 is used. This model captures the semantic meaning of each text chunk.
Once the embeddings are created, they are stored in Pinecone. Pinecone is a
vector database that allows fast similarity search across high-dimensional vectors. Each
text chunk is stored in Pinecone along with metadata (like the original document name
or topic). These vectors are indexed using a similarity metric such as cosine similarity,
which helps in finding the most relevant pieces of information later.
When a user types a question through the chatbot interface (for example, asking
“How does token swapping work?”), the following happens:
The user input is sent to the backend Flask application through an API request.
The Flask app receives the query and first passes it through the same embedding model
that was used to prepare the document chunks.
The query vector is then sent to the Pinecone vector database. Pinecone
compares this vector with all stored vectors and returns the top matching chunks. These
chunks are likely to contain information relevant to the user’s question. Usually, 3–5
top chunks are retrieved and sent back to the Flask app.
Once the relevant chunks are received, the Flask app arranges the retrieved text
into a structured prompt. This prompt includes a system message that sets the assistant’s
behavior (e.g., "You are a helpful assistant for blockchain questions") and a user
message that contains the retrieved content and the actual user question.
The structured prompt is then sent to a large language model (LLM) through the
OpenAI API. In this case, a model like gpt-3.5-turbo or gpt-4 is used. The API is
accessed via the internet, and during development, ngrok is used to tunnel the Flask app
so that it can be accessed from the public internet. Ngrok exposes a public URL that
forwards requests to your local server, which is useful when testing the frontend with a
backend that runs locally.
The OpenAI API processes the input and returns a response generated based on
the context (retrieved documents) and the user’s question. The Flask backend receives
this response and sends it back to the chatbot interface on the frontend. The frontend
displays the answer to the user in a chat-like format.
8. Frontend Integration
The frontend is built using React. It has a simple UI for inputting user queries
and displaying the chatbot’s responses. Each message is sent to the Flask backend,
which is connected to the RAG pipeline, and the results are shown to the user without
needing to refresh or reload the page.
This chatbot improves the user experience on your DEX platform by answering
blockchain questions directly within the interface. It doesn’t rely only on pre-trained
answers but actively pulls from the latest available information in your document store.
Each part of the workflow is modular, so it can be improved independently in the future.
Implementation
To showcase the working of the decentralized exchange platform, several key screens from the
live running project have been captured. These screenshots serve as visual proof of
functionality, illustrating how users interact with the platform, from connecting a wallet to
performing swaps and adding liquidity.
Home Page – SWAPPY DEX : In this page the user needs to connect to the wallet first and the
chatbot icon is also there in the right corner.
Wallet Connected : After connecting to the wallet the home page looks like this, if liquidity
pool is already there.
Add Liquidity Page: This interface allows the user to provide a pair of tokens to the liquidity
pool. Once submitted, tokens are transferred to the pool contract.
Add Liquidity Page while adding tokens into liquidity pool. In this page Metamask pop up is
there for signing the transaction.
Pool Creation Confirmation: This shows the on-screen status confirming that a liquidity pool
has been successfully created between two tokens.
Token Balances before swap: This screen displays balances before token swap.
Token Balances after swap: This screen displays updated balances after a succesful token swap.
Swappy Wallet:
Wallet Welcome Screen: This screen is Seed Phrase Generation: This screen
the entry point to the custom wallet shows the process of creating a new
named Swappy Wallet. wallet by generating a 12-word seed.
..phrase. The user is instructed to
securely save this phrase, as it is the
only way to recover their wallet in the
future.
This project enables token swaps and liquidity provision without any central
authority or intermediary which is more secure than the centralized platforms.
Uses own constant product formula of Automated Market Maker to manage token
prices and ensure continuous trading without order books.
3. Multi-Wallet Support
The system is designed in a way that developers and learners can understand and
test DeFi concepts without needing to interact with large, complex systems. It is well suited
for learning how smart contracts, wallets, and AI assistance work together.
Built with Solidity, React, Hardhat, and Ethers.js for clean development,
modularity, and seamless smart contract integration.
Each part of the platform like the smart contract, wallet, UI, and chatbot, can be
changed or updated separately. This makes future upgrades easier to implement.
Limitations
Moving the platform to a testnet like Goerli or Sepolia will help test it in real blockchain
environments and make it accessible to more users.
Add support for more ERC-20 tokens, multi-token pools, and dynamic pool creation to make
the exchange more useful and realistic.
Introduce a module where users can view token trends or get simple guidance based on
historical data. This would help users make better decisions.
Add a dashboard that shows key metrics like liquidity, volume, pool balance, and swap history.
This will provide better insights into platform usage.
Develop a mobile-friendly version or a progressive web app so that users can access the
platform on different devices.
Perform more rigorous contract audits and testing with tools like Slither or MythX before
scaling or going live.
Conclusion
This project successfully brings together the essential parts of a decentralized application into
one unified platform. It combines a token swap system, a custom-built decentralized wallet,
and an AI-powered chatbot that helps users understand blockchain concepts without needing
to leave the platform. Each component is connected in a way that offers a complete experience,
from interacting with smart contracts to managing tokens and receiving real-time help through
the chatbot. This makes the project not just a technical showcase but also a practical learning
environment for users and developers who want to understand how decentralized finance works
in action.
The decentralized exchange (DEX) built here allows token swapping and liquidity
provision using an Automated Market Maker model. It supports ERC-20 tokens and provides
a hands-on example of how token pricing and liquidity management can happen fully on-chain.
This part of the project reflects real-world platforms like Uniswap but in a scaled-down form
that makes it easier to study and extend. The custom wallet system is another strong feature, as
it lets users create and manage Ethereum accounts without relying only on tools like MetaMask.
This allows the platform to remain fully self-contained and provides a deeper understanding of
how wallet integration works behind the scenes. One of the key contributions of this project is
the Retrieval-Augmented Generation (RAG) chatbot. It plays an important role in guiding users
and explaining blockchain-related topics in simple language. Instead of forcing users to search
for answers outside the application, the chatbot provides assistance within the same interface.
This improves the onboarding process and makes the platform more accessible to people who
may be new to blockchain or DeFi. Together, these features make the project a well-rounded
system that serves multiple purposes. It is useful for trading and testing, but also serves as a
practical tool for learning.
Overall, the project proves that even a small-scale system, when well designed, can
deliver the core experience of decentralized finance and serve as a complete demonstration of
Web3 development. With some improvements in scale, user support, and chatbot capabilities,
it can grow into a reliable platform that not only functions well but also teaches and guides
users in the evolving space of blockchain technology.
References
• Online Resources:
1. OpenZeppelin, ERC-20 Token Standard Documentation, 2023,
https://docs.openzeppelin.com/contracts/4.x/erc20
2. Uniswap Labs, Uniswap v2 Core Documentation, 2023. , https://docs.uniswap.org/
3. Moralis, Moralis Web3 API Docs, 2024, https://docs.moralis.io/
4. MetaMask, MetaMask Developer Documentation, ConsenSys, 2023,
https://docs.metamask.io/
5. Polygon Labs, Polygon PoS Architecture and Developer Docs, 2023,
https://wiki.polygon.technology/
6. OpenAI, Retrieval-Augmented Generation (RAG) in AI Applications, 2024,
https://platform.openai.com/docs
7. Hardhat by Nomic Foundation, Ethereum Development Environment, 2023,
https://hardhat.org/