Management
Get Lending Positions
The loans behind one customer across every lending family, with their debt
GET
/
customers
/
api
/
manage
/
{customerId}
/
lending-positions
curl "https://api.trusset.org/customers/api/manage/cmt0k3b9x0004cghxw7r2d5ya/lending-positions" \
-H "X-API-Key: trusset_your_key_here"
const response = await fetch(
'https://api.trusset.org/customers/api/manage/cmt0k3b9x0004cghxw7r2d5ya/lending-positions',
{ headers: { 'X-API-Key': 'trusset_your_key_here' } }
);
const { data } = await response.json();
if (data.recordAsOf) {
console.warn(`Some debt is as recorded on ${data.recordAsOf}`);
}
{
"success": true,
"data": {
"customer": {
"id": "cmt0k3b9x0004cghxw7r2d5ya",
"name": "Acme Corp",
"referenceKey": null,
"externalId": "acme-001",
"walletAddress": "0xaBc123DEf456789012345678901234567890aBCD"
},
"positions": [
{
"family": "securities-v2",
"familyLabel": "External securities lending v2",
"bucket": "securities",
"marketId": "cmssh7p1k0001cghxq2m4v8rz",
"marketAddress": "0x70a0e25c7b768b87e658348b3b577678a173e038",
"marketLabel": "NYF1 / USDC",
"borrowAssetSymbol": "USDC",
"positionId": "cmt2a7c4e0011cghx9v5z3b8f",
"loanId": "5",
"borrower": "0xabc123def456789012345678901234567890abcd",
"principal": 25000,
"interest": 184.37,
"debt": 25184.37,
"collateral": 1200,
"healthFactor": "1.742318204517839211",
"status": "ACTIVE",
"active": true,
"openedAt": "2026-09-12T08:30:00.000Z",
"dueAt": "1796977800",
"customerId": "cmt0k3b9x0004cghxw7r2d5ya",
"attribution": "client-reference",
"attributedAt": "2026-09-12T08:31:05.000Z",
"live": true,
"lastUpdated": "2026-09-30T12:00:00.000Z"
},
{
"family": "stocks",
"familyLabel": "Stock lending",
"bucket": "stocks",
"marketId": "cmr8q2w5e0002cghx7n4b6v1z",
"marketAddress": "0x4e8b2d7f1a9c6e3b5d0f2a8c7e1b4d9f6a3c5e21",
"marketLabel": "USDC",
"borrowAssetSymbol": "USDC",
"positionId": "cmr9d4k1s0005cghx2p8w6y3n",
"loanId": "7",
"borrower": "0x1234f9a07c6b53d81e2a4f70c9b385d6014a7e52",
"principal": 1500,
"interest": 12.5,
"debt": 1512.5,
"collateral": 40,
"healthFactor": "2.35",
"status": "ACTIVE",
"active": true,
"openedAt": "2026-07-02T14:10:00.000Z",
"dueAt": null,
"customerId": null,
"attribution": "wallet",
"attributedAt": null,
"live": false,
"lastUpdated": "2026-09-29T22:00:00.000Z"
}
],
"totals": {
"total": 26696.87,
"stocks": 1512.5,
"securities": 25184.37,
"commodities": 0,
"gold": 0
},
"clients": [
{
"customerId": "cmt0k3b9x0004cghxw7r2d5ya",
"reference": "acme-001",
"name": "Acme Corp",
"attribution": "client-reference",
"debt": 25184.37,
"loans": 1
},
{
"customerId": null,
"reference": null,
"name": null,
"attribution": "wallet",
"debt": 1512.5,
"loans": 1
}
],
"basis": "mixed",
"asOf": "2026-09-30T12:00:00.000Z",
"recordAsOf": "2026-09-29T22:00:00.000Z"
},
"metadata": {
"requestId": "550e8400-e29b-41d4-a716-446655440000",
"timestamp": "2026-09-30T12:00:00.000Z"
}
}
Returns the loans behind one customer across every lending family: each loan’s principal, interest and debt, totals per asset class, and a roll-up per client. The customer record itself carries no debt figures, so this is where they are read.
A loan counts when it was borrowed from the customer’s primary or linked wallets, or when it is attributed to the customer through
clientReference on Open Loan. Only the external securities families carry attribution. A loan from one of the customer’s wallets that is attributed to a different customer is left out.
The debt is only as fresh as
basis says. A loan whose market could not be read, or one beyond the first 60 read in a call, carries the figure the platform last recorded, without interest accrued since. totals adds amounts across markets as plain numbers, with no currency conversion.Path Parameters
string
required
Customer ID. Wallets, reference keys and external IDs are not resolved here. Archived records are found too.
Query Parameters
string
default:"false"
Set to
true to also return loans that are no longer active. totals and clients count active loans either way.string
default:"true"
Set to
false to skip the chain and return the figures last recorded. Otherwise each active loan with an on-chain loan ID is read from its market, up to 60 per call. The figures read are saved to the platform’s record. A market that cannot be read falls back to its recorded figures without failing the call.Response Fields
object
Show child attributes
Show child attributes
object
The record the loans belong to:
id, name, referenceKey, externalId and walletAddress.array
One entry per loan, grouped by lending family and then by market, newest first within a market.
Show child attributes
Show child attributes
string
securities-v2, securities-nft, securities, stocks, commodities or gold.string
A readable name for the family, such as
External securities lending v2.string
The
totals key the loan counts under: securities, stocks, commodities or gold.string
Platform market ID.
string
Market contract, or
null.string
Collateral and borrow symbols joined with
/, such as NYF1 / USDC. Stock markets show the borrow symbol alone. Commodity and Tether Gold markets show null.string
Symbol of the asset borrowed. Always
USDC for Tether Gold, and null for commodity markets.string
The platform’s position record ID.
string
Loan ID on the market contract, or
null.string
The borrowing wallet, lowercased.
number
Outstanding principal in whole units of the borrow asset.
number
Accrued interest in the same units.
number
principal plus interest.number
Collateral as last recorded, never read live, in whole token units. Units for the non-fungible family.
string
Decimal health factor, or
null.string
The status the platform recorded, such as
ACTIVE, REPAID or LIQUIDATED.boolean
Whether the loan is open. On a row read from the chain this is the chain’s answer, so a loan closed on chain reads
false with zero debt while status can still show ACTIVE.string
ISO 8601.
string
Maturity as a Unix timestamp in seconds, for the
securities-v2 and securities-nft families. Otherwise null.string
The customer the loan is attributed to, or
null when it is counted by wallet.string
client-reference or wallet.string
When the attribution was recorded, or
null.boolean
Whether this call read the figures from the chain.
string
When the figures were read, for a live row. Otherwise when the platform’s record was last written.
object
Sum of
debt over active loans: total, securities, stocks, commodities and gold.array
Active debt per client, largest first. Here that is at most two entries: this customer for its attributed loans, and a
wallet entry with customerId null for unattributed loans on its wallets. Each carries customerId, reference, name, attribution, debt and loans. reference is the externalId, else the referenceKey, else the ID.string
chain when every active loan was read from the chain in this call, mixed when some were, record when none were.string
When the chain was read, or
null when nothing was read live.string
The oldest
lastUpdated among active loans that were not read live, or null.curl "https://api.trusset.org/customers/api/manage/cmt0k3b9x0004cghxw7r2d5ya/lending-positions" \
-H "X-API-Key: trusset_your_key_here"
const response = await fetch(
'https://api.trusset.org/customers/api/manage/cmt0k3b9x0004cghxw7r2d5ya/lending-positions',
{ headers: { 'X-API-Key': 'trusset_your_key_here' } }
);
const { data } = await response.json();
if (data.recordAsOf) {
console.warn(`Some debt is as recorded on ${data.recordAsOf}`);
}
{
"success": true,
"data": {
"customer": {
"id": "cmt0k3b9x0004cghxw7r2d5ya",
"name": "Acme Corp",
"referenceKey": null,
"externalId": "acme-001",
"walletAddress": "0xaBc123DEf456789012345678901234567890aBCD"
},
"positions": [
{
"family": "securities-v2",
"familyLabel": "External securities lending v2",
"bucket": "securities",
"marketId": "cmssh7p1k0001cghxq2m4v8rz",
"marketAddress": "0x70a0e25c7b768b87e658348b3b577678a173e038",
"marketLabel": "NYF1 / USDC",
"borrowAssetSymbol": "USDC",
"positionId": "cmt2a7c4e0011cghx9v5z3b8f",
"loanId": "5",
"borrower": "0xabc123def456789012345678901234567890abcd",
"principal": 25000,
"interest": 184.37,
"debt": 25184.37,
"collateral": 1200,
"healthFactor": "1.742318204517839211",
"status": "ACTIVE",
"active": true,
"openedAt": "2026-09-12T08:30:00.000Z",
"dueAt": "1796977800",
"customerId": "cmt0k3b9x0004cghxw7r2d5ya",
"attribution": "client-reference",
"attributedAt": "2026-09-12T08:31:05.000Z",
"live": true,
"lastUpdated": "2026-09-30T12:00:00.000Z"
},
{
"family": "stocks",
"familyLabel": "Stock lending",
"bucket": "stocks",
"marketId": "cmr8q2w5e0002cghx7n4b6v1z",
"marketAddress": "0x4e8b2d7f1a9c6e3b5d0f2a8c7e1b4d9f6a3c5e21",
"marketLabel": "USDC",
"borrowAssetSymbol": "USDC",
"positionId": "cmr9d4k1s0005cghx2p8w6y3n",
"loanId": "7",
"borrower": "0x1234f9a07c6b53d81e2a4f70c9b385d6014a7e52",
"principal": 1500,
"interest": 12.5,
"debt": 1512.5,
"collateral": 40,
"healthFactor": "2.35",
"status": "ACTIVE",
"active": true,
"openedAt": "2026-07-02T14:10:00.000Z",
"dueAt": null,
"customerId": null,
"attribution": "wallet",
"attributedAt": null,
"live": false,
"lastUpdated": "2026-09-29T22:00:00.000Z"
}
],
"totals": {
"total": 26696.87,
"stocks": 1512.5,
"securities": 25184.37,
"commodities": 0,
"gold": 0
},
"clients": [
{
"customerId": "cmt0k3b9x0004cghxw7r2d5ya",
"reference": "acme-001",
"name": "Acme Corp",
"attribution": "client-reference",
"debt": 25184.37,
"loans": 1
},
{
"customerId": null,
"reference": null,
"name": null,
"attribution": "wallet",
"debt": 1512.5,
"loans": 1
}
],
"basis": "mixed",
"asOf": "2026-09-30T12:00:00.000Z",
"recordAsOf": "2026-09-29T22:00:00.000Z"
},
"metadata": {
"requestId": "550e8400-e29b-41d4-a716-446655440000",
"timestamp": "2026-09-30T12:00:00.000Z"
}
}
Error Codes
| Code | HTTP | Cause |
|---|---|---|
NOT_FOUND | 404 | No customer with this ID on your instance |
FETCH_FAILED | 500 | The positions could not be read |
⌘I
curl "https://api.trusset.org/customers/api/manage/cmt0k3b9x0004cghxw7r2d5ya/lending-positions" \
-H "X-API-Key: trusset_your_key_here"
const response = await fetch(
'https://api.trusset.org/customers/api/manage/cmt0k3b9x0004cghxw7r2d5ya/lending-positions',
{ headers: { 'X-API-Key': 'trusset_your_key_here' } }
);
const { data } = await response.json();
if (data.recordAsOf) {
console.warn(`Some debt is as recorded on ${data.recordAsOf}`);
}
{
"success": true,
"data": {
"customer": {
"id": "cmt0k3b9x0004cghxw7r2d5ya",
"name": "Acme Corp",
"referenceKey": null,
"externalId": "acme-001",
"walletAddress": "0xaBc123DEf456789012345678901234567890aBCD"
},
"positions": [
{
"family": "securities-v2",
"familyLabel": "External securities lending v2",
"bucket": "securities",
"marketId": "cmssh7p1k0001cghxq2m4v8rz",
"marketAddress": "0x70a0e25c7b768b87e658348b3b577678a173e038",
"marketLabel": "NYF1 / USDC",
"borrowAssetSymbol": "USDC",
"positionId": "cmt2a7c4e0011cghx9v5z3b8f",
"loanId": "5",
"borrower": "0xabc123def456789012345678901234567890abcd",
"principal": 25000,
"interest": 184.37,
"debt": 25184.37,
"collateral": 1200,
"healthFactor": "1.742318204517839211",
"status": "ACTIVE",
"active": true,
"openedAt": "2026-09-12T08:30:00.000Z",
"dueAt": "1796977800",
"customerId": "cmt0k3b9x0004cghxw7r2d5ya",
"attribution": "client-reference",
"attributedAt": "2026-09-12T08:31:05.000Z",
"live": true,
"lastUpdated": "2026-09-30T12:00:00.000Z"
},
{
"family": "stocks",
"familyLabel": "Stock lending",
"bucket": "stocks",
"marketId": "cmr8q2w5e0002cghx7n4b6v1z",
"marketAddress": "0x4e8b2d7f1a9c6e3b5d0f2a8c7e1b4d9f6a3c5e21",
"marketLabel": "USDC",
"borrowAssetSymbol": "USDC",
"positionId": "cmr9d4k1s0005cghx2p8w6y3n",
"loanId": "7",
"borrower": "0x1234f9a07c6b53d81e2a4f70c9b385d6014a7e52",
"principal": 1500,
"interest": 12.5,
"debt": 1512.5,
"collateral": 40,
"healthFactor": "2.35",
"status": "ACTIVE",
"active": true,
"openedAt": "2026-07-02T14:10:00.000Z",
"dueAt": null,
"customerId": null,
"attribution": "wallet",
"attributedAt": null,
"live": false,
"lastUpdated": "2026-09-29T22:00:00.000Z"
}
],
"totals": {
"total": 26696.87,
"stocks": 1512.5,
"securities": 25184.37,
"commodities": 0,
"gold": 0
},
"clients": [
{
"customerId": "cmt0k3b9x0004cghxw7r2d5ya",
"reference": "acme-001",
"name": "Acme Corp",
"attribution": "client-reference",
"debt": 25184.37,
"loans": 1
},
{
"customerId": null,
"reference": null,
"name": null,
"attribution": "wallet",
"debt": 1512.5,
"loans": 1
}
],
"basis": "mixed",
"asOf": "2026-09-30T12:00:00.000Z",
"recordAsOf": "2026-09-29T22:00:00.000Z"
},
"metadata": {
"requestId": "550e8400-e29b-41d4-a716-446655440000",
"timestamp": "2026-09-30T12:00:00.000Z"
}
}
