Responses
Every successful response has this envelope:asOf is the time the response was built, in Unix seconds.
Amounts and prices
- Onchain amounts are integer strings in base units. USDC has 6 decimals (
"1002182000"is 1,002.182 USDC); vault shares have 18. - Amounts you send (
amountandsharesin the transaction actions) use the same base units, as positive integer strings without sign, decimals, exponent or leading zeros:"1000000"is 1 USDC. - In
vaults.history, share prices and TVL are decimal strings in the vault’s deposit asset, with that asset’s decimals ("1.002182"). - USD values are numbers for display. USDC counts as exactly $1.
- APY and APR values are numbers in percent:
3.55is 3.55% a year. Fees are in basis points:100is 1%.
Net APR
vaults.list and vaults.get give netApr.d7, netApr.d30 and netApr.inception: the vault’s net APR over the last 7 days, the last 30 days and since inception, in percent, from Lagoon’s indexer.
- Lagoon computes each window from the vault’s NAV updates. A window is
nullwhen Lagoon has no figure for it. For example,d7isnullwhen the vault’s NAV was not updated in the last 7 days. apy.valueis the 30-day net APR (apy.sourceis"live"), or the target set by Kamui ("target") while the live value is unavailable.
Time
- Timestamps are Unix seconds, in UTC.
- History points are one per UTC day:
tis the day’s start (00:00:00 UTC) andvthe last value recorded that day. Days without a change have no point. - Timestamps before 2024-01-01 or more than one day in the future are rejected.
Blocks
Actions that read the chain (vaults.list, vaults.get, users.positions and the transaction actions) pin every onchain read to one block and return it as blockNumber, so the values of one response are consistent with each other. The transaction actions also simulate at that block.
Transaction types
The transaction actions take atype in the body, and their answers echo it:
DEPOSIT: a USDC deposit (syncDeposit). Its fields areamountand, for a build,receiverandreferral.REDEEM_REQUEST: a redeem request (requestRedeem). Its field isshares.
type before you read the other fields. users.transactions uses the same names for the history rows of these transactions.
Addresses and chain
- Send an address as
0xand 40 hex characters, either all lowercase or in EIP-55 checksum form. Responses always return the EIP-55 form. - Any other mix of upper and lower case must be a valid EIP-55 checksum. An all-uppercase address fails the checksum, and a
0Xprefix fails the format. Both answer400 invalid_request, withdetailsnaming the field. - Wallet fields (
address,sender,receiver) refuse the zero address. - Ethereum mainnet only (
chainId1).
Vault slugs
The legacy slugs
advanced-vault (Balanced) and aggressive-vault (Boosted) are still accepted. Responses always carry the canonical slug.
Slugs are exact: lowercase letters, digits and single hyphens, at most 64 characters. The API does not change their case or trim them, so Stable-Vault, STABLE-VAULT and " stable-vault" answer 400 invalid_request. A well-formed slug that names no vault answers 404 vault_not_found.
Paging
users.transactions returns rows in pages, newest first.
- Send
limit(1 to 100, default 50) for the page size. - Each page has a
nextCursor. Send it back ascursor, with the sameaddress,slugandtypes, to get the next page.limitmay change between pages. - The cursor is opaque and signed, at most 256 characters. Send it back exactly as you got it: do not decode, change or build one. A changed cursor answers
400 invalid_cursor. - Stop when
nextCursorisnull. A page can hold fewer rows thanlimit, even none, before the last page. - The rows of one cursor chain stop at the page’s
snapshotAt, so an event indexed later never repeats or shifts a row. Start again from the first page to see newer rows.
Response times
In tests on Kamui’s staging environment, responses took 0.7 to 4 seconds, 1.8 seconds on average. Actions that read the chain or Lagoon’s indexer wait for those reads.- Set a client timeout of at least 15 seconds.
- Retry a
502,503or504with exponential backoff, within your limits.