Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions LLM.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# LLM.md - Hanzo Treasury

## Overview
Go module: github.com/formancehq/stack

## Tech Stack
- **Language**: Go

## Build & Run
```bash
go build ./...
go test ./...
```

## Structure
```
treasury/
Earthfile
LICENSE
README.md
base.Dockerfile
events/
go.mod
go.sum
libs/
releases/
```

## Key Files
- `README.md` -- Project documentation
- `go.mod` -- Go module definition
117 changes: 74 additions & 43 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,56 +1,87 @@
[Formance Stack](https://formance.com) • [![Ledger Stars](https://img.shields.io/github/stars/formancehq/ledger?label=Ledger%20stars)](https://github.com/formancehq/ledger/stargazers) [![License MIT](https://img.shields.io/badge/license-mit-purple)](https://github.com/formancehq/ledger/blob/main/LICENSE) [![YCombinator](https://img.shields.io/badge/Backed%20by-Y%20Combinator-%23f26625)](https://www.ycombinator.com/companies/formance-fka-numary) [![GitHub Discussions](https://img.shields.io/github/discussions/formancehq/stack)](https://github.com/orgs/formancehq/discussions)
# Hanzo Treasury

Formance is a highly modular developer platform to build and operate complex money flows of any size and shapes. It comes with several components, that can be used as a whole as the Formance Stack or separately as standalone micro-services and libraries:
Programmable financial infrastructure for the Hanzo platform. Double-entry ledger, reconciliation, wallets, payment connectors, and workflow orchestration.

- **Formance Ledger** - Programmable double-entry, immutable source of truth to record internal financial transactions and money movements
- **Formance Payments** - Unified API and data layer for payments processing
- **Formance Numscript** - DSL and virtual machine monetary computations and transactions modeling
## Architecture

## ⚡️ Getting started with Formance Cloud Sandbox

### Install Formance CLI

```SHELL
# macOS
brew tap formancehq/tap
brew install fctl
```

###
```SHELL
# login to formance cloud
fctl login

# create a sandbox stack deployment
# please note: sandbox are made available for testing and not made for production usage
# read more in the docs [1]
fctl stack create foobar

# commit your first ledger transaction
fctl ledger send world foo 100 EUR/2 --ledger=demo

# checkout the control dashboard
fctl ui
hanzo/commerce Storefront, catalog, orders
|
hanzo/payments Payment routing (50+ processors)
|
hanzo/treasury Ledger, reconciliation, wallets, flows <-- you are here
|
lux/treasury On-chain treasury, MPC/KMS wallets
```

[1] https://docs.formance.com/guides/newSandbox

## ☁️ Cloud Native Deployment

The Formance Stack is distributed as a collection of binaries, with optional packaging as Docker images and configuration support through command line options and environment variables. The recommended, standard way to deploy the collection of services is to a Kubernetes cluster through our Formance official Helm charts, which repository is available at [helm.formance.com](https://helm.formance.com/).
## Components

| Component | Description |
|-----------|-------------|
| **Ledger** | Programmable double-entry, immutable source of truth for all financial transactions |
| **Payments** | Unified API and data layer for payment processing across providers |
| **Numscript** | DSL for modeling complex monetary computations and transaction flows |
| **Wallets** | Multi-currency virtual wallets with hold/release mechanics |
| **Reconciliation** | Auto-match ledger transactions against payment provider data |
| **Flows** | Workflow orchestration for payment and treasury operations |
| **Webhooks** | Event delivery service for financial state changes |
| **Auth** | Authentication and authorization for treasury APIs |

## Quick Start

```bash
# Install CLI
brew tap hanzoai/tap
brew install hanzo-treasury

# Start local development stack
docker compose up -d

# Create a ledger transaction
curl -X POST http://localhost:3068/v2/ledger/demo/transactions \
-H "Content-Type: application/json" \
-d '{
"postings": [{
"source": "world",
"destination": "users:001",
"amount": 10000,
"asset": "USD/2"
}]
}'
```

## 📚 Documentation
## Numscript Example

```numscript
// Transfer with multi-party fee split
send [USD/2 10000] (
source = @users:001
destination = {
90% to @merchants:042
10% to {
50% to @platform:fees
50% to @platform:reserve
}
}
)
```

The full documentation for the formance stack can be found at [docs.formance.com](https://docs.formance.com)
## API

## 💽 Codebase
- **Ledger**: `POST /v2/ledger/{name}/transactions` — record transactions
- **Accounts**: `GET /v2/ledger/{name}/accounts` — query balances
- **Payments**: `POST /v2/payments` — initiate payments
- **Wallets**: `POST /v2/wallets` — create/manage wallets
- **Reconciliation**: `POST /v2/reconciliation/policies` — define matching rules

Formance is transitioning to a unified public facing monorepo (this one) that imports versioned services submodules and provides a common infrastructure layer. As we are finalizing this transition, this monorepo is structured as below
## Integration with Hanzo Stack

### Technologies
Treasury connects to:
- **hanzo/payments** for payment routing
- **hanzo/commerce** for order settlement
- **lux/treasury** for on-chain operations and MPC wallet management
- **hanzo/kms** for secrets and key management

The Formance Stack is built on open-source, battle tested technologies including:
## License

- **PostgreSQL** - Main storage backend
- **Kafka/NATS** - Cross-services async communication
- **Traefik** - Main HTTP gateway
MIT — see [LICENSE](LICENSE)
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module github.com/formancehq/stack

go 1.22.0
go 1.26.1

toolchain go1.22.7
Loading