Events

Loans & Loan Events

Query your loan positions and lifecycle events. All data is scoped to the authenticated wallet.

GET
/api/v1/wallet/{address}/loans
Loans of any wallet on every main, offset paged. Filter by source (hub/vault/leverage/vesting), main, hub, active and status (active, expired, liquidated, repaid, claimable). Rows add status, secondsToLiquidation, collateralValue (one live multicall per page, cached 10 s), collateralUsdE18, debtUsdE18 (with their usdSource), creationTime, updatedAt, coreOwner and hubBorrower. Alias for your own wallet: GET /api/v1/loans.
Auth: API Key (the /me alias: Session or API Key)

Query Parameters

ParamTypeDescription
sourcestringhub, vault, leverage, or vesting
mainstringMain token address or key
hubstringLoan hub address
activebooleantrue or false
tokenstringCollateral token address. With active=true: the one open leverage position / hub loan on that token
pagenumberPage number (default: 1)
limitnumberItems per page (default: 20, max: 100)
Response
{
  "data": [{
    "wallet": "0x...",
    "source": "hub",
    "ecosystem": "0x...",
    "loanId": 1,
    "hubId": 1,
    "token": "0x...",
    "collateralAmount": "1000000000000000000",
    "borrowedAmount": "500000",
    "fullAmount": "510000",
    "liquidationTime": 1710000000,
    "isLiquidated": false,
    "active": true,
    "daysCount": 30,
    "expiresAt": "2026-04-15T00:00:00.000Z",
    "creationTime": 1707408000,
    "txHash": "0x...",
    "isLeverage": false,
    "hub": "0x...",
    "hubBorrower": "0x...",
    "coreOwner": "0x...",
    "vestingId": null,
    "liquidatedAmount": null,
    "claimable": "0",
    "claimed": "0",
    "liquidationClaim": "0",
    "leverageBuyAmount": null,
    "cashedOut": null,
    "levCashIn": null,
    "levCashOut": null,
    "levCollateralOut": null,
    "main": "0x...",
    "pairAsset": "0x...",
    "pairDecimals": 6,
    "pairSymbol": "USDG",
    "expired": false,
    "claim": null
  }],
  "pagination": { "total": 5, "page": 1, "limit": 20, "hasMore": false }
}

borrowedAmount, fullAmount, leverageBuyAmount, cashedOut are raw units of pairAsset. borrowedAmount is history: what was received when the loan opened (plus adds and increases), never reduced; the debt is fullAmount. cashedOut (gross, from partial sells) is null for a loan that is not a leverage position. levCashIn, levCashOut and levCollateralOut are a leverage position's lifetime cash flows in raw units of pairAsset (null on every other loan): levCashIn is the own cash put in (the open and every add, every repay, partial or full, including a repay with another token at the pair amount it paid, and extension fees paid in cash); levCashOut is the cash paid to the wallet (every sale net of the exit fee, and what a refinancing extension pays out); levCollateralOut is the collateral sent back to the wallet (released by repays, the liquidation leftover claimed) at the stored price at its block, and null when that price is not stored. The lifetime P&L is levCashOut + levCollateralOut + the net of a full close now − levCashIn; unlike leverageBuyAmount and cashedOut, these are never scaled down by a repay or clamped by an add. collateralAmount, liquidatedAmount, claimable, claimed, liquidationClaim are units of the collateral token (18 decimals). liquidationClaim = claimable − claimed: what can still be collected. A loan is named by (main, hub, hubBorrower, hubId) for a hub, vault or vesting loan and by (main, coreOwner, loanId) for a leverage position: hubId alone and loanId alone repeat across mains, hubs and vaults. ecosystem is the main (same value as main). claim names the call that collects or settles a liquidated loan, and who may send it: the wallet for a leverage position or a hub loan, the vesting's beneficiary for a vesting loan (needed even when nothing is left, to unlock the vesting). A vault loan's liquidation settles itself, so its claim is null. seizableAfter (unix seconds) is the liquidation time + 365 days, the end of the claim window: after it the leftover may no longer be claimable, and a claim then reverts "Nothing to claim". repay is a ready repay call for an open leverage position or hub loan: args[1] = 2^256-1 repays all, a smaller args[1] repays part of the debt; approve the pair asset to to for at least min(amount, fullAmount). It is null for vault and vesting loans.

GET
/api/v1/wallet/{address}/loans/events
Loan lifecycle events of any wallet on every main, newest first, cursor paged (?cursor=blockNumber:logIndex). loanId is null until the core id is known; details is data parsed. Alias for your own wallet: GET /api/v1/loans/events.
Auth: API Key (the /me alias: Session or API Key)

Query Parameters

ParamTypeDescription
sourcestringFilter by source
actionstringcreated, repaid, extended, increased, liquidated, partial_sell, liquidation_claimed, refinance_surplus, liquidation_settled, added (leverage: collateralAdded, borrowedAdded, fullAmountAdded, initialBuy; same loanId, end date unchanged), repaid_partial (repaid, collateralReleased, fullAmountLeft; the position stays open), seized (seized, collateral-token units; an unclaimed liquidation leftover taken 365 days after the liquidation)
mainstringMain token address or key
hubstringLoan hub address
pagenumberPage number (default: 1)
limitnumberItems per page (default: 20, max: 100)
Response
{
  "data": [{
    "wallet": "0x...",
    "source": "hub",
    "action": "created",
    "loanId": 1,
    "hubId": 1,
    "main": "0x...",
    "hub": "0x...",
    "txHash": "0x...",
    "logIndex": 12,
    "blockNumber": 12345678,
    "usdE18": "500000000000000000",
    "usdSource": "fixed",
    "data": "{\"borrowed\":\"500000\"}",
    "timestamp": "2026-03-20T00:00:00.000Z",
    "pairAsset": "0x...",
    "pairDecimals": 6,
    "pairSymbol": "USDG",
    "details": { "borrowed": "500000" }
  }, {
    "wallet": "0x...",
    "source": "leverage",
    "action": "repaid",
    "loanId": 4,
    "hubId": null,
    "main": "0x...",
    "hub": null,
    "txHash": "0x...",
    "logIndex": 31,
    "blockNumber": 12345900,
    "usdE18": "812000000000000000000",
    "usdSource": "fixed",
    "timestamp": "2026-03-21T00:00:00.000Z",
    "pairAsset": "0x...",
    "pairDecimals": 6,
    "pairSymbol": "USDG",
    "details": {
      "repaid": "812000000",
      "paidWith": { "tokenIn": "0x...", "amountIn": "815000000", "pairOut": "815200000", "refund": "3200000" }
    }
  }],
  "pagination": { "limit": 20, "hasMore": false, "nextCursor": null }
}

wallet is the borrower even when a keeper sent the transaction. liquidated rows come from ALiquidator.Liquidated; the unclaimed residual is liquidationClaim on /api/v1/loans. Vault and vesting loan steps have source vault / vesting. Pair-asset amounts inside data are raw units of pairAsset.

usdE18 (+ usdSource) is the USD × 1e18 of the row's amount at the block time, stamped at sync: created = borrowed, added = borrowedAdded, increased = the extra borrowed, repaid / repaid_partial = repaid, partial_sell = received, liquidated = the debt, refinance_surplus = mainPairReceived, liquidation_claimed = the collateral claimed at the token's price; null on extended, seized and liquidation_settled, or when the price was unknown.

Repay rows: a full repaid (hub or leverage) carries repaid, the pair asset the main took (the debt). repaid_partial carries repaid, collateralReleased (the same share of the collateral returned, token units) and fullAmountLeft (the debt left, raw pair units; a hub row takes it from the paired core event). When the repay was paid with another token, paidWith = { tokenIn, amountIn (tokenIn's own units), pairOut (leverage, ASwap.repayWith) or stableOut (hub, repayLoanWith) (raw pair units the route delivered), refund (raw pair units sent back) }.