# Backend engineering

Canonical: https://gaboesquivel.com/backend

A backend's job is to be the source of truth and to decide who's allowed to change it. Mine have been a GraphQL layer over blockchain events, a matching engine with browser-based signing, and a retrieval system behind a voice assistant.

## Blockchain data and realtime APIs

ChainGraph started as a side project while I was at Bitcash: a GraphQL subscription toolkit for indexing and streaming EOSIO and Antelope data. Bitlauncher later needed an indexer of its own for EOS EVM, so I built one on viem event subscriptions and a dFuse stream, with Supabase handling queries, aggregation, and realtime subscriptions.

- [ChainGraph](https://gaboesquivel.com/project/chaingraph)
- [Bitlauncher](https://gaboesquivel.com/project/bitlauncher)

## Exchange and protocol services

At Bitcash the matching engine had to be the system of record. The exchange runs on Hasura GraphQL APIs, a realtime EOS indexer with worker threads and binary deserialization, and PostgreSQL behind all of it. At Opyn the question was where protocol state should live. I put it in a Ponder indexer over PostgreSQL, so the trading interface reads indexed state and doesn't rebuild positions from raw RPC reads.

- [Bitcash](https://gaboesquivel.com/project/bitcashbank)
- [Opyn](https://gaboesquivel.com/project/opyn)

## Retrieval and application services

For LegalAgent I built retrieval as an application service, not as a prompt. Document categorization decides what retrieval can reach, and the system prompts live as data in the admin instead of in code.

- [LegalAgent](https://gaboesquivel.com/project/legal-agent)

## Writing about backend systems

- [Prompt Injection](https://gaboesquivel.com/blog/2025-06-prompt-injection)
- [Scaling and Securing WebSockets](https://gaboesquivel.com/blog/2025-05-scaling-securing-websockets)
- [Trading Engines - Order Books & AMMs](https://gaboesquivel.com/blog/2025-05-order-books-and-amms)

The [work library](https://gaboesquivel.com/work) has a page for each project, with the stack and the implementation details.