Sol.College

Structure lesson (licence does not allow quoting code)

AutoFi

Automated DeFi Strategy Engine on Solana. AutoFi simplifies portfolio management by transforming user intents into optimized on-chain actions. Built with Next.js 15, Express, and Anchor.

Original
antssugiarto/AutoFi
SuperStack fork
Blockchains/AutoFi @ 0a6a3d9
Stars
0
Last push (original)
2026-06-23
Languages
TypeScript, JavaScript, Rust, CSS
Detected stack
AnchorNext.jsweb3.js
Categories
AI & AgentsDeFi
Licence
none detected: code not quoted on Sol.College
Homepage
https://autofi-psi.vercel.app

Architecture

61 source files. By extension: .tsx ×28, .ts ×18, .js ×14, .rs ×1.

Top-level directorySource files
frontend44
backend14
autofi-smart-contract3

On-chain programs: autofi-smart-contract/programs/autofi-smart-contract

How it works: instructions and accounts

Each instruction handler and the accounts struct it validates, found by reading the Rust source. Links go to the exact line at the pinned commit.

InstructionAccountsSource
initialize_yield_poolInitializeYieldPoolautofi-smart-contract/programs/autofi-smart-contract/src/lib.rs:31
deposit_solDepositSolautofi-smart-contract/programs/autofi-smart-contract/src/lib.rs:39
withdraw_solWithdrawSolautofi-smart-contract/programs/autofi-smart-contract/src/lib.rs:69

Where the Solana code lives

Source files that import a Solana SDK, ranked by how many Solana APIs they use, with the APIs each one calls. Read them in this order to see how the app talks to the chain.

FileSolana APIs used
frontend/app/execute/page.tsxPublicKey, Transaction, SystemProgram, Program, AnchorProvider, findProgramAddressSync
frontend/app/lib/defi/lending.tsConnection, PublicKey, transfer, sendTransaction, SystemProgram, Transaction
frontend/app/lib/defi/jupiter.tstransfer, Connection, PublicKey, sendTransaction, VersionedTransaction, SystemProgram
autofi-smart-contract/programs/autofi-smart-contract/src/lib.rsseeds, Program, has_one, AccountInfo, transfer, CpiContext
frontend/scripts/init-yield-pool.tsConnection, Keypair, PublicKey, SystemProgram, Program, AnchorProvider
frontend/app/lib/defi/staking.tsConnection, PublicKey, SystemProgram, Transaction, sendTransaction, transfer
frontend/app/lib/defi/mapper.tssendTransaction, Connection, PublicKey
frontend/app/preview/page.tsxuseWallet, useConnection, Program, AnchorProvider, signTransaction
frontend/app/dashboard/page.tsxuseWallet, useConnection, Transaction
frontend/app/lib/solana.tsConnection, PublicKey, getBalance
frontend/app/amount/page.tsxuseWallet, useConnection
autofi-smart-contract/tests/autofi-smart-contract.tsProgram, AnchorProvider

Dapp: devnet deploy pending

⏳ Devnet deploy pending — goes live when the devnet wallet is topped up. This fork's own dapp is not deployed yet, so there is no program address or transaction to show. It is queued in dapp-queue.txt; once devnet SOL is available it is deployed, exercised with real devnet transactions, and this section switches to the live dapp at /dapps/autofi/. Until then, the lesson and step-by-step guide below are complete, and you can run it locally with the commands below.

How to run, build and test

These commands come from the repo's own manifests (package.json scripts, Anchor.toml, Cargo, go.mod, Makefile). Check the README for prerequisites and environment variables.

DirectoryCommandRuns
backendnpm run dev
backendnpm run start
backendnpm run test
frontendnpm run dev
frontendnpm run start
frontendnpm run build
frontendnpm run lint
autofi-smart-contractnpm run lint
autofi-smart-contractanchor build
autofi-smart-contractanchor test
autofi-smart-contractanchor run test

What you could build from it