Welcome to TradeHorizon, a decentralized exchange (DEX) built on the Solana blockchain. TradeHorizon leverages Solana’s fast and low-cost transactions, integrated with Jupiter’s aggregator for optimal token swaps, to provide users with a secure, user-friendly platform for trading Solana-based tokens (e.g., SOL, USDC, USDT, BTC, SRM). This project includes features for token swapping, wallet management, balance management (add funds, withdraw), and user profiles, all wrapped in a modern Next.js frontend with Tailwind CSS for styling.
- Overview
- Features
- Prerequisites
- Installation
- Usage
- Project Structure
- Security and Bug Bounty
- Contributing
- License
- Contact
TradeHorizon is designed to facilitate seamless token swaps on Solana, managing user wallets securely with stored public/private keys (server-side) for transactions. The frontend is built with Next.js, using Tailwind CSS for a responsive, modern UI. It integrates with Solana’s Web3.js library for blockchain interactions, Jupiter’s API for price aggregation, and NextAuth.js for user authentication.
This project is ideal for developers, security researchers, and blockchain enthusiasts interested in building or studying Solana-based DEXs, with a focus on security (e.g., bug bounties for exposed keys) and user experience.
- Token Swapping: Swap between Solana native (SOL) and SPL tokens (e.g., USDC, USDT, BTC, SRM) using Jupiter’s aggregator for optimal pricing and liquidity.
- Wallet Management: Manage user wallets with a stored public/private keypair, enabling transactions without requiring a browser wallet extension.
- Profile Dashboard: View user profile, token balances, and total USD value, with options to add funds (via QR code) or withdraw tokens.
- Add Funds: Generate a QR code and wallet address for users to fund their Solana wallet with SOL or tokens.
- Withdraw Funds: Withdraw SOL or SPL tokens to a user-specified Solana address, handled securely server-side.
- Security Research: Includes tools and guidance for security students to study exposed Solana keys (e.g., using regex, Shodan, Google Dorks) for bug bounties and ethical hacking.
- Responsive UI: Built with Tailwind CSS for a clean, mobile-friendly design.
Before you begin, ensure you have the following installed:
- Node.js (v16 or higher)
- npm or yarn
- Git (for cloning the repository)
- Solana CLI (optional, for local testing)
- API Keys (for Jupiter and Solana RPC, if needed)
Required dependencies:
@solana/web3.js
@solana/spl-token
next
next-auth
react
react-dom
axios
qrcode.react
gsap
(optional, for animations)lodash
(for debouncing)
-
Clone the repository:
git clone https://github.com/abhilov23/TradeHorizon-decentralized-exchange.git cd tradehorizon
-
Install dependencies:
npm install
or
yarn install
-
Configure environment variables:
- Create a
.env.local
file in the root directory and set up necessary API keys and configurations.
- Create a
-
Start the development server:
npm run dev
or
yarn dev
- Swapping Tokens: Select tokens and input the desired amount to swap via Jupiter’s aggregator.
- Managing Wallets: View balances, deposit funds using QR codes, and withdraw tokens securely.
- User Authentication: Sign in with email or wallet using NextAuth.js.
tradehorizon/
├── components/ # Reusable UI components
├── pages/ # Next.js pages
├── utils/ # Helper functions and API integrations
├── styles/ # Tailwind CSS styles
├── public/ # Static assets
├── .env.local # Environment variables
├── package.json # Project dependencies
└── README.md # Project documentation
TradeHorizon prioritizes security. If you find vulnerabilities, follow responsible disclosure practices.
- Report Bugs: Submit security issues via GitHub Issues.
- Bug Bounty: Rewards for critical vulnerabilities affecting funds.
- Security Tools: Regex patterns, Shodan, and Google Dorks for key exposure analysis.
We welcome contributions! To contribute:
- Fork the repository.
- Create a feature branch.
- Make changes and test thoroughly.
- Submit a pull request.
This project is licensed under the MIT License.
For questions or collaborations, reach out via GitHub or email at abhilovgupta01@gmail.com
.