Skip to content
Fossa

Protocol reference

Typed accounts, instructions, payment rules, and state transitions.

The router program manages inference offers, matching, reservations, and settlement. Its accounts also connect model groups to token backing. This reference describes the current program source. Source behavior alone does not establish which revision a deployment runs.

Program addresses

Account relationships

A market identifies payment and council configuration. Each model points to its terms and capacity books. Providers publish offers in those books. A user account holds free funds in a token vault. A booking binds that user to an eligible provider and stores the agreed payment terms.

Lists restrict matching and set a surcharge. An assigned model group can receive the protocol share in a separate backing vault. Model groups explain that relationship.

Contract reference

  • Providers and lists: Registration, membership, creation payment, and list charges.
  • Models: Model identities, canonical books, and account growth.
  • Metadata: Document commitments, schemas, and validation.
  • Offers: Provider prices, declarations, and available capacity.
  • User accounts: Vaults, free funds, deposits, and withdrawals.
  • Orders: Matching, reservations, generations, and expiry.
  • Settlement: Usage charges, fee destinations, and authenticated receipts.
  • Model groups: Council assignments, model tokens, backing, and redemption.
  • Indexing: Validated account records and durable settlement history.
  • Transactions and authority: Generated builders, account lifecycle, configuration, and errors.

Encoding and units

Use generated Anchor account decoders, instruction data, and account metas. Inputs live in args.rs; account relationships live in contexts.rs; stored fields live in state_types.rs. Transaction examples show how these types fit together.

Payment amounts use integer atoms. The payment mint has six decimals; one USDC is 1,000,000 atoms. Provider rates are payment atoms per million tokens. Basis points use a denominator of 10,000. Account integer wrappers expose values through .get().