Overview
The Sprinter Credit API lets you draw USDC credit against locked DeFi collateral. This guide walks through the full credit draw lifecycle: lock collateral, check your credit line, draw USDC, repay, and unlock.This example demonstrates the core credit draw flow. For a complete card issuer integration — including KYC, card issuance, and deposit address routing — see the Card Issuer Integration quickstart.
Integration Steps
Lock Collateral
Lock collateral to activate a credit line. A single This returns the credit configuration including a The Returns
/lock call handles everything — including optional wrapping into a yield-bearing earn vault.First, fetch available earn strategies from the protocol config:strategies field with available earn vaults and their IDs.Then lock collateral — add the earn param to auto-wrap into a vault in the same transaction:- Lock + Earn Vault
- Lock (No Vault)
earn parameter wraps the asset into a yield-bearing vault before locking — collateral earns while the credit line is active. Use a strategy ID from /credit/protocol.{ calls: ContractCall[] } — execute in the user’s wallet. Once locked, the credit line is active.Check Available Credit
Display See Credit Engine for how health factor and LTVs work.
totalCollateralValue (spendable credit) and healthFactor in your UI.Draw Credit
With collateral locked, draw USDC from the user’s credit line. The
Returns For card programs that need JIT draws inside an authorization webhook, see the webhook handler example:
/draw endpoint is a general-purpose credit draw — the receiver can be any address (your settlement address, a card issuer’s deposit address, etc.).| Parameter | Description |
|---|---|
account | User’s wallet address (borrower) |
amount | USDC in lowest denomination (6 decimals — $50 = 50000000) |
receiver | Address to receive the USDC (e.g. your settlement address, a card issuer’s deposit contract) |
{ calls: ContractCall[] } — execute on-chain to deliver USDC to the receiver.A 0.50% origination fee is deducted from each draw. See Fees for the full fee schedule.
Authorization Webhook Handler
Complete TypeScript implementation showing how to wire
/draw into a card authorization flow with signature validation, credit checks, and sub-2-second execution.Repayment
Credit runs on a 30-day billing cycle with a 7-day grace period. Repay before the due date to avoid the 15% overdue APR. See Fees.
- Check Balance Owed
- Build Repayment
Delegated Credit Draws
Some use cases (like card authorizations) require credit draws without user interaction. Your backend needs the ability to draw credit on behalf of users. There are two approaches:- Non-Custodial (Smart Accounts)
- Operator Contract (Server-Side)
Users deploy a smart account (e.g. ERC-4337) that can execute draw transactions autonomously. The user retains full custody — the smart account automates signing based on pre-configured rules.How it works:
- User deploys or connects a smart account
- User configures a session key or module that authorizes your backend to call
/draw - At draw time, your backend submits the draw calldata through the smart account
Integration Notes
Signer Security
Signer Security
Whether using smart accounts or the operator contract, the signing key that executes draws must be secured with HSM or cloud KMS (AWS KMS, GCP Cloud KMS) in production. Never store it in environment variables on shared infrastructure.
Receiver Address
Receiver Address
The
receiver in the draw call is the address that receives USDC. This could be your own settlement address, a card issuer’s deposit contract, or any other address depending on your use case.Fail Closed
Fail Closed
Always decline if the draw cannot be confirmed on-chain. A declined transaction is recoverable; an unauthorized spend is not.
Health Monitoring
Health Monitoring
Poll
healthFactor from the info endpoint and surface alerts in your UI. See Risk Management for liquidation thresholds and collateral tiers.Try It
Want to see the full credit draw lifecycle running end-to-end? The Credit Draw Demo executes every step above — lock, credit check, draw, repay, unlock — using real Sprinter API calls on Base. It also supports a dry-run mode for testing without on-chain transactions.Credit Draw Demo
Clone the repo, add a wallet with USDC on Base, and run
npm run ui to launch the demo dashboard. See the README for full setup instructions.Related
Card Issuer Integration
Full card issuer integration with KYC, card issuance, and deposit routing.
Credit Engine
Health factor, LTVs, and liquidation mechanics.
Credit API Reference
Full API reference with interactive playground.