A meme-style, non-custodial perpetual futures trading website on Solana, powered by Drift Protocol. Users can connect their wallets (Phantom, Solflare) and trade real money through Drift Protocol integration - earning referral fees legally without custodying funds.
- Solana Wallet Connection - Support for Phantom and Solflare wallets
- Real-Time Perp Trading - Trade SOL-PERP, BTC-PERP, ETH-PERP markets
- Long/Short Positions - Open leveraged positions (1x-10x)
- Drift Protocol Integration - All trades executed through Drift smart contracts
- Non-Custodial Architecture - Users control their funds and sign all transactions
- Meme-Style UI - Fun, engaging interface with DaisyUI dark theme
- Risk Warnings - Clear Terms of Service and trading risk disclosures
Check out the β‘ QUICKSTART.md for a 5-minute getting started guide!
- Multiple market pairs expansion
- Position management (close, modify)
- Portfolio tracking dashboard
- Leaderboard system
- Advanced charting
- Mobile responsive design improvements
βββββββββββββββββββββββββββββββββββββββββββββββββββ
β Bang Perp Exchange β
β (React Frontend Interface) β
ββββββββββββββββ¬βββββββββββββββββββββββββββββββββββ
β
β
ββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Solana Wallet Adapter β
β (Phantom, Solflare - User Signs Transactions) β
ββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββ
β
β
ββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Drift Protocol Smart Contracts β
β (All Trading Logic + Fund Management) β
ββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
β
ββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Solana Blockchain β
β (Transaction Settlement) β
ββββββββββββββββββββββββββββββββββββββββββββββββββββ
Revenue Model: Builder Code / Referral system through Drift Protocol (10-15% of trading fees, paid automatically on-chain)
- Node.js 18+ and npm
- A Solana wallet (Phantom or Solflare browser extension)
- SOL for transaction fees (get from Solana Faucet for Devnet)
-
Clone the repository
git clone https://github.com/ivi374forivi/trading-perpetual-futures.git cd trading-perpetual-futures -
Install dependencies
npm install
-
Configure environment variables
Create a
.env.localfile in the root directory:VITE_RPC_ENDPOINT=https://api.devnet.solana.com VITE_DRIFT_ENV=devnet # Optional: Register for a Drift Builder Code at https://docs.drift.trade/partnerships/DBC VITE_DRIFT_BUILDER_CODE=
-
Run development server
npm run dev
-
Build for production
npm run build
- Click the "Select Wallet" button in the top right
- Choose Phantom or Solflare
- Approve the connection in your wallet
- Once wallet is connected, the app will automatically initialize Drift Protocol
- Important: You must have a Drift user account. Create one at drift.trade first if needed
- Select a market (SOL-PERP, BTC-PERP, ETH-PERP)
- Enter the amount in USDC
- Choose leverage (1x-10x)
- Click π LONG (bet price goes up) or π SHORT (bet price goes down)
- Approve the transaction in your wallet
- Transaction signatures will be displayed
- Check your positions on drift.trade
| Component | Technology | Purpose |
|---|---|---|
| Frontend Framework | React 18 + Vite | Fast, modern web app |
| Language | TypeScript | Type safety |
| Blockchain | Solana (Devnet β Mainnet) | Fast, low-cost transactions |
| Trading Protocol | Drift Protocol SDK | Perpetual futures trading |
| Wallet Integration | @solana/wallet-adapter | Wallet connectivity |
| Styling | Tailwind CSS + DaisyUI | Meme-style UI |
| Build Tool | Vite | Fast builds and HMR |
trading-perpetual-futures/
βββ src/
β βββ main.tsx # App entry point with wallet providers
β βββ App.tsx # Main app component
β βββ index.css # Global styles with Tailwind
β βββ vite-env.d.ts # TypeScript environment types
β βββ components/
β βββ TradePanel.tsx # Trading interface with Drift integration
β βββ RiskWarning.tsx # Terms of Service and risk warnings
βββ index.html # HTML entry point
βββ package.json # Dependencies and scripts
βββ vite.config.ts # Vite configuration with polyfills
βββ tsconfig.json # TypeScript configuration
βββ tailwind.config.js # Tailwind + DaisyUI config
βββ postcss.config.js # PostCSS configuration
βββ .env.local # Environment variables (create this)
- β No private key storage
- β Users sign all transactions
- β Input validation on all forms
- β HTTPS only in production
- β Environment variables secured
- β Terms of Service displayed
- β Risk warnings on trading UI
- β Non-custodial architecture (users control funds)
- β Builder Code revenue model (referral fees only)
Important: This is a NON-CUSTODIAL platform. Users control their funds at all times. Drift Protocol handles compliance. We only earn referral fees through the Builder Code system.
- Register for a Drift Builder Code via Drift Protocol Dashboard
- Receive a percentage of trading fees (typically 10-15%)
- All revenue is paid on-chain automatically
- No fund custody required
- Fully compliant affiliate model
- Visit Drift Protocol docs: https://docs.drift.trade/partnerships/DBC
- Register for Builder Code
- Obtain your public key
- Add to
.env.localasVITE_DRIFT_BUILDER_CODE - Verify attribution in Drift dashboard
-
Get Devnet SOL
- Visit Solana Faucet
- Airdrop SOL to your wallet address
-
Create Drift Account
- Visit drift.trade (switch to Devnet)
- Create a user account
- Get some USDC from Drift's faucet
-
Test Trading
- Open the Bang Perp Exchange app
- Connect your wallet
- Try opening a small position
- Verify the transaction on Solana Explorer
-
Update
vite.config.tswith base path:export default defineConfig({ base: '/trading-perpetual-futures/', // ... rest of config })
-
Build and deploy:
npm run build # Deploy dist/ folder to GitHub Pages
-
Install Vercel CLI:
npm i -g vercel
-
Deploy:
vercel
Before deploying to mainnet:
- Switch
VITE_RPC_ENDPOINTto mainnet RPC - Update
VITE_DRIFT_ENVtomainnet-beta - Add your Drift Builder Code
- Test all features thoroughly
- Add analytics tracking
- Setup error monitoring
- Perform security audit
- Verify legal compliance in your jurisdiction
IMPORTANT: Please Read Carefully
Trading perpetual futures involves substantial risk of loss and is not suitable for everyone. Key risks include:
- High Volatility: Crypto markets are extremely volatile
- Leverage Risk: Leverage amplifies both gains and losses
- Liquidation Risk: You may lose more than your initial investment
- Smart Contract Risk: Despite audits, smart contract risks exist
- Network Risk: Blockchain congestion may affect execution
Only trade with funds you can afford to lose completely.
This platform is for educational and experimental purposes. Not financial advice. Do your own research. Consult a financial advisor before trading.
- Project Lead: 4444JPP
- Repository: ivi374forivi/trading-perpetual-futures
MIT License - see LICENSE file for details
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the project
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
- Issues: GitHub Issues
- Drift Support: Drift Discord
Status: π’ Active Development
Version: 1.0.0
Last Updated: 2025-10-30
Built with β€οΈ on Solana