Documentation
Athanor, for the systems that work with it.
The tenant API for a dealer's or a custodian's own software: how a workload proves who it is without a secret, what it can read and do, what it is told as orders move. And Alembic, the data graph the product and the API are both built on, for the engineers working in the app.
For partnersAPI
Getting in
- AuthenticationTwo ways in, neither a secret. A workload presents its platform's identity, or signs with a private key; Athanor holds nothing that can mint a token.
- SDK@athanor-trade/sdk: the published operations typed from the schema, and a client that authenticates, sends documents by hash, and reads refusals as typed errors.
The API
- Published operationsThe operation set the SDK ships, per kind. Most integrations never write a query.
- The order's machineDraft an order, then advance it one step at a time. The record names the steps that are legal right now, and a refusal names what it was waiting for.
- RefusalsRead the errors array even on a 200. Every refusal has a stable code, and most carry the fact you need to recover.
- WebhooksThe order's facts pushed to your endpoint as they happen, on the Standard Webhooks spec, signed with a key you can verify offline, retried for three days, replayable from Settings.
- Registered documentsA client registers the operations its build will run, by hash. On live it can accept nothing else, so a query that was never registered cannot run against you.
- Budgets and headersWhat a document costs, what a client may spend per hour, what every answer says about it, and what a 429 means.
For engineersAlembic
The graph
- The builder, then the graphTwo phases, because declarations reference each other in both directions: declare against a builder, build the graph once from the roots.
- Declare a nodeA node is a record: identified, batched over one service, cached once per entity. Four things are load-bearing, and one row property makes tenant isolation possible.
- Objects, fields and the Query rootAn object is fields with no identity and derives from its parent. Seven field kinds, field arguments, nullable edges and null propagation.
- Fragments and viewsA fragment is a declared field slice whose return type is the mask. A view is a fragment that renders itself; match is the inline fragment per union variant.
- The entity cacheOne use cache function for the whole graph, keyed by typename and id, with a bucketed clock so a cached read is deterministic.
- Queriesquery binds a selector to the Query root and decodes its input at the boundary. Nesting is where the page's boundaries are; execute hands back each part on its own, never a promise for the whole.
- MutationsAn ordinary Effect function with a declared input and a payload, registered under its name, recording the writes it made so the cache tags derive from the graph.
- Wiring: layers and the runtimeThe graph reconciles its own requirements once, off the request path; request-scoped services come per execute; there is no codegen.
- TestingA test builds the graph the way the app does and hands it a runtime and a request, so it exercises the wiring that ships.
Reference
- Do's and don'tsThe rules that keep the graph honest. Each one exists because its opposite was built once and had to be taken out.
- Common mistakesSymptom to cause, for the things that go wrong when adopting the graph.
- The API bridgeThe tenant API's GraphQL schema is compiled from the same graph the pages read. One declaration, two surfaces, and a schema that cannot drift from the product.
- Sandbox API
- https://sandbox.athanor.trade/api/graphql
- Live API
- https://app.athanor.trade/api/graphql
- Token endpoint
- https://auth.athanor.trade/api/oauth2/token
- Grants
- token exchange (RFC 8693) · client_credentials with private_key_jwt
- Secrets
- none issued
- SDK
- npm install @athanor-trade/sdk
- Webhooks
- Standard Webhooks, v2a (Ed25519)
- Budgets
- 1,500 requests · 250,000 points, per client per hour