Skip to content
AtheronLABS

You're visiting from the United States. Prices are shown in US dollars. Not right?

labs@atheron:~/work/payment-engine$ cat payment-engine.md

The payment engine

A ledger nobody can edit.

A service of its own, with a contract any merchant can read. It quotes a token amount from live prices, watches for the deposit, settles to USDC and tells the merchant with a signed callback. Every move it makes is written to a ledger that is only ever added to.

Our own buildPayments API, ledger and approvals

// what it does

  • Takes a request in Canadian dollars and quotes the token amount from live prices.
  • Gives the customer an address from a pool prepared ahead, watches for the deposit and matches it.
  • Converts what arrives to USDC at market, leg by leg, and never holds a balance in anything else.
  • Tells the merchant with a signed callback, retried from an outbox until it is acknowledged.
  • Prepares refunds and payouts as instructions, approved with a passkey the engine checks itself.

// how we built it

  • An OpenAPI 3.1 contract the engine serves itself, so the docs and the API cannot disagree.
  • Every request is signed and idempotent, so a retry can never take a payment twice.
  • The payment side can never send money out, whatever its key allows; the withdrawal side may make five calls and nothing else.
  • Money is held as exact decimals, never as a floating point number.
  • An append-only ledger, reconciled against the venue, so the books can be rebuilt from the events.

// the size of it

migrations
19, and thirty tokens in the table
test files
36, with the venue's recorded answers as fixtures
contract
OpenAPI 3.1, served by the engine at /v1/openapi.json
settlement
USDC only; it never holds a standing balance in anything else

// stack

  • TypeScript
  • Node.js
  • PostgreSQL
  • WebAuthn
  • OpenAPI 3.1

// where it stands

Built and tested, and not deployed. No customer has paid through it, and nothing about it is offered until it is.

// a comparable build

Build
≈ US$72,300 to US$111,000, within 14 weeksCAD 102,900 to 157,400
Hosting
≈ US$176 a monthCAD 250 a month
Support
≈ US$5,010 a monthCAD 7,135 a month

Prices in your currency are estimates from today's Bank of Canada rate. All invoicing is in CAD or USD.

the effort in it

Development
404 to 617 h
Backend developer
84 to 129 h
QA engineer
81 to 123 h
Senior backend developer
78 to 120 h
DevOps engineer
72 to 111 h
In all
924 to 1414 h

what this price covers

A payments service of this shape as one build: the contract, the quoting and deposit watching, the settlement legs, the ledger, and the approval path for money going out.

An estimate for a build like this one, worked out from our rate card as you read it. It is not a quote. Yours changes with your scope, and we write a real one after a call.

Open this in the estimator →

// start

Want one built like this?

The same team, the same tests, the same care. Tell us what you need, or price it yourself first.

The payment engine: a payments API with its own ledger | Atheron Network Labs