A secure trade finance dApp built on Stellar & Soroban
Tokenizing collateral (invoices, commodities, etc.) to unlock instant liquidity for exporters and importers, bridging the massive trade finance gap.
StelloVault is a trade finance dApp that enables SMEs to tokenize real-world assets (invoices, commodities) as Stellar assets with embedded metadata, use them as collateral in multi-signature escrows managed by Soroban smart contracts, and unlock instant cross-border liquidity.
Key innovations:
- Collateral Tokenization β Real assets become fractional, traceable Stellar tokens.
- Automated Escrows β Multi-sig + conditional release triggered by shipment verification oracles.
- Dynamic Financing β Algorithmic loans based on on-chain history and utilization.
- Risk Scoring β On-chain creditworthiness scoring using transaction history.
- Governance β Quadratic voting for protocol parameters and accepted collateral types.
Trade finance gap: $100β120B+ annually (Afreximbank, African Development Bank), disproportionately affecting SMEs under the AfCFTA. StelloVault targets reducing intermediary costs by up to 50%.
| Feature | Description |
|---|---|
| Collateral Tokenization | Mint Stellar assets from invoices/goods with provenance metadata |
| Multi-Sig Escrows | Soroban enforces release on oracle confirmation |
| Oracle Integration | Real-time data feeds for shipment & quality verification |
| Risk Scoring Engine | On-chain history β dynamic loan terms |
| Frontend Dashboard | Next.js UI for deal origination, escrow monitoring, repayments |
| Governance Module | On-chain quadratic voting for protocol parameters |
| Flash Settlements | Instant cross-border payments via Stellar DEX/path payments |
| Real-time Updates | WebSocket push for escrow/loan state changes |
stellovault/
βββ contracts/ # Soroban Smart Contracts (Rust)
βββ frontend/ # Next.js Frontend Application
βββ server/ # TypeScript/Express Backend API β active
βββ backend/ # Rust/Axum Backend (archived β superseded by /server)
βββ .github/
βββ workflows/
βββ ci.yml # CI: server (TS) + contracts (Rust)
- Tech: Rust Β· Soroban SDK
- Purpose: On-chain escrow, collateral tokenization, governance, fee management
- Build:
cargo build --release --target wasm32-unknown-unknown
- Tech: Next.js 14+, TypeScript, Tailwind CSS
- Features: Dashboard, escrow management, collateral upload, governance voting
- Dev:
npm run dev
- Tech: Express.js Β· TypeScript Β· Prisma Β· PostgreSQL Β·
@stellar/stellar-sdk - Pattern: Non-custodial Β· Account Abstraction (Fee Payer) Β· Event-driven
- Dev:
npm run dev
server/
βββ prisma/
β βββ schema.prisma # DB models (User, Loan, Escrow, Collateral β¦)
βββ src/
β βββ app.ts # Express app entry point
β βββ config/
β β βββ env.ts # Typed environment variables
β β βββ contracts.ts # Soroban contract IDs
β β βββ errors.ts # Custom error classes
β βββ controllers/ # HTTP request handlers (thin orchestration layer)
β β βββ auth.controller.ts
β β βββ wallet.controller.ts
β β βββ user.controller.ts
β β βββ escrow.controller.ts
β β βββ collateral.controller.ts
β β βββ loan.controller.ts
β β βββ oracle.controller.ts
β β βββ governance.controller.ts
β β βββ risk.controller.ts
β β βββ user.controller.ts # also handles /analytics
β βββ routes/ # Express routers mounted under /api/v1
β βββ services/ # Core business & blockchain logic
β β βββ blockchain.service.ts # Horizon / native Stellar ops
β β βββ contract.service.ts # Soroban XDR builder (Account Abstraction)
β β βββ database.service.ts # Prisma ORM wrappers
β β βββ event-monitoring.service.ts # On-chain event poller
β βββ middleware/
β βββ auth.middleware.ts # JWT Bearer verification
β βββ error.middleware.ts # Central error β HTTP status mapping
β βββ rate-limit.middleware.ts
βββ package.json
βββ tsconfig.json
βββ .env.example
βββ migration_issues.md # GitHub issues for full feature implementation
API Routes (all under /api/v1):
| Prefix | Domain |
|---|---|
/auth |
Wallet challenge/sign/verify, JWT rotation |
/wallets |
Link, unlink, set-primary wallet |
/users |
User profiles |
/escrows |
Escrow lifecycle + webhook |
/collateral |
Collateral records |
/loans |
Loan issuance + repayments |
/oracles |
Oracle node registry + confirmations |
/confirmations |
Oracle event confirmations |
/governance |
Proposals, votes, audit log |
/risk |
Risk scoring + historical + simulation |
/analytics |
Platform-wide aggregated stats |
The original Rust backend is preserved here for reference. It has been superseded by the TypeScript server above. See backend/README.md for details.
| Tool | Version |
|---|---|
| Node.js | 20+ |
| npm | 9+ |
| PostgreSQL | 14+ |
| Rust | stable |
| Soroban CLI | latest |
cd server
cp .env.example .env # fill in DATABASE_URL, FEE_PAYER_SECRET, contract IDs
npm install
npx prisma migrate dev
npm run dev # starts on http://localhost:3001cd contracts
cargo build --release --target wasm32-unknown-unknown
cargo testcd frontend
npm install
npm run dev # starts on http://localhost:3000User Server Stellar/Soroban
β β β
β POST /api/v1/escrows β β
ββββββββββββββββββββββββββΆβ β
β β Build XDR (Fee Payer src) β
β βββββββββββββββββββββββββββββΆβ
β { escrowId, xdr } β β
βββββββββββββββββββββββββββ β
β β β
β Sign auth entries β β
β (client-side only) β β
ββββββββββββββββββββββββββΆβ β
β β Sign as Fee Payer β
β β Submit signed XDR β
β βββββββββββββββββββββββββββββΆβ
β β { txHash } β
β { success, txHash } β β
βββββββββββββββββββββββββββ β
The backend never holds user private keys. It only acts as Fee Payer for sponsoring gas costs.
Two parallel jobs run on every push/PR to main or contract:
| Job | Directory | Checks |
|---|---|---|
server |
./server |
npm ci β prisma generate β tsc --noEmit β npm test |
contracts |
./contracts |
cargo fmt β cargo clippy β cargo build β cargo test |
- Fork β clone β
git remote add upstream https://github.com/anonfedora/stellovault.git git checkout -b feature/my-feature- Implement + test
git push origin feature/my-featureβ open a PR againstmain
Guidelines:
- TypeScript: follow
prettierformatting (server/) - Rust:
cargo fmt+cargo clippymust pass (contracts/) - All new endpoints need controller + route + service
- Use the issue tracker β see
server/migration_issues.mdfor the full feature backlog
MIT Β© StelloVault Contributors