Architecture Overview
Last updated
Last updated
This document provides a structured explanation of the API flow for interacting with the Deframe service. The flow consists of several stages, each responsible for specific actions across loans, swaps, and yield products.
Retrieve quotes and protocol information using the API.
Fetch available protocols and their current rates
Get quotes for loans, swaps, or yield positions
Compare rates across different protocols
Request transaction data (bytecode) needed for execution.
Provides the bytecode for executing transactions
Supports multiple transaction types:
Loans (borrow/repay)
Swaps
Yield positions (deposit/withdraw)
Transaction signature and propagation are handled entirely on your side
Deframe does not hold, manage, or pass any funds through its smart contracts
Users sign transactions themselves
Transaction propagation is handled by the user
Full custody remains with the user
After transaction execution, Deframe monitors positions and provides updates.
Track wallet activity and positions
Monitor health factors for loans
Track yield earnings
View swap history
Configure alerts for position monitoring.
Webhook notifications
Push notifications
Email alerts
Liquidation warnings for loans
APY change notifications for yield positions
Additional features to enhance user protection and experience.
Integration with DeFiSaver for loan protection
Optional liquidation protection
Auto-compounding for yield positions
Best-rate routing for swaps
100 requests per minute per IP address
1000 requests per hour per API key
The API uses standard HTTP response codes:
200: Success
400: Bad Request
401: Unauthorized
429: Too Many Requests
500: Internal Server Error
This architecture ensures:
Trustless operations with no fund custody
Comprehensive position monitoring
Real-time alerts and notifications
Integration with protection mechanisms
Support for multiple DeFi products (loans, swaps, yield)
For detailed implementation guides, see:
Swap Tutorials