Sol.College

Structure lesson (licence does not allow quoting code)

AegisAIAgent

Original
riyasisodiya2486/AegisAIAgent
SuperStack fork
Blockchains/AegisAIAgent @ cc77224
Stars
0
Last push (original)
2026-05-13
Languages
TypeScript, Rust, CSS, JavaScript
Detected stack
AnchorNext.jsweb3.js
Categories
AI & Agents
Licence
none detected: code not quoted on Sol.College
Homepage
https://aegis-ai-agent-app.vercel.app

Architecture

127 source files. By extension: .tsx ×55, .ts ×45, .rs ×20, .js ×7.

Top-level directorySource files
app80
programs24
agent14
sdk7
x402-server2

On-chain programs: programs/programs/programs

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_vaultInitializeVaultprograms/programs/programs/src/lib.rs:28
depositDepositprograms/programs/programs/src/lib.rs:32
spendSpendprograms/programs/programs/src/lib.rs:36
revoke_agentRevokeAgentprograms/programs/programs/src/lib.rs:40
update_limitUpdateLimitprograms/programs/programs/src/lib.rs:44
withdrawWithdrawprograms/programs/programs/src/lib.rs:48
stake_idle_fundsStakeIdleFundsprograms/programs/programs/src/lib.rs:52
accrue_yieldAccrueYieldprograms/programs/programs/src/lib.rs:56
unstake_for_spendUnstakeForSpendprograms/programs/programs/src/lib.rs:60
initialize_protocol_configInitializeProtocolConfigprograms/programs/programs/src/lib.rs:64
collect_feesCollectFeesprograms/programs/programs/src/lib.rs:68
handlerUpdateLimitprograms/programs/programs/src/instructions/update_limit.rs:23
handlerSpendprograms/programs/programs/src/instructions/spend.rs:28
handlerWithdrawprograms/programs/programs/src/instructions/withdraw.rs:27
handlerInitializeprograms/programs/programs/src/instructions/initialize.rs:6
handlerStakeIdleFundsprograms/programs/programs/src/instructions/stake_idle_funds.rs:38
handlerRevokeAgentprograms/programs/programs/src/instructions/revoke_agent.rs:29
collect_fees_logicCollectFeesprograms/programs/programs/src/instructions/collect_fees.rs:36
handlerInitializeProtocolConfigprograms/programs/programs/src/instructions/initialize_protocol_config.rs:26
handlerAccrueYieldprograms/programs/programs/src/instructions/accrue_yield.rs:19
handlerDepositprograms/programs/programs/src/instructions/deposit.rs:26
handlerUnstakeForSpendprograms/programs/programs/src/instructions/unstake_for_spend.rs:23

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
programs/programs/programs/tests/aegis.tsSystemProgram, PublicKey, Keypair, findProgramAddressSync, requestAirdrop, getBalance
sdk/src/instructions.tsPublicKey, SystemProgram, Keypair, getLatestBlockhash, signTransaction, seeds
sdk/src/client.tsPublicKey, AnchorProvider, Connection, signTransaction, Program, Keypair
app/lib/sdk/instructions.d.tsPublicKey, Keypair, seeds
app/lib/sdk/client.d.tsPublicKey, Connection, Program, Keypair, signTransaction
agent/src/config/wallet.tsPublicKey, Keypair, Connection, getBalance
sdk/src/pda.tsPublicKey, findProgramAddressSync
app/lib/sdk/instructions.jsSystemProgram, getLatestBlockhash, signTransaction, seeds, PublicKey
sdk/src/accounts.tsPublicKey
app/components/vault/ProtocolConfigInit.tsxPublicKey, useWallet, SystemProgram, findProgramAddressSync
app/lib/sdk/client.jsAnchorProvider, signTransaction, PublicKey, Program, Connection
app/hooks/useAegisClient.tssignTransaction, useWallet, useConnection

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/aegisaiagent/. 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
sdknpm run dev
sdknpm run build
appnpm run dev
appnpm run start
appnpm run build
appnpm run lint
x402-servernpm run dev
x402-servernpm run start
agentnpm run start
programsnpm run lint
programsanchor build
programsanchor test
programsanchor run test

What you could build from it