{"id":29022603,"url":"https://github.com/max-sdsharp/bymax.open-dex","last_synced_at":"2025-06-26T03:02:25.428Z","repository":{"id":295242932,"uuid":"989563865","full_name":"Max-SDSharp/bymax.open-dex","owner":"Max-SDSharp","description":"Bymax OpenDEX - A decentralized exchange (DEX) interface powered by Next.js, TypeScript, and Tailwind CSS.","archived":false,"fork":false,"pushed_at":"2025-06-19T18:24:16.000Z","size":818,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-19T19:32:45.680Z","etag":null,"topics":["defi","defi-trading","dex","drift","nextjs","nodejs","reactjs","tailwindcss","trade","zustand"],"latest_commit_sha":null,"homepage":"https://dex.bymax.trade","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Max-SDSharp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-05-24T11:03:25.000Z","updated_at":"2025-06-19T18:24:19.000Z","dependencies_parsed_at":"2025-06-19T19:23:11.765Z","dependency_job_id":"b8d5682c-851c-478a-9ab1-865a6cfeb6e3","html_url":"https://github.com/Max-SDSharp/bymax.open-dex","commit_stats":null,"previous_names":["max-sdsharp/bymax.open-dex"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Max-SDSharp/bymax.open-dex","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Max-SDSharp%2Fbymax.open-dex","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Max-SDSharp%2Fbymax.open-dex/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Max-SDSharp%2Fbymax.open-dex/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Max-SDSharp%2Fbymax.open-dex/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Max-SDSharp","download_url":"https://codeload.github.com/Max-SDSharp/bymax.open-dex/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Max-SDSharp%2Fbymax.open-dex/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261990277,"owners_count":23241185,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["defi","defi-trading","dex","drift","nextjs","nodejs","reactjs","tailwindcss","trade","zustand"],"created_at":"2025-06-26T03:02:24.606Z","updated_at":"2025-06-26T03:02:25.393Z","avatar_url":"https://github.com/Max-SDSharp.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Bymax OpenDEX\n\nA decentralized exchange (DEX) interface powered by Next.js, TypeScript, and Tailwind CSS.\n\n## About\n\nBymax OpenDEX is a modern, high-performance decentralized exchange interface inspired by Drift Protocol. It provides a seamless trading experience with low slippage, minimal price impact, and competitive fees.\n\n### Key Features\n\n- **Low Slippage Trading**: Execute trades with minimal price impact\n- **Multiple Liquidity Sources**: Trades are supported by multiple liquidity mechanisms:\n  - Just-in-Time (JIT) Auction Liquidity\n  - Limit Orderbook Liquidity\n  - AMM Liquidity as a backstop\n- **Cross-Collateral**: Use any supported token as collateral for trading\n- **Responsive Design**: Optimized for all devices with a modern UI\n\n## Real-Time Trading Infrastructure\n\n### WebSocket Architecture\n\nBymax OpenDEX implements a sophisticated real-time data infrastructure with enterprise-grade WebSocket connectivity:\n\n- **Persistent Connection Management**: Automatic reconnection with exponential backoff strategy (max 20 attempts, 3-second intervals)\n- **Heartbeat Mechanism**: 30-second ping/pong protocol to maintain connection health and detect disconnections early\n- **Channel-Based Subscriptions**: Efficient message routing for orderbook and trade data streams\n- **Memory Leak Prevention**: Automatic cleanup of event handlers and intervals on component unmount\n- **Connection State Synchronization**: Real-time connection status across all application components\n\n### Real-Time Data Streams\n\n- **Orderbook Feed**: Live orderbook updates with bid/ask depth visualization (top 9 levels)\n- **Trade History**: Real-time trade execution feed with comprehensive trade metadata\n- **Market Data**: Live price feeds, volume, and market statistics\n- **Connection Resilience**: Graceful handling of network interruptions with automatic recovery\n\n### State Management Architecture\n\n- **Zustand with Immer**: Immutable state updates with persistent storage capabilities\n- **Centralized Data Store**: Single source of truth for all real-time market data\n- **Efficient Data Caching**: Intelligent data preservation with automatic cleanup\n- **Type-Safe Operations**: Full TypeScript integration for data structures and API contracts\n\n## Products\n\nDrift Protocol offers four primary products:\n\n1. **Spot Trading**: Trade tokens directly with immediate settlement\n2. **Perpetuals Trading**: Trade perpetual futures contracts with leverage\n3. **Borrow \u0026 Lend**: Supply assets to earn yield or borrow against your collateral\n4. **Passive Liquidity Provision**: Provide liquidity to the protocol and earn fees\n\n## Technical Stack\n\n- **Frontend**: Next.js 15 with App Router, TypeScript, Tailwind CSS\n- **State Management**: Zustand with Immer middleware and persistent storage\n- **Real-Time Communication**: WebSocket with automatic reconnection and heartbeat\n- **Styling**: Tailwind CSS with custom design system\n- **Development**: ESLint, Prettier, TypeScript strict mode\n- **Performance**: React 19 with concurrent features and optimized re-renders\n\n## Getting Started\n\n### Prerequisites\n\n- Node.js 23.x or higher\n- npm or yarn\n\n### Installation\n\n1. Clone the repository\n\n```bash\ngit clone https://github.com/yourusername/open-dex.git\ncd open-dex\n```\n\n2. Install dependencies\n\n```bash\nnpm install\n# or\nyarn install\n```\n\n3. Run the development server\n\n```bash\nnpm run dev\n# or\nyarn dev\n```\n\n4. Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.\n\n## Development\n\nThis project uses Next.js App Router for routing and Tailwind CSS for styling. The main structure is:\n\n- `src/`: Contains the source code\n  - `app/`: App Router components and routes\n  - `components/`: Reusable UI components\n  - `hooks/`: Custom React hooks including WebSocket integration\n  - `services/`: WebSocket service and API integrations\n  - `store/`: Zustand stores with middleware and persistence\n  - `types/`: TypeScript type definitions\n  - `styles/`: Global styles and Tailwind configuration\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n## License\n\nThis project is licensed under the MIT License - see the LICENSE file for details.\n\n## Acknowledgements\n\n- Inspired by [Drift Protocol](https://www.drift.trade/)\n- Built with [Next.js](https://nextjs.org/)\n- Styled with [Tailwind CSS](https://tailwindcss.com/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmax-sdsharp%2Fbymax.open-dex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmax-sdsharp%2Fbymax.open-dex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmax-sdsharp%2Fbymax.open-dex/lists"}