LiquiFact docs
LiquiFact is an invoice liquidity network on Stellar. Small and medium enterprises (SMEs) list unpaid invoices; investors fund them; a Soroban escrow contract holds the money until the debtor pays, then releases principal plus yield to investors.
For SMEs
Unlock cash tied up in 30–90 day payment terms without taking on debt.
For investors
Short-duration, real-economy yield with on-chain transparency.
For partners
Originate invoices through the REST API and settle on Stellar.
Architecture
The stack has three parts, each in its own repository:
- Frontend (repo) — marketplace, invoice detail, submission flow and these docs. Talks to the API over HTTPS.
- Backend API (repo) — REST endpoints for invoices and stats, OpenAPI docs, and a live read of the escrow contract through Soroban RPC. Base URL: https://liquifact-backend.vercel.app.
- Escrow contract (repo) — a Soroban smart contract per invoice that holds investor funds, enforces caps, holds and maturity, and pays out on settlement.
How to use
As an SME
- Open Submit invoice and enter your company, the debtor, amount, currency, due date and the yield you offer.
- Your invoice appears in the Marketplace with status open.
- When investors reach the funding target the status becomes funded and you can withdraw liquidity from the escrow.
- At maturity the debtor pays; the escrow is settled and investors are repaid.
As an investor
- Browse the Marketplace and filter by status.
- Open an invoice to review face value, yield, due date and funding progress.
- Enter an amount and choose Fund invoice. On-chain, this maps to the escrow's
fundentrypoint. - After settlement, claim your payout (
claim_investor_payout).
INV_0001 is backed by the real escrow contract below.Invoice lifecycle
| Status | Code | Meaning |
|---|---|---|
| open | 0 | Accepting investor contributions. |
| funded | 1 | Target reached; SME may withdraw. |
| settled | 2 | Debtor paid; investors can claim principal + yield. |
| withdrawn / cancelled | 3 / 4 | Terminal states. |
API
Interactive reference (Swagger UI): https://liquifact-backend.vercel.app/docs · OpenAPI document: /openapi.json
| Method | Path | Description |
|---|---|---|
GET | /health | Liveness probe |
GET | /api/stats | Marketplace totals |
GET | /api/invoices | List invoices (?status=open|funded|settled|cancelled) |
GET | /api/invoices/:id | Get one invoice |
POST | /api/invoices | Submit an invoice |
POST | /api/invoices/:id/fund | Record an investor contribution |
GET | /api/escrow | Escrow contract metadata |
GET | /api/escrow/live | Live escrow state via Soroban RPC |
curl https://liquifact-backend.vercel.app/api/invoices?status=open
curl -X POST https://liquifact-backend.vercel.app/api/invoices \
-H 'Content-Type: application/json' \
-d '{"sme":"Acme","debtor":"Globex","amount":5000,"dueDate":"2027-01-31","yieldBps":750}'Smart contract
The escrow is deployed on Stellar testnet as CDQCKR2YU6IVQ4GYPBMXBPZ4FGFQB5H25AI7ZSETHS2CZ5ZRCWQDSO6P.
Deployed escrow contract
Investor funds are held by this contract until the invoice settles.
| Entrypoint | Purpose |
|---|---|
init | Admin creates the escrow for one invoice: SME, amount, yield, maturity, funding token, treasury. |
fund | Investor deposits funding tokens; status moves to funded (1) when the target is reached. |
withdraw | SME withdraws the funded liquidity once the escrow is funded. |
settle | Marks the invoice settled (2) after the debtor pays. |
claim_investor_payout | Investors claim principal plus yield after settlement and maturity. |
set_legal_hold / clear_legal_hold | Compliance freeze that blocks risky transitions. |
get_escrow | Read the full escrow state (used by the API's live endpoint). |
stellar contract invoke --id CDQCKR2YU6IVQ4GYPBMXBPZ4FGFQB5H25AI7ZSETHS2CZ5ZRCWQDSO6P \ --network testnet --source <your-key> --send=no -- get_escrow
Run locally
git clone https://github.com/Liquifact/Liquifact-frontend cd Liquifact-frontend npm ci NEXT_PUBLIC_API_URL=http://localhost:3001 npm run dev
Environment variables (all optional): NEXT_PUBLIC_API_URL, NEXT_PUBLIC_CONTRACT_ID, NEXT_PUBLIC_STELLAR_NETWORK.