API reference
This reference covers the documented SDK revision, with upcoming additions explicitly marked. Create the client on your backend with createT3trisClient({ apiKey }). Each method below returns a Promise unless noted otherwise.
Types are exported by @t3tris-labs/sdk. See the versioned client interface, input definitions and entities for exact optional fields. The wire contract is available as OpenAPI JSON.
Shared inputs
| Type | Shape |
|---|---|
VaultRef | { chainId: number, address: Address } |
PageInput | { limit?: number, cursor?: string } |
Page<T> | { items: T[], nextCursor?: string } |
SessionAuth | { session: string } |
Address | A full 0x-prefixed EVM address |
In signatures below, input? means the whole argument is optional. Session arguments are mandatory for the listed protected methods. The API key is always supplied by the client, including authentication calls.
Catalog and billing
| Method | Arguments | Result |
|---|---|---|
catalog.listChains | input?: PageInput | Page<Chain> |
catalog.listAssets | input?: { chainId?, limit?, cursor? } | Page<Asset> |
billing.getPricing | None | BillingPricing |
billing.getUsage | None | UsageSummary |
Asset records include latestPriceUsd when known. Use live pricing from billing.getPricing, rather than a hardcoded subscription amount. Organization payment and subscription mutation are managed in Curate.
Vault reads
| Method | Arguments | Result |
|---|---|---|
vaults.list | input?: ListVaultsInput | Page<Vault> |
vaults.get | ref: VaultRef | Vault |
vaults.getMany | refs: VaultRef[] (at most 100) | Vault[] |
vaults.listHistory | ref, input?: HistoryInput & PageInput | Page<VaultSnapshot> |
vaults.getComposition | ref | VaultComposition or null |
vaults.listActivity | ref, input?: ActivityInput | Page<ActivityEvent> |
vaults.listAnnotations | ref, input?: PageInput | Page<VaultAnnotation> |
vaults.getGovernance | ref | VaultGovernance |
ListVaultsInput accepts chainIds, assetAddress, curatorAddress, kind (sync or async), verified, search, sort (tvl, newest, name), direction (asc, desc) and pagination. Customer results use the calling key's attachments.
History range accepts 1d, 1w, 1m, 3m, 1y or all. Activity categories accepts deposit, redeem, valuation, settlement, roles, fees, config and transfer. Keep filters unchanged while paging.
Protected vault content
| Method | Arguments | Result |
|---|---|---|
vaults.updateMetadata | ref, input: VaultMetadataInput, auth: SessionAuth | Vault |
vaults.createAnnotation | ref, input: AnnotationInput, auth | VaultAnnotation |
vaults.updateAnnotation | ref, annotationId: string, input: AnnotationInput, auth | VaultAnnotation |
vaults.deleteAnnotation | ref, annotationId: string, auth | void |
Metadata fields include displayName, description, curatorName, curatorUrl, visibility, category, showComposition, compositionWallets, depositDisclaimer and depositDisclaimerTrigger (once or every). These writes need an authorized wallet session.
Annotations require ts (Unix seconds) and title. Optional fields are body, links (up to 20 labeled { title, url } links) and txHash for a transaction link. Passing links: [] clears links on edit; txHash is used only when links is omitted.
Accounts
| Method | Arguments | Result |
|---|---|---|
accounts.portfolio | { address } | AccountPortfolio |
accounts.listVaults | { address, limit?, cursor? } | Page<Vault> |
accounts.listPositions | { address, chainId?, limit?, cursor? } | Page<Position> |
accounts.getPositionPnl | { address, vault: VaultRef } | PositionPnlHistory |
accounts.listActivity | { address, chainId?, categories?, limit?, cursor? } | Page<ActivityEvent> |
accounts.listFavorites | { address } | AccountFavorites |
accounts.setFavorite | { address: wallet, chainId, vault, pinned? }, auth | AccountFavorites |
accounts.deleteFavorite | { address: wallet, chainId, vault }, auth | void |
Only favorite writes require auth. The session wallet must match address. setFavorite also requires that the wallet holds a position or operates the vault as curator, owner or deployer; otherwise it returns 403. pinned defaults to true; false stores an explicit negative pin, while deleteFavorite removes the pin and restores the default behavior. A portfolio contains up to 200 indexed positions and their vaults without a cursor. Use accounts.listPositions for a paginated complete inventory. See deposit lifecycle states.
Deleting a pin that does not exist returns 404 not_found; this method is not
an idempotent "ensure absent" operation.
Historical position PnL
accounts.getPositionPnl is included in the published npm package @t3tris-labs/sdk@0.8.2. Install the package as shown in the quick start; no Git revision pin is needed.
import { createT3trisClient, type Address } from "@t3tris-labs/sdk";
export async function positionPnl(address: Address, vault: Address, chainId: number) {
const client = createT3trisClient({ apiKey: process.env.T3TRIS_API_KEY });
return client.accounts.getPositionPnl({ address, vault: { chainId, address: vault } });
}
PositionPnlHistory identifies the wallet, chain and vault with ownerAddress, chainId and vaultAddress. Each entry in points contains ts, block, valueAssets, netContributedAssets and pnlAssets. Amounts are exact decimal strings in underlying asset base units. Cumulative PnL is historical position value minus net contributions, not a USD return or annualized percentage.
Deposits, withdrawals and external share transfers are capital flows, not yield. Values use the balances and price at each sampled historical block, never today's shares applied retroactively. Archive reads or incomplete entry history return 502 upstream_error; they do not produce a fabricated zero series. The response is cached for 60 seconds and is bounded to 500 samples, retaining wallet-flow blocks alongside sampled valuations. This is an address-scoped read: an API key is required, but no wallet signature or session is needed.
Events
| Method | Arguments | Result |
|---|---|---|
events.list | input?: { after?, types?, limit?, cursor? } | Page<StreamEvent> |
events.subscribe | filter?: { since?, live?, types? }, options?: { signal?, onProgress?, onReady? } | AsyncIterableIterator<StreamEvent> |
events.browserTicket | input: BrowserStreamTicketInput, options?: { signal? } | StreamTicket (upcoming) |
after and since are exclusive sequence checkpoints. Streaming needs stream scope, a server runtime with WebSocket support and explicit shutdown handling. Follow the events guide for durable checkpointing.
events.browserTicket is a server-only addition for the next SDK release, not part of the published 0.8.2 package. It requires a specially provisioned unlimited integration credential with stream access; ordinary customer keys receive 403. Its input contains the exact browser origin, a server-verified ingress clientId, and optional wallet address / current vault: { chainId, address } filters. The result is { ticket, expiresAt }, not a durable API credential. See scoped browser grants for the security and connection contract.
Organization keys
| Method | Arguments | Result |
|---|---|---|
keys.create | { name, scopes?, monthlyQuota? } | { id, secret } |
keys.attachVault | { keyId?, vaults: VaultRef[] } | KeyVaultsResult |
keys.detachVault | { keyId?, vaults: VaultRef[] } | KeyVaultsResult |
keys.listVaults | input?: KeyVaultsPageInput | Page<Vault> |
keys.hasVaults | refs: VaultRef[] | boolean[] |
Creation and attachment changes require manage. Keys are independent within the same organization. scopes defaults to public and stream; supported scopes are public, stream, manage. Save the returned secret once; it is not retrievable later. keyId targets an active key in your organization; omit it to target the calling key. Supplying keyId requires manage even when it identifies the calling key; listing with keyId omitted requires public.
Attachment batches contain 1–100 exact references and are atomic and idempotent. KeyVaultsResult contains the target keyId and normalized processed vaults. hasVaults accepts 0–100 references and preserves order/duplicates; availability is not membership. listVaults uses keyset pagination (default 50, max 200) ordered by chain/address. Keep the same target key when following its cursor. See backend integration for provisioning and failure handling.
Authentication
| Method | Arguments | Result |
|---|---|---|
auth.createSiweNonce | { address, domain, chainId? } | { nonce, message } |
auth.verifySiwe | { message, signature } | AuthSession |
auth.whoami | auth: SessionAuth | Whoami |
auth.logout | auth | void |
auth.logoutAll | auth | void |
AuthSession contains a secret token and an account. Whoami contains the account and its organization memberships. See authentication for challenge binding and server-side session storage.