Skip to main content

Instant Loans

Use instant loans for a checkout-style borrow flow. The SDK creates a generated Liquidium profile, returns transfer targets, and lets your app restore the loan from a short reference.

Flow

StepSDK callYour app does
Load market dataclient.market.listPools() and client.market.getAssetPrices()Show supported collateral and borrow assets
Validate amountsclient.quote.calculateLtv(...)Block invalid LTV or frozen-pool input before creation
Create loanclient.instantLoans.create(...)Store loan.ref and show loan.depositTarget
Track loanclient.instantLoans.get({ ref }) and client.activities.list({ shortRef: ref })Reload state and monitor deposits, borrows, and repayments
Repay loanRead loan.repaymentAsk the user to send loan.repayment.amount to loan.repayment.target

Create Request

FieldDescription
collateralPoolIdPool that receives the collateral deposit
borrowPoolIdPool the loan borrows from
collateralAssetCollateral asset symbol, for example "BTC"
borrowAssetBorrow asset symbol, for example "USDC"
collateralAmountCollateral amount in base units
borrowAmountBorrow amount in base units
ltvMaxBpsMaximum LTV in basis points, where 6_000n is 60%
depositWindowSecondsHow long the user has to send collateral
borrowDestinationExternal address that receives borrowed funds
refundDestinationExternal address that receives collateral refunds

borrowDestination and refundDestination can be address strings or account objects such as { type: "External", address: "bc1q..." }.

Restore State

Use the user-facing reference for refreshes, status pages, and support links:

const loan = await client.instantLoans.get({ ref: savedReference });

Use the numeric loan ID when your backend stores it:

const loan = await client.instantLoans.get({ loanId });

Use address recovery only when the user lost the reference:

const candidates = await client.instantLoans.findByAddress(address);

Candidates are lightweight. Load canonical state with client.instantLoans.get(...) before you show transfer targets or repayment amounts.