AI agents often need on-demand liquidity — to settle a swap, bridge funds, or execute a trade. Instead of holding idle capital, an agent can borrow from Sprinter: lock collateral, draw credit in under 2 seconds, use the funds, and repay when done.This skill works with any agent framework. We provide:
An MCP server for agents that speak Model Context Protocol (LI.FI, Claude, Cursor, ChatGPT, etc.)
A direct API pattern for agents using plain HTTP
Example Repo
Full MCP server + demo agent script — clone and run.
Agent needs liquidity → Lock USDC as collateral (sprinter-lock-collateral) → Draw credit (sprinter-draw-credit) → Use the funds (swap, bridge, settle — agent's own logic) → Repay debt (sprinter-repay-debt) → Unlock collateral (sprinter-unlock-collateral)
Every Sprinter endpoint returns { calls: ContractCall[] } — unsigned transaction calldata. The agent’s wallet signs and broadcasts. No custody, no API keys for on-chain operations.
A minimal autonomous agent that borrows, uses funds, and repays:
const SPRINTER_API = "https://api.sprinter.tech";const USDC = "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913";interface ContractCall { to: string; data: string; value: string;}async function sprinterGet(path: string): Promise<any> { const res = await fetch(`${SPRINTER_API}${path}`); if (!res.ok) throw new Error(`Sprinter ${res.status}: ${await res.text()}`); return res.json();}async function executeCalls(calls: ContractCall[], signer: any): Promise<string> { let lastHash = ""; for (const call of calls) { const tx = await signer.sendTransaction({ to: call.to, data: call.data, value: call.value || "0", }); const receipt = await tx.wait(); if (!receipt || receipt.status !== 1) throw new Error(`Reverted: ${tx.hash}`); lastHash = tx.hash; } return lastHash;}/** * Borrow from Sprinter, use the funds, and repay. * * @param account - Agent's wallet address * @param signer - Ethers signer for the wallet * @param borrowAmt - Amount to borrow (USDC smallest unit) * @param collateral - Amount of collateral to lock (USDC smallest unit) * @param useFunds - Callback where the agent uses the borrowed funds */async function borrowAndRepay( account: string, signer: any, borrowAmt: string, collateral: string, useFunds: () => Promise<void>) { // 1. Lock collateral const lockData = await sprinterGet( `/credit/accounts/${account}/lock?amount=${collateral}&asset=${USDC}` ); await executeCalls(lockData.calls, signer); // 2. Borrow const drawData = await sprinterGet( `/credit/accounts/${account}/draw?amount=${borrowAmt}&receiver=${account}` ); await executeCalls(drawData.calls, signer); // 3. Agent uses the funds await useFunds(); // 4. Repay const repayData = await sprinterGet( `/credit/accounts/${account}/repay?amount=${borrowAmt}` ); await executeCalls(repayData.calls, signer); // 5. Unlock collateral const unlockData = await sprinterGet( `/credit/accounts/${account}/unlock?amount=${collateral}&asset=${USDC}` ); await executeCalls(unlockData.calls, signer);}
The useFunds callback is where the agent plugs in its own logic — call LI.FI’s API to bridge, execute a DEX swap, settle a card payment, etc. The borrow/repay lifecycle wraps around whatever the agent needs to do.