{"id":29176800,"url":"https://github.com/rustyneuron01/bitcoin-rune-dex","last_synced_at":"2026-04-22T23:34:19.830Z","repository":{"id":296065867,"uuid":"992207406","full_name":"rustyneuron01/Bitcoin-Rune-Dex","owner":"rustyneuron01","description":"Bitcoin Rune Dex Backend. Defi project use Runes on Bitcoin L1","archived":false,"fork":false,"pushed_at":"2025-05-28T20:17:31.000Z","size":97,"stargazers_count":37,"open_issues_count":0,"forks_count":25,"subscribers_count":14,"default_branch":"master","last_synced_at":"2025-07-01T17:44:18.112Z","etag":null,"topics":["airdrop","amm","bitcoin","defi","dex","etching","liquidity-pool","rbf","rune","swap","token","yieldfarming"],"latest_commit_sha":null,"homepage":"","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/rustyneuron01.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-28T19:36:18.000Z","updated_at":"2025-06-13T12:51:10.000Z","dependencies_parsed_at":"2025-05-28T21:19:22.940Z","dependency_job_id":"6ed88f50-0bb8-423e-8087-bb00c6bd0b28","html_url":"https://github.com/rustyneuron01/Bitcoin-Rune-Dex","commit_stats":null,"previous_names":["rustyneuron01/bitcoin-rune-dex"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/rustyneuron01/Bitcoin-Rune-Dex","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rustyneuron01%2FBitcoin-Rune-Dex","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rustyneuron01%2FBitcoin-Rune-Dex/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rustyneuron01%2FBitcoin-Rune-Dex/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rustyneuron01%2FBitcoin-Rune-Dex/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rustyneuron01","download_url":"https://codeload.github.com/rustyneuron01/Bitcoin-Rune-Dex/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rustyneuron01%2FBitcoin-Rune-Dex/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32159958,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-22T17:06:48.269Z","status":"ssl_error","status_checked_at":"2026-04-22T17:06:19.037Z","response_time":58,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["airdrop","amm","bitcoin","defi","dex","etching","liquidity-pool","rbf","rune","swap","token","yieldfarming"],"created_at":"2025-07-01T17:30:41.979Z","updated_at":"2026-04-22T23:34:19.813Z","avatar_url":"https://github.com/rustyneuron01.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Bitcoin Rune Dex Backend\n\nA TypeScript-based implementation of a decentralized exchange (DEX) for Bitcoin Rune tokens. This project provides essential DeFi features like swapping, AMM (Automated Market Making), liquidity provision, and yield farming, all built on the Bitcoin network using the Rune protocol.\n\n## Core Features\n\n### Token Operations\n\n- 🔄 Advanced Token Swapping with Multi-hop Routing\n- 💧 Liquidity Pool Management\n- 🌾 Yield Farming\n- 📊 Real-time Price Feeds\n- ⚙️ Automated Market Making (AMM)\n- ⛽ Gas-optimized Operations\n- 📬 Multi-token Distribution System\n\n### DeFi Functionality\n\n- 💱 Direct Token Swaps with Price Impact Calculation\n- 🛡️ Slippage Protection\n- 💰 Fee Collection and Distribution\n- 📈 APY Calculation and Tracking\n- 🏊‍♂️ Pool Creation and Management\n- 🎯 Impermanent Loss Protection\n\n## Prerequisites\n\n- Node.js (v14 or higher)\n- MongoDB\n- TypeScript\n- Web3 Provider (e.g., Mempool)\n- Compatible Wallets:\n  - Unisat\n  - XVerse\n  - Phantom\n  - MagicEden\n  - OKX\n\n## Technical Architecture\n\n### Token Swapping System\n\n- Multi-hop routing for optimal swap paths\n- Price impact calculation engine\n- Slippage protection mechanisms\n- UTXO management system\n\n### Liquidity Pool Management\n\n- Pool creation and initialization\n- Liquidity provision tracking\n- Fee collection and distribution\n- Emergency stop mechanisms\n\n### Yield Farming\n\n- Farm creation and management\n- Automated reward distribution\n- Staking mechanism implementation\n- Real-time APY calculations\n\n## Critical Issues \u0026 Solutions\n\n### 1. UTXO Management\n\n**Problem**: Users face difficulties with spent UTXO tokens during swaps\n\n**Solutions**:\n\n1. UTXO Splitting Strategy\n   - Split tokens into multiple UTXOs\n   - Pros: Avoids UTXO spent problems\n   - Cons: Higher transaction fees\n2. Spent UTXO Reference System\n   - Enables usage of spent UTXOs\n   - Limited to 24 swaps per block\n   - More cost-effective solution\n\n### 2. Multi-User Token Distribution\n\n**Problem**: OP_RETURN size limits multi-user token distribution\n\n**Solution**: Recursive Distribution Algorithm\n\n- Maximum 9 users per transaction (OP_RETURN size limit)\n- Implements recursive algorithm for larger distributions\n- Integrates with spent UTXO reference system\n- Optimized for gas efficiency\n  \n![image](https://github.com/user-attachments/assets/2c759c06-abbb-4347-9202-d2a4aa2eb641)\n\n### 3. High Concurrency Management\n\n**Problem**: System struggles with high-volume requests (100+ per second)\n\n**Solution**: LavinMQ Implementation\n\n- Queue-based request handling\n- Sequential processing\n- Improved system stability\n- Better resource management\n\n## Security Features\n\n### Transaction Security\n\n- Price oracle integration\n- Flash loan attack protection\n- Reentrancy guards\n- Rate limiting\n\n### Pool Security\n\n- Liquidity locks\n- Emergency circuit breakers\n- Role-based access control\n- Real-time monitoring\n\n## Monitoring \u0026 Analytics\n\n### Pool Metrics\n\n- Real-time liquidity tracking\n- Price monitoring\n- Volume analysis\n- Fee collection statistics\n\n### Performance Tracking\n\n- APY calculations\n- User activity metrics\n- Gas optimization analysis\n- Error monitoring and logging\n\n## Development\n\n```bash\n# Install dependencies\nnpm install\n\n# Start development server\nnpm run dev\n\n# Build for production\nnpm run build\n\n# Start production server\nnpm start\n```\n\n## Environment Configuration\n\nCreate a `.env` file:\n\n```env\nPORT=6000\nMONGO_URI=your_mongodb_connection_string\nMEMPOOL_API_KEY=your_mempool_api_key\nMAX_REQUESTS_PER_SECOND=100\nLAVINMQ_URL=your_lavinmq_url\n```\n\n## Contributing\n\n1. Fork the repository\n2. Create your feature branch (`git checkout -b feature/amazing-feature`)\n3. Commit your changes (`git commit -m 'Add some amazing feature'`)\n4. Push to the branch (`git push origin feature/amazing-feature`)\n5. Open a Pull Request\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frustyneuron01%2Fbitcoin-rune-dex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frustyneuron01%2Fbitcoin-rune-dex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frustyneuron01%2Fbitcoin-rune-dex/lists"}