1delta API v1
Unified API for DeFi data and actions.
Authentication & rate limits
Most endpoints are public. Send your API key as the x-api-key header to lift rate limits — without a key, requests are throttled to 10 per 15 minutes per IP. Get a key at https://auth.1delta.io/.
Response Envelope
Every endpoint returns a consistent JSON envelope. Integrators can rely on the same top-level shape regardless of the endpoint called.
Success
{
"success": true,
"data": { ... },
"actions": { "transactions": [...], "permissions": [...] } | null
}
data— Informational payload (market data, quotes, simulation results, user positions, etc.). Present on all responses;nullwhen the endpoint only produces transaction calldata with no additional info.actions— Transaction calldata and approval/permission transactions that the caller should execute on-chain. Only populated by action endpoints;nullon data endpoints.actions.transactions— Array of{ to, data, value }objects ready to be sent as EVM transactions.actions.permissions— Envelope-level array of approval/permission transactions (ERC-20 approves, credit delegations) that must be executed before the main transactions. Each entry has a human-readabledescription.
Note on
permissionsvspermissionTxns: the envelope exposes a single deduplicatedactions.permissionsarray. Inside richer action responses (e.g. loop alternatives), each individual quote also carries its ownpermissionTxns— the per-quote subset needed if that specific alternative is executed. Most integrators only needactions.permissions.
Error
{
"success": false,
"error": { "code": "MISSING_PARAM", "message": "marketUid is required" }
}
error.code— Machine-readable error code (e.g.MISSING_PARAM,INVALID_PARAM,ACTION_FAILED,NOT_FOUND,ORIGIN_FAILED).error.message— Human-readable description.
Data (/v1/data/*)
Cacheable market data, prices, yields, and user positions. These endpoints always return actions: null — only the data field is populated.
Actions (/v1/actions/*)
Transaction builders organized by category:
- Lending — deposit, withdraw, borrow, repay, mode, enable-collateral, repay-with-atoken
- Loop — leverage, close, collateral-swap, debt-swap (see also Data › Loop for range calculations)
- Swap — spot, x-chain (coming soon)
- Allocate — batch operations
All action endpoints support GET (query parameters only) and POST (query parameters + JSON body for post-trade simulation). The allocate endpoint is POST-only.
For loop and swap operations, omit account for a quote-only response (data contains quotes, actions is null), or include it to build full transaction calldata (actions is populated with ready-to-send transactions).
Simulation (POST)
POST the same query parameters as GET, plus a JSON body with the user's current balanceData and aprData. The response includes the standard fields plus a simulation object in data with projected post-trade health factor, borrow capacity, and APR data.
Execution Modes (lending only)
- direct (default): Raw protocol interaction (deposit/withdraw/borrow/repay only)
- proxy: Routes through 1delta composer contracts
Authentication
- API Key: ApiKeyAuth
Optional. Without a key, requests are limited to 10 per 15 minutes. Get your key from https://auth.1delta.io/
Security Scheme Type: | apiKey |
|---|---|
Header parameter name: | x-api-key |