Both networks serve the routes below. Keep the API network aligned with the
selected RPC, contracts, token addresses, and wallet signing passphrase.
Routes and types
owner must be a valid Stellar G... account or C... contract address.
URL-encode it when constructing a path. These reads require no API key.
Invalid owners, page sizes, cursors, and usage values return HTTP 400.
Listing membership does not mean an action is currently available. Read the
spoke flags and capacities, then simulate the selected transaction.
Public types and OpenAPI schemas belong to the SDK:
positions key.
The lightweight client checks HTTP status, array bodies, and safe pagination.
It does not validate every response field against a schema at runtime.
Shared token fields
Every asset and position leg contains:
The API reads names and logos from token metadata. Listed asset information
can supply a fallback name or symbol. Prices come from lending oracle market
data. You do not need a separate price feed or token-catalog join to display
these responses.
Position fields
Each
PositionAsset in supplied or borrow also contains:
Preserve raw strings. Display numbers are not exact transaction-sizing or
contract-admission inputs. The API applies interest indexes; do not apply
legacy RAY balance conversion to v1
amountRaw.
Asset and spoke fields
An asset item describes one(hubId, sac) market. One SAC can appear in several
items when it belongs to several hubs.
Each spoke item contains:
Capacity contains amountRaw as a base-unit string, amount as a whole-token
decimal string, and usd as a display number. Each can be null. Zero means
no estimated headroom. Supply capacity considers spoke cap usage and known
pool backing. Borrow capacity also considers shared liquidity, the cash buffer,
and maximum utilization.
These booleans and capacities do not check every global pause, account rule,
wallet balance, or authorization. A ready response does not guarantee that
a transaction will succeed.
Missing data and freshness
priceStatus contains valid, stale, deviation, and timestamp. The timestamp
is in Unix seconds; null means no market timestamp was available. An
unusable price makes priceUsd null. Dependent USD and risk values can become
unavailable while raw balances remain.
ready: the inputs checked by this builder are available.stale: indexed ownership or market information needs reconciliation.incomplete: required rows, metadata, prices, or computation inputs are missing.
incomplete takes precedence over stale; a missing
logo can make an item incomplete. Keep known balances visible. Do not replace
missing data with zero or treat the NFT image as evidence of a current balance.
Assets use Cache-Control: public, s-maxage=10. Wallet positions use
Cache-Control: no-store. The backend also caches computed asset bodies for
5 seconds, position bodies for 3 seconds, and token metadata for 600 seconds.
It queries indexed NFT ownership on every wallet request before reusing a body.
These intervals do not prove data is only that old. Indexing, state snapshots,
oracle reads, metadata, and HTTP caches have separate freshness limits.
The ownership query reads indexed inventory, not live owner_of state.
Use contract views or simulation where current ledger state matters.
Refresh after confirmed success and when the wallet or network changes.
Keep a refreshing state while the indexer catches up. Do not repeat a successful
transaction because the API still shows the previous snapshot.
Pagination
Positions acceptlimit from 1 to 100; the default is 50. cursor is opaque
and scoped to the owner, network, and NFT collection. Do not construct it.
Follow Link with rel="next" until absent, including after an empty page.
Resolve relative links against the current page URL. Every leg of one NFT stays
on the same page. Order follows indexed NFT identifiers, not numeric account
ids or health factor. Several pages are not an atomic ledger snapshot.
The SDK’s read.positions(owner) collects pages, rejects redirects and
cross-endpoint links, and detects cycles. Direct implementations need equivalent
URL and cycle checks. Keep HTTP failures distinct from empty results.
Legacy reads
The unversioned/stellar-lending/users/{owner}/positions returns an object
with position legs and RAY quantities. It differs from this v1 array contract.
Advanced readers can still use context, reserve, live-state, and detailed-market
endpoints. Do not apply their balance conversions to v1 raw amounts.
