Context: PersonalPeriod: 2026
open source

Jungle Wallet

A wagering wallet in Go where the database itself guarantees the balance never drifts from the ledger.

My role

All of the code, infrastructure and CI/CD. Public repository.

232
req/s on a 2 vCPU VM
29.8 ms
p95
0
reconciliation mismatches
SPAN 01 // CONTEXT

Problem

The challenge was to process BET, WIN, LOSS, REFUND and ROLLBACK from several providers, over HTTP and an SQS FIFO queue, without lost updates, negative balances or double processing.

SPAN 02 // IMPLEMENTATION

Solution

Go with Uber Fx and pgx (explicit SQL, no ORM), PostgreSQL 17, SQS and SNS FIFO and Keycloak for OIDC. Money is an int64 in cents, and an AST test bans floats across all internal code.

SPAN 03 // DETAILS

Highlights

  • Invariants in the database, with an append-only ledger, a continuous version and balance chain, and a DEFERRABLE constraint trigger that checks at commit time that the balance matches the latest entry.
  • Idempotency through an RFC 8785 canonical hash, shared by HTTP and the queue.
  • A REFUND that arrives before its BET is parked and resolved when the BET lands.
  • A per-wallet ordered outbox with fencing tokens.
  • CI with 10 gates (-race tests, system tests that SIGKILL mid-commit, E2E, Trivy, CodeQL and Gitleaks), Cosign-signed images and deploys over Tailscale with rollback.
SPAN 04 // OUTCOME [200 OK]

Result

Sustained 232 req/s on a 2 vCPU VM running the whole stack, with a 29.8 ms p95 and zero reconciliation mismatches. Live at jungle.lab.fredzol.io.

Quick actionsSwitch language to Português (PT-BR)
PT-BR
Quick actionsToggle light / dark theme
THEME
Quick actionsDownload résumé in Portuguese (PDF)
PDF · PT-BR
Quick actionsDownload résumé in English (PDF)
PDF · EN
Quick actionsCopy email address (fredzolio.dev@gmail.com)
COPY
NavigationProduction services and featured work
#servicos
NavigationAll projects
/en/projects/
NavigationCareer timeline
#carreira
NavigationTalks, hiring, documentation & open source
#atuacao
NavigationSkills & tooling
#stack
NavigationAcademic background, courses & languages
#formacao
NavigationContact & résumé
#contato
Projects & case studiesRio Queue
IplanRio · in production
Projects & case studiesPublic service search and recommendations
IplanRio · in production
Projects & case studiesCourses, jobs and employability API
IplanRio · in production
Projects & case studiesSuperApp load test
IplanRio · internal
Projects & case studiesNota Carioca data pipelines
IplanRio · in production
Projects & case studiesGCP cost investigation and Billing Guard
IplanRio · in production
Projects & case studiesEAí gateway and the city's MCP server
IplanRio · in production
Projects & case studiesCoding agent platform for developers
IplanRio · internal
Projects & case studiesAgents for infrastructure operations
IplanRio · internal
Projects & case studiesCity chatbot integrations
IplanRio · in production
Projects & case studiesGo email worker
IplanRio · in production
Projects & case studiesExecutive meeting room displays
IplanRio · in production
Projects & case studiesAlliomed
Vizo · in production
Projects & case studiesMaestro, a coding agent delivery pipeline
Vizo · internal
Projects & case studiesProventus
Vizo · in use by customers
Projects & case studiesSienge SaaS RPA
Vizo · sold
Projects & case studiesAWS infrastructure assessment
Vizo · client work
Projects & case studiesPLANEHAB Nosso Bairro
Freelance · live
Projects & case studiesConecta Solar
Freelance · live
Projects & case studiesVardis
Freelance · client work
Projects & case studiesLivinHub
Freelance · client work
Projects & case studiesNDC Nexus
New Data Company · prototype
Projects & case studiesWhatsApp group monitor
New Data Company · prototype
Projects & case studiesInternal ERP
New Data Company · internal
Projects & case studiesJungle Wallet
Personal · open source
Projects & case studiesZolioLab
Personal · internal
Projects & case studiesOSCE Cirurgia
Personal · prototype
Projects & case studiesENEM essay grading spike
Personal · experiment
Projects & case studiesGamePixzo
Personal · prototype
Projects & case studiesSurkai
Personal · open source