# Deframe API > Deframe API is a DeFi aggregation platform that enables cross-chain and same-chain token swaps, yield strategies, and DeFi protocol integrations. The API provides quotes, transaction bytecode generation, and monitoring for blockchain transactions across Ethereum, Polygon, Arbitrum, Optimism, Base, Solana, and Bitcoin networks. Deframe operates as a trustless platform where users maintain full custody of their funds. The API aggregates multiple swap providers (1inch, Jupiter, TeleSwap, Mayan) and DeFi protocols (Aave, Morpho, Lido, Compound) to provide optimal rates and routes for swaps and yield opportunities. **Key Constraints**: All requests require an API key via `x-api-key` header. Rate limits: 100 requests/minute and 1000 requests/hour per API key. Quotes expire after 5 minutes. AmountIn must be between 1 USDC and 3,000 USDC; AmountOut between 5 BRLA and 17,000 BRLA. ## Overview - [Introduction](https://docs.deframe.io/): Welcome to Deframe API with key features, supported networks, and quick examples - [Quickstart](https://docs.deframe.io/getting-started/quickstart): Get your first API call running in 5 minutes - [Architecture Overview](https://docs.deframe.io/getting-started/architecture): System architecture, trustless operation flow, and API patterns - [Authentication](https://docs.deframe.io/getting-started/authentication): How to authenticate API requests using API keys - [Why Deframe](https://docs.deframe.io/getting-started/why-deframe): The case for using Deframe vs building in-house - [Error Codes](https://docs.deframe.io/error-codes): Complete reference for all API error codes, HTTP status codes, and resolution guidance ## Guides ### Yield Strategies - [Check Protocol Info](https://docs.deframe.io/guides/yield/check-protocol-info): Retrieve yield protocol information including APY rates and terms - [Deposit to Yield](https://docs.deframe.io/guides/yield/deposit): Generate transaction bytecode for depositing into yield positions - [Check Open Positions](https://docs.deframe.io/guides/yield/check-positions): Retrieve and monitor current yield positions for wallet addresses - [Withdraw from Yield](https://docs.deframe.io/guides/yield/withdraw): Generate transaction bytecode for withdrawing from yield positions ### Swaps - [Get a Quote](https://docs.deframe.io/guides/swaps/get-quote): Learn how to request quotes for same-chain and cross-chain token swaps - [Execute Swap](https://docs.deframe.io/guides/swaps/execute-swap): Generate bytecode and execute token swaps using quotes ## Code Examples - [Same-Chain Swap](https://docs.deframe.io/examples/javascript/same-chain-swap): Complete example of executing a same-chain token swap with ethers.js and viem - [Cross-Chain Swap](https://docs.deframe.io/examples/javascript/cross-chain-swap): Complete example of executing cross-chain token swaps with bridge integration - [Strategy Deposit](https://docs.deframe.io/examples/javascript/strategy-deposit): Complete example of depositing funds into DeFi yield strategies ## API Reference - [API Introduction](https://docs.deframe.io/api-reference/introduction): Overview of the Deframe API with base URL, authentication, and quick links - [Health Endpoints](https://docs.deframe.io/api-reference/health/get-health): Check API and strategy health status - [Swap v2 — Get Quote](https://docs.deframe.io/api-reference/swap-v2/get-quote): Request a quote for same-chain or cross-chain token swaps - [Swap v2 — Generate Bytecode](https://docs.deframe.io/api-reference/swap-v2/get-bytecode): Generate ready-to-sign transaction data from a confirmed quote - [Swap v2 — Check Status](https://docs.deframe.io/api-reference/swap-v2/get-status): Poll swap transaction status through its lifecycle - [Strategies — List](https://docs.deframe.io/api-reference/strategies/get-strategies): List all available DeFi yield strategies - [Strategies — Get by ID](https://docs.deframe.io/api-reference/strategies/get-strategy): Retrieve a single strategy with full details - [Strategies — Deposit Bytecode](https://docs.deframe.io/api-reference/strategies/deposit): Generate bytecode for depositing into a yield strategy - [Strategies — Withdraw Bytecode](https://docs.deframe.io/api-reference/strategies/withdraw): Generate bytecode for withdrawing from a yield strategy - [Wallets — Positions](https://docs.deframe.io/api-reference/wallets/get-positions): Retrieve open yield positions for a wallet address - [Customers — Account Info](https://docs.deframe.io/api-reference/customers/get-customer): Get customer account and API key details ## Protocols & Integrations - [Supported Protocols](https://docs.deframe.io/protocols): Full list of supported DeFi protocols and networks with chain availability - [Widget Integration Overview](https://docs.deframe.io/widget-integration): Integration paths for API-only and SDK widget flows - [EarnWidget Integration](https://docs.deframe.io/widgets/earn-widget): Full customer integration for yield UI + API + tx execution - [SwapWidget Integration](https://docs.deframe.io/widgets/swap-widget): Full customer integration for same-chain and cross-chain swap UI + API - [processBytecode Contract](https://docs.deframe.io/widgets/process-bytecode): Required host tx bridge status lifecycle - [LLM Integration Playbook](https://docs.deframe.io/widgets/llm-playbook): Prompt template and acceptance checklist for AI-assisted integrations - [Privy Integration](https://docs.deframe.io/external-integrations/privy-integration): Integrate Deframe with Privy wallet authentication - [Fireblocks Integration](https://docs.deframe.io/external-integrations/fireblocks-integration): Integrate Deframe with Fireblocks custody - [Dynamic Integration](https://docs.deframe.io/external-integrations/dynamic-integration): Integrate Deframe with Dynamic wallet management ## Key Concepts **Same-Chain Swaps**: Token swaps executed on a single blockchain network using DEX aggregators like 1inch. Transactions complete immediately with 2-3 steps: approve, swap, and optional tracking. **Cross-Chain Swaps**: Token swaps across different blockchain networks using bridge providers like TeleSwap or Mayan. Transactions take several minutes and go through states: pending → crossing → propagated → success. **Yield Strategies**: Deposit tokens into DeFi lending and staking protocols to earn passive income. The API supports Aave, Morpho, Lido, Compound, and other protocols across multiple networks. **Bytecode Generation**: The API generates ready-to-execute transaction data (bytecode) that users sign and broadcast using their own wallets. Deframe never has custody of funds. **Quote System**: Quotes expire after 5 minutes. Each quote includes a quoteId, expected amounts, provider information, and deadline timestamp. **Webhook Notifications**: Configure webhooks to receive real-time updates for cross-chain transaction status changes. ## Optional - [API Status](https://deframe.betteruptime.com): Real-time API uptime and incident history - [OpenAPI Spec](https://docs.deframe.io/openapi.yaml): Full OpenAPI 3.0 specification for code generation and tooling - [LLM Privy Integration Guide](https://docs.deframe.io/llms-privy-integration.txt): End-to-end one-shot prompt for Privy-based widget integration