Developers

Data conventions

Reference2 min read
Markdown ↓
On this page

IDs, addresses, and time#

_id, vaultId, tokenId, and chainId are database identifiers used by API routes; they are different from a vault address or the numeric network chainID. Blockchain addresses are 0x values. Chain records include numeric chainID and hexadecimal hex.

block.timestamp is a Unix timestamp in seconds. Fields named startDate, endDate, createdAt, and updatedAt are ISO-8601 date-time strings when present. Do not compare an ID's lexical order to a block height or timestamp.

Amounts, prices, and rates#

Stored snapshot quantities such as totalSupply, price, TVL.token, fees, interest, and transaction tokenAmount are serialized as integer strings. Use BigInt or an arbitrary-precision decimal library, never JavaScript number, for their arithmetic. Convert a token amount using that token's decimals; a vault share amount uses the relevant vault/share-token precision. Keep raw values for storage and arithmetic.

The aggregate endpoint /v1/vaults/performances is an exception: its TVL, creditExtended, and nested TVL.token/TVL.USD are already normalized decimal strings with eight fractional digits. For example, aggregate "25.00000000" means 25 units. Parse these with a decimal library and do not divide them by token decimals again.

Rates such as APR, APY, feePercentage, and rate subfields are display-ready percentage points where the schema describes them as rates. For example, 5 represents five percent, not 0.05. Contract parameters such as managementFee have their own scaling and are not interchangeable with feePercentage. Stored USD values and price fields have endpoint-specific precision; preserve their string representation and do not infer a price's scale from the underlying token's decimals alone.

Freshness and confirmation#

Vault blocks, latest blocks, token blocks, performances, and epochs are materialized snapshots. A latest block is the newest snapshot available to the service, which can lag the chain; an epoch can be in progress or finalized later. Use block number and timestamp to label the observation, cache historical records, and obtain on-chain confirmation before a value-moving or settlement decision.