Contents

Ports & edges

The economy is the system of record; everything it talks to is a port you supply an adapter for.

  • The packages

    The one runtime sibling (@pwngh/economy-edge), the vendored arithmetic (@pwngh/money), the optional relay backend (@pwngh/taskq), and the seam where each enters.

  • Signer

    The signing port: sign and verify with rotating keys, backing the checkpoint that attests the ledger is intact.

  • Processor

    The payout processor port that pays sellers, plus the provider adapters that satisfy it.

  • Rates

    The rates port supplying the fixed CREDIT-to-USD buy, par, and payout rates.

  • Pricing

    The pricing capability: a fee policy that splits a sale into recipient legs and platform revenue.

  • Storage: the Store and engines

    The Store gathers the ledger and its sub-stores behind one transaction boundary. Every adapter passes the same conformance suite, and the SQL engines enforce the invariants a second time, in the database.

  • Messaging: outbox, inbox, dispatcher

    Events leave through a transactional outbox and arrive through a verified inbox, with the Dispatcher as the delivery seam. Everything is at-least-once, deduped by event id.

  • Scope & non-goals

    What economy-lab deliberately does not do: no payment provider, no event consumer; the host supplies those edges.