{"id":43933298,"url":"https://github.com/stakekit/api-recipes","last_synced_at":"2026-02-07T00:20:01.780Z","repository":{"id":119728756,"uuid":"595586154","full_name":"stakekit/api-recipes","owner":"stakekit","description":"Practical code examples demonstrating how to interact with Yield.xyz APIs.","archived":false,"fork":false,"pushed_at":"2025-12-19T18:25:39.000Z","size":1340,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-12-21T09:06:10.621Z","etag":null,"topics":["recipes","self-custody","staking"],"latest_commit_sha":null,"homepage":"https://yield.xyz","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/stakekit.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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-01-31T11:49:16.000Z","updated_at":"2025-12-19T18:25:43.000Z","dependencies_parsed_at":"2024-11-07T13:20:58.994Z","dependency_job_id":"f92616b9-bfa4-41ac-be49-0f10626a0613","html_url":"https://github.com/stakekit/api-recipes","commit_stats":null,"previous_names":["stakekit/api-recipes"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/stakekit/api-recipes","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stakekit%2Fapi-recipes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stakekit%2Fapi-recipes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stakekit%2Fapi-recipes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stakekit%2Fapi-recipes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stakekit","download_url":"https://codeload.github.com/stakekit/api-recipes/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stakekit%2Fapi-recipes/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29181340,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-06T23:15:33.022Z","status":"ssl_error","status_checked_at":"2026-02-06T23:15:09.128Z","response_time":59,"last_error":"SSL_read: 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":["recipes","self-custody","staking"],"created_at":"2026-02-07T00:20:01.090Z","updated_at":"2026-02-07T00:20:01.769Z","avatar_url":"https://github.com/stakekit.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Yield.xyz API Recipes\n\nPractical code examples demonstrating how to interact with Yield.xyz APIs for DeFi operations.\n\n## Overview\n\nYield.xyz provides unified APIs for decentralized finance:\n\n- **Yields API** - Engage with yield opportunities across multiple networks and protocols\n- **Perps API** - Trade perpetual futures with leverage across multiple providers\n\nThese recipes demonstrate:\n\n- Discovering and entering yield opportunities\n- Trading perpetual futures with full position management\n- Managing active positions and executing pending actions\n- Signing and submitting transactions with ethers.js\n- Building schema-driven interactive CLI applications\n\n## Prerequisites\n\n- Node.js (v16+) and pnpm installed\n- Wallet mnemonic phrase\n- Yield.xyz API key (obtain from [Yield.xyz dashboard](https://dashboard.yield.xyz))\n\n## Setup\n\n1. Clone this repository\n2. Create a `.env` file by copying the example:\n\n```bash\ncp .env.example .env\n```\n\n3. Fill in your `.env` file with:\n   - `MNEMONIC`: Your wallet's seed phrase (12 or 24 words)\n   - `YIELDS_API_KEY`: Your Yield.xyz API key (for yields/staking)\n   - `PERPS_API_KEY`: Your Yield.xyz API key (for perpetuals trading)\n4. Install dependencies:\n\n```bash\npnpm install\n```\n\n## Available Recipes\n\n### Yields\n\nEngage with yield opportunities across multiple networks and protocols:\n\n```bash\npnpm yields\n```\n\n**Features:**\n- Browse 2000+ yield opportunities across all networks \n- Search and filter by APY, network, token, and protocol\n- Enter positions with dynamic argument collection (validators, LP ranges, etc.)\n- View balances by type (active, claimable, withdrawable, etc.)\n- Execute pending actions (claim rewards, unstake, withdraw, etc.)\n- Fetch validator metadata for staking protocols (APY, status, voting power)\n- Support for concentrated and classic liquidity pools\n- Transaction status polling with explorer links\n\n**Supported:**\n- 80+ networks (Ethereum, Cosmos, Polkadot, Solana, Tron, and more)\n- All yield types: staking, restaking, lending, vaults, liquidity pools\n- Schema-driven UI that automatically adapts to each protocol\n\n### Perps Trading\n\nTrade perpetual futures with leverage:\n\n```bash\npnpm perps\n```\n\n**Features:**\n- View account balances and margin utilization\n- Browse markets with real-time prices and funding rates\n- Execute leveraged trades (long/short positions)\n- Manage existing positions (close, adjust leverage, set TP/SL)\n- View and cancel orders\n- Deposit and withdraw collateral\n- Schema-driven UI that adapts to each provider\n\n**Supported Providers:**\n- Hyperliquid\n- More providers coming soon\n\n## How It Works\n\nAll recipes follow an interactive, schema-driven approach:\n\n1. **Connect** - API key and wallet authentication\n2. **Discover** - Browse available markets, providers, or opportunities\n3. **Execute** - Perform actions with real-time argument collection\n4. **Sign** - Sign transactions locally with your wallet\n5. **Submit** - Submit to the blockchain or provider\n\nThe recipes automatically adapt to API changes using schema-driven UI generation.\n\n## API Documentation\n\nFor complete API documentation and integration guides:\n- **Perps API**: [docs.yield.xyz](https://docs.yield.xyz/reference) - Perpetual futures trading\n- **Yields API**: [docs.yield.xyz](https://docs.yield.xyz/reference) - Staking and yield opportunities\n\n## Development\n\n```bash\n# Build TypeScript\npnpm build\n\n# Format code\npnpm format\n\n# Clean build artifacts\npnpm clean\n```\n\n## Security\n\n⚠️ **Never commit sensitive data**:\n- Keep your `.env` file private\n- Never share your mnemonic phrase\n- Protect your API keys\n\nUse `.env.example` as a template only.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstakekit%2Fapi-recipes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstakekit%2Fapi-recipes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstakekit%2Fapi-recipes/lists"}