Skip to main content

DeFi Positions

Lending, borrowing, staking, farming, derivatives and reward positions across protocols and chains.

Base URL: https://api-v2.kryptos.io · Required Permission: portfolios:read

EndpointReturns
GET/v1/defiAll positions
GET/v1/defi/totalsHeadline DeFi numbers
GET/v1/defi/networksDistinct networks, for a filter dropdown
GET/v1/defi/stakingPositions in the staking category
GET/v1/defi/lendingPositions in the lending category
GET/v1/defi/farmingPositions in the farming category

Each of the six has a portfolio-scoped twin: /v1/defi/portfolio/{portfolioId}, /v1/defi/portfolio/{portfolioId}/totals, /staking, /lending, /farming. (There is no portfolio-scoped /networks.)

/staking, /lending and /farming are shorthand for /v1/defi?category=… and take the same parameters.

Request

curl -X GET "https://api-v2.kryptos.io/v1/defi?category=lending&limit=50" \
-H "Authorization: Bearer ACCESS_TOKEN"

Query Parameters

For /v1/defi and the category shortcuts:

ParameterTypeDefaultDescription
categorystringOne of the 18 categories listed below
detailTypestringProtocol-specific position subtype
integrationIdstringScope to one connected account
networkIdstringChain, by provider id — e.g. ethereum, base. Values come from /v1/defi/networks
searchstringFree-text match on protocol name
includeSpambooleanfalseInclude positions in assets flagged as spam
offsetinteger0Rows to skip
limitinteger50Rows to return, 1–1000

/v1/defi/totals accepts only includeSpam. /v1/defi/networks accepts includeSpam and integrationId.

Categories

lending, borrowing, staking, locked, farming, leveraged_farming, reward, trading, derivatives, options_seller, options_buyer, perpetuals, insurance, insurance_seller, insurance_buyer, governance, vesting, other.

Any other value returns 400 Validation failed.

Response — position list

{
"success": true,
"data": [
{
"id": "defi_7c1a9e",
"owner": {
"provider": "ethereum",
"providerPublicName": "Ethereum",
"publicAddress": "0xab...",
"walletId": "int_44de",
"logoUrl": "https://...",
"alias": "Main EVM"
},
"protocolId": "aave-v3",
"protocolName": "Aave V3",
"protocolLogoUrl": "https://...",
"chain": "ethereum",
"positionName": "USDC Supply",
"detailTypes": ["common"],
"positionIndex": "0",
"category": "lending",
"pool": {},
"portfolio": {},
"totalValue": { "price": 52000, "baseCurrency": "USD", "timestamp": 1721088000000, "source": "debank" },
"debtValue": { "price": 12000, "baseCurrency": "USD", "timestamp": 1721088000000, "source": "debank" },
"netValue": { "price": 40000, "baseCurrency": "USD", "timestamp": 1721088000000, "source": "debank" },
"positionTimestamp": 1721088000000,
"isActive": true,
"tags": [],
"notes": null
}
],
"totalCount": 9,
"offset": 0,
"limit": 50,
"hasMore": false
}
FieldTypeDescription
idstringPosition id
ownerobjectThe account holding the position — provider, providerPublicName, publicAddress, walletId, logoUrl, alias
protocolIdstringProtocol identifier, e.g. aave-v3 — joins to DeFi protocol metadata
protocolNamestringProtocol display name
protocolLogoUrlstringProtocol icon
chainstringChain the position is on
positionNamestringHuman label for the position
detailTypesarrayProtocol-specific subtypes
positionIndexstringDisambiguates multiple positions of the same type in one protocol
categorystringOne of the categories above
poolobjectProtocol-specific pool detail — shape varies by protocol
portfolioobjectProtocol-specific position detail, including supplied and reward tokens
totalValueobjectGross position value
debtValueobjectBorrowed value, where the position has debt
netValueobjecttotalValue − debtValue
positionTimestampnumberUnix ms the position was last observed
isActivebooleanStill open
tags, notesarray, stringUser annotations

totalValue, debtValue and netValue are price objects, not bare numbers: { price, baseCurrency, timestamp, source }. Read .price for the amount.

pool and portfolio are protocol-defined and intentionally untyped — their keys differ per protocol. Don't assume a fixed schema.

Response — /v1/defi/totals

{
"success": true,
"data": {
"totalBalance": 52000,
"borrowed": 12000,
"earnedRewards": 840,
"connectedProtocols": 4,
"baseCurrency": "USD"
}
}
FieldTypeDescription
totalBalancenumberGross value of all positions
borrowednumberTotal debt
earnedRewardsnumberValue of unclaimed rewards
connectedProtocolsnumberDistinct protocols with an open position
baseCurrencystringCurrency of the values

Response — /v1/defi/networks

{
"success": true,
"data": [
{ "providerId": "ethereum", "name": "Ethereum", "logoUrl": "https://...", "walletCount": 2 }
]
}

Use providerId as the networkId filter value.

Protocol metadata

Protocol reference data — TVL, chains, tags, portfolio support — is a separate, workspace-independent resource requiring only authentication:

Endpoint
GET/v1/defi-metadata
GET/v1/defi-metadata/{id}
ParameterTypeDefaultDescription
idstringFilter by protocol id
namestringFilter by name
chainstringFilter by chain
tagsstringComma-separated tags
isSupportPortfoliostringtrue or false
isVisiblestringtruetrue or false
sortBystringtvltvl, priority, name or totalUserCount
sortOrderstringdescasc or desc
limitinteger501–200
offsetinteger0Rows to skip
{
"success": true,
"data": [],
"pagination": { "limit": 50, "offset": 0, "total": 312 }
}

Note this is a fourth pagination shape, local to this endpoint: limit/offset/total inside a pagination object, with no hasMore. /v1/defi-metadata/{id} returns 404 { "success": false, "error": "Protocol not found" } for an unknown id.