Lending (Actions)
Deposit, withdraw, borrow, repay, mode, enable-collateral
Deposit
Build calldata for depositing into a lending pool. Identify the market via `marketUid` (format: `lender:chainId:address`). Omit `mode` and the API picks the path — a raw protocol call where possible, the 1delta composer otherwise — so send the returned transaction as-is: its `to` (and the approval spender) may be the composer rather than the protocol. To deposit on behalf of another address, pass `receiver`; `operator` signs and pays. Approval transactions are automatically filtered: if the user already has sufficient allowances, `permissions` (envelope) and `permissionTxns` (per-entry) will be empty. Pass `simulate=true` to include projected post-trade metrics (computed for the `operator`).
Deposit (simulate)
Build calldata for depositing into a lending pool and simulate post-trade state. Same parameters as GET. Optionally send a JSON body with current portfolio state (`balanceData`, `aprData`, `positions`) to receive projected post-trade metrics in the `simulation` field — if omitted, the API fetches balances on-chain automatically. Use the data returned by the user-positions endpoint directly — always include `positions` for accurate health-factor and borrow-capacity projections.
Deposit and borrow (one shot)
Supply collateral AND borrow against it in one request — no loop, no swap of the borrow. Legs run deposit → borrow.
Deposit and borrow (simulate)
Deposit and borrow with post-trade simulation. Same parameters as GET. Optionally send a JSON body with current portfolio state (`balanceData`, `aprData`, `positions`) to receive projected post-trade metrics in the `simulation` field — if omitted, the API fetches balances on-chain automatically. Use the data returned by the user-positions endpoint directly — always include `positions` for accurate health-factor and borrow-capacity projections.
Withdraw and repay (one shot)
Repay debt AND withdraw collateral in one request — the mirror of deposit-and-borrow. Legs run repay → withdraw (the repay frees the collateral). `repayMax` + `withdrawMax` is a full close.
Withdraw and repay (debt state / simulate)
Same parameters as GET. The JSON body may carry the live debt (`debtState`) used to size `repayMax`, and/or the simulation context.
Simulate a base lending operation on-chain
Build a base lending operation and **execute it against live chain state** before the user signs it.
Withdraw
Build calldata for withdrawing from a lending pool. Identify the market via `marketUid` (format: `lender:chainId:address`). Approval transactions are automatically filtered: if the user already has sufficient allowances, `permissions` (envelope) and `permissionTxns` (per-entry) will be empty. Pass `simulate=true` to include projected post-trade metrics. When on-chain deposit data is available and `amount` covers the full deposit balance, the API uses protocol-level max-withdraw mechanisms automatically (e.g. `maxUint256` or share-based redemption). If `isAll=true` but `amount` is less than the deposit balance, the API falls back to a partial withdrawal to avoid reverts.
Withdraw (simulate)
Build calldata for withdrawing from a lending pool and simulate post-trade state. Same parameters as GET. Optionally send a JSON body with current portfolio state (`balanceData`, `aprData`, `positions`) to receive projected post-trade metrics in the `simulation` field — if omitted, the API fetches balances on-chain automatically. Use the data returned by the user-positions endpoint directly — always include `positions` for accurate health-factor and borrow-capacity projections.
Borrow
Build calldata for borrowing from a lending pool. Identify the market via `marketUid` (format: `lender:chainId:address`). Approval transactions are automatically filtered: if the user already has sufficient allowances, `permissions` (envelope) and `permissionTxns` (per-entry) will be empty. Pass `simulate=true` to include projected post-trade metrics.
Borrow (simulate)
Build calldata for borrowing from a lending pool and simulate post-trade state. Same parameters as GET. Optionally send a JSON body with current portfolio state (`balanceData`, `aprData`, `positions`) to receive projected post-trade metrics in the `simulation` field — if omitted, the API fetches balances on-chain automatically. Use the data returned by the user-positions endpoint directly — always include `positions` for accurate health-factor and borrow-capacity projections.
Repay
Build calldata for repaying a loan. Identify the market via `marketUid` (format: `lender:chainId:address`). Approval transactions are automatically filtered: if the user already has sufficient allowances, `permissions` (envelope) and `permissionTxns` (per-entry) will be empty. Pass `simulate=true` to include projected post-trade metrics. When on-chain debt data is available and `amount` covers the full debt, the API uses protocol-level max-repay mechanisms automatically. If `isAll=true` but `amount` is less than the debt, the API falls back to a partial repay to avoid reverts.
Repay (simulate)
Build calldata for repaying a loan and simulate post-trade state. Same parameters as GET. Optionally send a JSON body with current portfolio state (`balanceData`, `aprData`, `positions`) to receive projected post-trade metrics in the `simulation` field — if omitted, the API fetches balances on-chain automatically. Use the data returned by the user-positions endpoint directly — always include `positions` for accurate health-factor and borrow-capacity projections.
Switch mode
Build calldata for switching the active risk-category ('mode') on a lender that supports it (e.g. Aave V3 e-mode).
Enable/disable collateral
Build calldata for toggling an asset as collateral. Supported on lenders with explicit collateral toggles (Aave V2/V3, Compound V2 via `enterMarkets`/`exitMarket`); other lenders return a 400. Identify the market via `marketUid` (format: `lender:chainId:address`).
Repay with aToken
Build calldata for repaying a loan using aTokens on Aave V3. Other lenders return a 400. Identify the market via `marketUid` (format: `lender:chainId:address`).
Claim rewards
Builds the claim for what [`/v1/data/rewards/user`](/1delta-api/rewards-user) reports, with the same filters, on ONE chain. **Every transaction must be sent by `account`.**