Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TotiFi — Web3 Finance for Real People

TotiFi Logo

Loans. Savings groups. Crypto rewards. No bank required.

Angular Hedera TypeScript License


The idea

Most people in East Africa don't have a bank account. But almost everyone has a phone, a mobile money wallet, and a chama — a savings group they run with friends, family, or colleagues.

TotiFi is built for those people.

It's a Web3 financial platform that connects M-Pesa and Airtel Money to the Hedera blockchain. You can apply for a loan, run a savings group, earn crypto rewards, and manage your money — all without ever walking into a bank. Your Hedera wallet is your identity. Your on-chain history is your credit score.

The name comes from toti — Swahili slang for money. That's the energy.


Why Hedera?

We looked at a lot of blockchains. Hedera won for three reasons:

  • Fast enough for real life — transactions confirm in 3–5 seconds. Nobody waits.
  • Cheap enough for small amounts — fees are fractions of a cent. Sending 50 KES worth of HBAR doesn't cost 50 KES in gas.
  • Predictable — fixed USD-denominated fees. No gas wars, no surprises.

We use Hedera's native token service (HTS) for loan NFTs and TOTI reward tokens, the consensus service (HCS) as an immutable audit trail for every loan and chama event, and Solidity smart contracts for group savings logic.


What you can do

Connect your wallet, that's your login

No username. No password. Connect HashPack or any WalletConnect wallet and you're in. Your Hedera account ID is your identity across the whole platform.

Get a loan

Apply in minutes. Pick an amount, a purpose, and a repayment period. If you need a guarantor, invite them by their Hedera account ID — they get a notification, review the terms, and confirm on-chain. No paperwork. No notaries. Every state change (applied → approved → disbursed → repaid) is recorded on Hedera's consensus service and can never be altered.

Run a chama

Chamas are rotating savings groups — a cornerstone of Kenyan financial culture. TotiFi brings them on-chain. Create a group, set a contribution amount in HBAR, define the payout order, and invite members. Every contribution and payout is enforced by a smart contract and recorded on HCS. Transparent, tamper-proof, and automatic.

Earn TOTI tokens

TOTI is TotiFi's reward token on Hedera (token ID: 0.0.8348876). You earn it for doing things that build financial health:

Action Reward
Complete KYC 100 TOTI
Apply for a loan 50 TOTI
Repay on time 25 TOTI
Join a chama 30 TOTI
Refer a friend 75 TOTI

One claim per 24 hours. TOTI is a real HTS fungible token — you can hold it, trade it on SaucerSwap, or use it in-app for fee discounts.

Bridge mobile money ↔ crypto

Swap between Kenyan shillings and HBAR or USDT directly from the app. Enter your Safaricom or Airtel number, pick a direction, and get a live quote with fees broken down before you confirm. Rates update in real time. Quotes expire after 60 seconds.

  • M-Pesa fee: 1.5%
  • Airtel Money fee: 1.2%
  • Supported numbers: 07xx, 01xx, +2547xx, +2541xx

Your loan is an NFT

Every disbursed loan is minted as a TOTI-LOAN NFT on Hedera. This makes loans tradeable assets — lenders can sell loan positions on the secondary market, and borrowers build a verifiable on-chain credit history that follows them forever.

DAO governance

TotiFi is governed by its community. Any TOTI holder can submit a proposal — fee changes, new collateral types, protocol upgrades. Voting is on-chain, proportional to token holdings, and fully auditable. An AI assistant analyzes each proposal and gives you a plain-English breakdown before you vote.


Running it locally

What you need

  • Node.js 18+
  • Angular CLI 21+
  • A HashPack wallet on Hedera testnet

Install

git clone https://github.com/your-org/toti-fi.git
cd toti-fi
npm install

Development workflow

TotiFi runs as two separate processes:

Process Command Port What it does
Angular dev server ng serve 4200 Frontend with hot reload
API + SSR server npm run start:api 4000 Hedera SDK, all /api/* routes

Quick start (build once, then run both):

# Terminal 1 — build and start the API server
npm run dev

# Terminal 2 — start the Angular dev server with hot reload
ng serve

Or just the API server (after a build):

npm run build:dev     # build once
npm run start:api     # start the API server

Watch mode (rebuilds on file changes, then restart the API server manually):

npm run build:watch   # rebuilds on every save
# in another terminal:
npm run start:api

Production build

npm run build:prod
npm run serve:ssr

Smart contracts

npm run contracts:compile   # compile Solidity with Hardhat
npm run contracts:deploy    # deploy to Hedera testnet
npm run contracts:build     # compile + deploy in one step

Script reference

Script What it does
npm start Angular dev server (frontend only, port 4200)
npm run dev Build dev + start API server (port 4000)
npm run build:dev One-time development build
npm run build:prod Production build
npm run build:watch Rebuild on every file save
npm run start:api Start the API/SSR server (requires a prior build)
npm run serve:ssr Alias for start:api
npm run test Run unit tests once (no watch)
npm run lint Lint the codebase
npm run contracts:compile Compile Solidity contracts
npm run contracts:deploy Deploy contracts to Hedera testnet

Project layout

src/
├── app/
│   ├── core/
│   │   ├── guards/          # walletGuard, kycGuard
│   │   ├── models/          # User, Loan, Chama, CreditRating
│   │   └── services/        # Hedera, WalletConnect, AI, Mirror Node
│   ├── features/
│   │   ├── ai-assistant/    # Floating chat assistant
│   │   ├── auth/            # Wallet connect flow
│   │   ├── bridge/          # HBAR/USDT transfer + mobile money
│   │   ├── chama/           # Savings groups
│   │   ├── credit-rating/   # On-chain credit score
│   │   ├── dao/             # DAO governance
│   │   ├── dashboard/       # User + official dashboards
│   │   ├── guarantor/       # Guarantor confirmation flow
│   │   ├── kyc/             # KYC verification
│   │   ├── loans/           # Application, dashboard, repayments
│   │   ├── mobile-money/    # M-Pesa / Airtel ↔ HBAR/USDT
│   │   ├── profile/         # Web3 profile + IPFS documents
│   │   ├── stablecoins/     # Stablecoin swap
│   │   └── tokens/          # TOTI token hub (NFT + rewards)
│   ├── layout/              # Nav shell
│   └── shared/              # Glass card, tx viewer, toasts
├── server/                  # Express API routes (Hedera SDK lives here)
└── main.server.config.ts    # All server config — no process.env

Tech stack

Layer Technology
Frontend Angular 21, TypeScript 5.9, Angular Material
Blockchain Hedera Hashgraph — HTS, HCS, Smart Contracts
Wallet HashConnect 3, WalletConnect, Hedera Wallet Connect
Smart Contracts Solidity + Hardhat
Storage IPFS via Pinata (KYC docs, loan snapshots, chama records)
AI Hedera AI Agent Service, Google Gemini
Server Angular SSR + Express 5
Testing Jasmine, Karma, fast-check (property-based)

Live deployment

Network Hedera Testnet
Operator 0.0.3745354
TOTI Token 0.0.8348876
Mirror Node https://testnet.mirrornode.hedera.com
HashScan https://hashscan.io/testnet
Frontend https://toti-fi.web.app

How transactions work in the UI

Every blockchain transaction shows a live bottom sheet:

  1. Initiating — building and signing the transaction
  2. Submitted — broadcast to the Hedera network
  3. Confirmed — receipt received, serial/sequence numbers shown

You get the real Hedera transaction ID (0.0.XXXXX@timestamp.nanos), a direct HashScan link, and an embedded explorer view once confirmed. It auto-dismisses after 12 seconds on success.


Roadmap

  • Mainnet deployment
  • Real M-Pesa STK push (Safaricom Daraja API)
  • Real Airtel Money API
  • Mobile app (Capacitor)
  • Swahili language support
  • Group loans and emergency funds in chamas
  • Credit bureau integration for hybrid scoring
  • Loan marketplace with secondary trading UI

License

MIT — see LICENSE.


Built with ❤️ in Nairobi. Powered by Hedera.

About

"TotiFI takes the way communities save and lend money together—like a traditional Chama—and makes it digital, secure, and entirely stress-free. Instead of relying on messy spreadsheets or cash collections, TotiFI locks everything in place using smart contracts. When you or a friend need a loan, your community can pool resources to back it, and the

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages