CH-02

AlgoLend AI

react · typescript · fastapi · algorand typescript2025

src github.com/TADebugs/ALGOLEND_AI

The trading floor

ALGORAND TESTNET

A lending pool on Algorand with three agent desks beside it. Each desk shows what its Python module reads, what it calls, and whether the API actually serves it.

Launch

Not connected yet · algolend.tanmaydesai.xyz the app is being deployed; source is live

The app runs as a seeded demo on testnet: no backend calls, nothing sent on-chain. A live backend sits behind a switch that is off by default.

WIRED

Risk Analyzer

backend/ai/risk_analyzer.py
reads
balance · account age · tx frequency · tx consistency · tx amounts · network activity · reputation
calls
credit_score (0–100) · risk_level (A+ … D) · risk_factors · recommendations

Weights, fixed in code, sum to 1.00

  1. 1 balance .25
  2. 2 age .20
  3. 3 freq .15
  4. 4 consistency .15
  5. 5 amounts .10
  6. 6 network .10
  7. 7 reputation .05
SEEDED real analyze_account output on synthetic accounts, from backend/scripts/generate_demo_seed.py
profilescoregrade
established · 6,200 ALGO, 420 days86A+
volatile · 900 ALGO, 120 days67B+
new · 15 ALGO, 3 days54C+

Served by backend/app.py at /api/analyze-account. A rule score, not a trained model; no labeled outcomes exist to measure it against.

SIMULATED

Market Oracle

backend/ai/market_oracle.py
reads
algo_price · volume_24h · price_change_24h · fear_greed_index
calls
market_sentiment · price_prediction · lending_opportunities · risk_factors · recommended_actions

Imported by app.py, but its market data is generated with random, not read from a feed.

NOT WIRED

Yield Optimizer

backend/ai/yield_optimizer.py
reads
risk_tolerance · investment_amount · time_horizon · 5 pools
calls
optimal_allocation · expected_returns · rebalancing · action_plan

The module exists; app.py doesn't use it.

LendingPool contract

NOT DEPLOYED
  • depositadds to your balance and the pool total
  • withdrawpays back the amount plus simple interest since your last update
  • borrowchecks the pool has the liquidity, then pays out
  • repayclears your borrowed balance

The rate is stored as interestRate in basis points: 500 bps is 5 %. Interest accrues over Global.latestTimestamp. Written in Algorand TypeScript and kept in the repo, not deployed, so the app simulates deposits and loans.

What was built

  • Full-stack decentralized lending platform with React, TypeScript and FastAPI (Python), integrating Algorand smart contracts with fast finality and sub-cent fees.
  • Three AI agent modules for market analysis, risk scoring and yield optimization.