Skip to main content
Version: v1

Treasures Finance Manager API

API for fund managers who publish a strategy on Treasures. You publish the target weights of the strategy you manage; Treasures rebalances every follower's wallet towards them and pays you your share of the fees those followers pay.

What you can do.

  • Publish a book (POST /strategies/{strategyId}/signals)
  • read the strategies assigned to you with their signal history and performance (GET /strategies, GET /strategies/{strategyId}/signals, GET /strategies/{strategyId}/performance)
  • read the separately managed accounts of an SMA strategy with their fills, holdings and daily valuations (GET /strategies/{strategyId}/accounts, GET /strategies/{strategyId}/accounts/{address}/fills, .../holdings, .../performance)
  • read the orders a strategy's books produced (GET /strategies/{strategyId}/orders)
  • read your fee ledger (GET /fees)
  • from a signed-in dashboard session, list, mint and revoke your own API keys (/keys).

A dashboard session can also publish a book, within 900 seconds of a sign-in.

On a retail strategy you never see, and cannot ask about, an individual follower. The aggregates you receive are follower counts, the total value of your followers' portfolios once at least three followers contribute to it, and a signal's order counts by state once at least three followers hold orders on it. On an SMA strategy that minimum does not apply, and you see each account by its own wallet addresses, never the client behind it; but if anyone other than a separately managed account has ever followed it, those aggregates are withheld on every read.

Every {strategyId} accepts the strategy's id or its slug.

Onboarding. Treasures creates your manager account and assigns the strategy you will publish into. Your first key, or the link to your dashboard sign-in, comes from Treasures; after that you can mint and revoke keys yourself. Ask your Treasures contact for a strategy to be assigned to you or to set the address your fees are paid to; neither can be done through this API.

Auth. Every route requires a credential; there is no anonymous route on this API. Two credentials are accepted:

ActionManager API keyDashboard session
Publish a book (POST /strategies/{strategyId}/signals)yesyes, with a recent sign-in
Read your fee ledger (GET /fees) and every other readyesyes
List, mint and revoke your keys (/keys)no, 403 session_requiredyes

Recent sign-in. Publishing a book from a dashboard session, and minting a key, need a sign-in made in the last 15 minutes: otherwise the request is refused 403 reauth_required; sign out and in again, then retry. Only signing in counts. Linking a new login method to a signed-in session does not, and neither does a login method first linked in the last 15 minutes.

Treasures confirms the sign-in with its identity provider on each such request; if that check cannot complete, the request is refused 503 sign_in_check_unavailable and nothing is written. A manager API key is never asked for a sign-in.

A manager API key goes in the X-API-Key header (see ManagerApiKey); it is the credential for your publishing system. A dashboard session is your own Privy login on the Treasures dashboard, as a Member of the Organization your manager account belongs to: send the Privy access token as Authorization: Bearer <token> and the Privy identity token in the Privy-Id-Token header (see ManagerSession and PrivyIdToken). Both answer reads identically. When X-API-Key is present it is the only credential checked: a bad key is refused even if a valid session is also sent.

Organizations and permissions. A login that is a Member of more than one Organization with a manager account names the one it acts for in the X-Organization-Id header; without it the request is refused 400 organization_required, and naming an Organization the login is not a Member of is 404 organization_not_found.

A Member who is not an Admin may only do what its permissions grant:

  • strategies:view for the strategy list, signals, performance and publishing a book
  • invested_wallets:view for the accounts, their fills, holdings and performance, and the orders feed
  • fees:view for the fee ledger; a separately managed account's address and transactions on it also need invested_wallets:view (fees:update grants nothing any more and is being retired)
  • api_keys:view, api_keys:update and api_keys:delete to list, mint and revoke keys.

Anything else is refused 403 permission_denied; an Admin holds every permission. A suspended Organization refuses every Member session 403 organization_suspended; the manager API keys keep working. Permissions never apply to an API key.

Breaking change (v1). A request that carries no credential at all is now 401 unauthorized. It used to be 401 invalid_api_key. A key that is present but malformed, unknown or revoked still answers invalid_api_key or key_revoked, so a publishing system that always sends its key sees no change.

Wire format. Weights and USDC amounts are JSON strings to avoid float drift. Timestamps are ISO-8601 UTC strings; trading_day is a YYYY-MM-DD date.

Rate limits. Per manager, one budget per credential kind: 60 requests per minute shared by every key you hold, and a separate 120 requests per minute for dashboard sessions. A dashboard can never use up the budget your keys publish with, nor the reverse. A 429 carries a Retry-After header in seconds; wait that long before retrying. A book published from a dashboard session counts against the session budget, not the key's.

Bodies must be JSON. Send Content-Type: application/json on every request that carries a body; any other content type is refused 415 before the body is read.

Authentication​

Your manager API key, cmk_ followed by 24 alphanumeric characters, issued by Treasures or minted by you (POST /keys). It is shown to you once at issue and cannot be retrieved afterwards, so store it when you receive it; if you lose it, revoke it yourself (DELETE /keys/{keyId}) and mint a new one.

The machine credential: it publishes a book with no sign-in step, and it cannot list, mint or revoke keys. When a request carries both a key and a session, only the key is checked.

A malformed or unknown key is 401 invalid_api_key and a revoked key (by you or by Treasures) is 401 key_revoked. A key for a different Treasures API (an integrator tik_ key, a wallet twk_ key) is not accepted here.

Security Scheme Type:

apiKey

Header parameter name:

X-API-Key