{"id":50908945,"url":"https://github.com/jose-compu/darkyield","last_synced_at":"2026-06-16T08:01:42.571Z","repository":{"id":360417842,"uuid":"1250062738","full_name":"jose-compu/darkyield","owner":"jose-compu","description":"DarkYield is an automated yield farming optimization platform with a local web UI. It fetches yield data from DefiLlama, optimizes portfolio allocations using mathematical models, and executes automated rebalancing strategies.","archived":false,"fork":false,"pushed_at":"2026-05-26T09:20:14.000Z","size":271,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-26T11:19:45.878Z","etag":null,"topics":["apr","apy","defi","ethereum","pools","solidity","web3","yield"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jose-compu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-26T09:14:32.000Z","updated_at":"2026-05-26T09:18:51.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/jose-compu/darkyield","commit_stats":null,"previous_names":["jose-compu/darkyield"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/jose-compu/darkyield","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jose-compu%2Fdarkyield","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jose-compu%2Fdarkyield/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jose-compu%2Fdarkyield/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jose-compu%2Fdarkyield/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jose-compu","download_url":"https://codeload.github.com/jose-compu/darkyield/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jose-compu%2Fdarkyield/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34396429,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-16T02:00:06.860Z","response_time":126,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["apr","apy","defi","ethereum","pools","solidity","web3","yield"],"created_at":"2026-06-16T08:01:41.809Z","updated_at":"2026-06-16T08:01:42.558Z","avatar_url":"https://github.com/jose-compu.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"```\n········································································\n:    '||                  '||                ||          '||       '|| :\n:  .. ||   ....   ... ..   ||  ..  .... ... ...    ....   ||     .. || :\n:.'  '||  '' .||   ||' ''  || .'    '|.  |   ||  .|...||  ||   .'  '|| :\n:|.   ||  .|' ||   ||      ||'|.     '|.|    ||  ||       ||   |.   || :\n:'|..'||. '|..'|' .||.    .||. ||.    '|    .||.  '|...' .||.  '|..'||.:\n:                                  .. |                                :\n:                                   ''                                 :\n········································································\n```\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![Node.js](https://img.shields.io/badge/node-%3E%3D18-339933?logo=node.js\u0026logoColor=white)](https://nodejs.org/)\n[![TypeScript](https://img.shields.io/badge/TypeScript-5.3-3178C6?logo=typescript\u0026logoColor=white)](https://www.typescriptlang.org/)\n[![React](https://img.shields.io/badge/React-18-61DAFB?logo=react\u0026logoColor=black)](https://react.dev/)\n[![Vite](https://img.shields.io/badge/Vite-646CFF?logo=vite\u0026logoColor=white)](https://vitejs.dev/)\n[![Express](https://img.shields.io/badge/Express-API-000000?logo=express\u0026logoColor=white)](https://expressjs.com/)\n[![DefiLlama](https://img.shields.io/badge/yields-DefiLlama-0E76FD)](https://defillama.com/yields)\n[![Paper Trading](https://img.shields.io/badge/mode-Paper%20Trading-22C55E)](https://github.com/jose-compu/darkyield)\n[![Tailwind CSS](https://img.shields.io/badge/Tailwind-38B2AC?logo=tailwind-css\u0026logoColor=white)](https://tailwindcss.com/)\n[![GitHub](https://img.shields.io/github/stars/jose-compu/darkyield?style=social)](https://github.com/jose-compu/darkyield)\n\n# DarkYield\n\nDarkYield is an automated yield farming optimization platform with a local web UI. It fetches yield data from DefiLlama, optimizes portfolio allocations using mathematical models, and executes automated rebalancing strategies.\n\n## Features\n\n- **Yield Pool Discovery**: Browse and filter pools by stablecoins, bluechips, long-tail, and more\n- **Paper Trading**: Test strategies with simulated funds before live trading\n- **Portfolio Optimization**: Mathematical optimization for risk-adjusted returns\n- **Automated Rebalancing**: Schedule-based or triggered rebalancing\n- **Risk Management**: Real-time risk monitoring with customizable triggers\n- **Performance Analytics**: Track returns, APY, volatility, and Sortino ratio\n- **Telegram Notifications**: Real-time alerts for rebalances, risks, and performance\n- **Dark/Light UI**: DefiLlama-inspired interface with theme switching\n\n## Architecture\n\n```\ndarkyield/\n├── backend/           # Node.js/Express API\n│   ├── src/\n│   │   ├── services/  # Core business logic\n│   │   ├── routes/    # API endpoints\n│   │   ├── config/    # Configuration\n│   │   └── utils/     # Utilities\n│   └── package.json\n├── frontend/          # React + Vite + Tailwind\n│   ├── src/\n│   │   ├── pages/     # Page components\n│   │   ├── components/# Reusable components\n│   │   └── hooks/     # React hooks\n│   └── package.json\n├── shared/            # Shared TypeScript types\n└── package.json       # Workspace root\n```\n\n## Quick Start\n\n### Prerequisites\n\n- Node.js \u003e= 18\n- npm or yarn\n\n### Installation\n\n1. Clone and install dependencies:\n```bash\ncd darkyield\nnpm install\n```\n\n2. Copy environment file:\n```bash\ncp .env.example .env\n# Edit .env with your settings\n```\n\n3. Start development servers:\n```bash\nnpm run dev\n```\n\nThe app will be available at:\n- Frontend: http://localhost:3000\n- Backend API: http://localhost:4000\n\n### Production\n\n1. Create production env from the template and set `NODE_ENV=production`:\n\n```bash\ncp .env.example .env\n# Edit .env: NODE_ENV=production, LOG_LEVEL=info, optional API keys, Telegram, etc.\n```\n\n2. Build and start the backend:\n\n```bash\nnpm run build\nNODE_ENV=production npm start\n```\n\n3. Serve the UI from `frontend/dist/` on the **same origin** as the API (reverse proxy). The frontend uses relative `/api` and `/ws` URLs — it does not embed `localhost:4000` in production builds.\n\nExample with nginx:\n\n```nginx\nlocation / {\n  root /path/to/darkyield/frontend/dist;\n  try_files $uri /index.html;\n}\nlocation /api {\n  proxy_pass http://127.0.0.1:4000;\n}\nlocation /ws {\n  proxy_pass http://127.0.0.1:4000;\n  proxy_http_version 1.1;\n  proxy_set_header Upgrade $http_upgrade;\n  proxy_set_header Connection \"upgrade\";\n}\n```\n\n| Setting | Development | Production |\n|---------|-------------|------------|\n| `NODE_ENV` | `development` | `production` |\n| Start command | `npm run dev` | `npm run build \u0026\u0026 npm start` |\n| UI | Vite dev server `:3000` | Static files from `frontend/dist/` |\n| API | Backend `:4000`, proxied by Vite | Backend `:4000`, proxied by nginx/Caddy |\n| Logs | Colored console | Console + `backend/logs/*.log` |\n| API errors | Message + stack trace | Generic message only |\n\nSee `.env.example` for the full variable list and production checklist.\n\n## Configuration\n\n### Environment Variables\n\n| Variable | Description | Default |\n|----------|-------------|---------|\n| `NODE_ENV` | `development` (local dev) or `production` (deployed server) | `development` |\n| `LOG_LEVEL` | Winston log level (`debug`, `info`, `warn`, `error`) | `info` |\n| `PAPER_TRADING` | Enable paper trading mode | `true` |\n| `TELEGRAM_BOT_TOKEN` | Telegram bot token | - |\n| `TELEGRAM_CHAT_ID` | Telegram chat ID | - |\n| `DEFAULT_REBALANCE_FREQUENCY` | Default rebalance schedule | `DAILY` |\n| `MIN_REBALANCE_INTERVAL` | Minimum minutes between rebalances | `60` |\n\n### Yield Modes\n\n- **Stablecoins**: USDC, USDT, DAI, etc. - Conservative, low-risk yields\n- **Bluechips**: ETH, WBTC on major protocols - Balanced risk-reward\n- **Long Tail**: Emerging protocols - Higher risk, higher potential returns\n- **Memecoins**: High-risk speculative strategies\n\n## API Endpoints\n\n### Pools\n- `GET /api/pools` - List all pools with filtering\n- `GET /api/pools/stablecoins` - Stablecoin pools only\n- `GET /api/pools/bluechips` - Bluechip pools only\n- `GET /api/pools/:id` - Pool details with chart data\n\n### Portfolios\n- `GET /api/portfolios` - List portfolios\n- `POST /api/portfolios` - Create new portfolio\n- `GET /api/portfolios/:id` - Portfolio details\n- `POST /api/portfolios/:id/rebalance` - Trigger rebalance\n- `GET /api/portfolios/:id/risk` - Risk assessment\n- `POST /api/portfolios/:id/optimize` - Run optimization\n\n### System\n- `GET /api/system/status` - System status\n- `POST /api/system/scheduler/start` - Start scheduler\n- `POST /api/system/scheduler/stop` - Stop scheduler\n\n## Development\n\n### Tech Stack\n\n**Backend:**\n- Node.js + Express\n- TypeScript\n- DefiLlama API\n- WebSocket for real-time updates\n- node-cron for scheduling\n\n**Frontend:**\n- React 18\n- TypeScript\n- Vite\n- Tailwind CSS\n- TanStack Query\n- Recharts\n- Zustand\n\n### Scripts\n\n```bash\nnpm run dev          # Start all dev servers\nnpm run dev:backend  # Backend only\nnpm run dev:frontend # Frontend only\nnpm run build        # Build all packages\nnpm start            # Start production server\n```\n\n## Risk Management\n\nDefault risk triggers:\n- **TVL Drop**: Exit if TVL drops 30% in 7 days\n- **APY Drop**: Exit if APY drops 50% from entry\n- **Max Drawdown**: Reduce position by 50% at 15% drawdown\n- **Volatility Spike**: Alert if volatility exceeds 3x normal\n\n## Security Notes\n\n- Paper trading is enabled by default\n- Live trading requires wallet configuration\n- Private keys should be encrypted\n- Use secure RPC endpoints for mainnet\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjose-compu%2Fdarkyield","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjose-compu%2Fdarkyield","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjose-compu%2Fdarkyield/lists"}