Sol.College

Structure lesson (licence does not allow quoting code)

agama-solana

Deposit a tokenized stock, get more of it back. Solana devnet + Token-2022 confidential balances, Chainlink Data Streams verified on chain.

Original
agamafinance/agama-solana
SuperStack fork
Blockchains/agama-solana @ c3899d5
Stars
0
Last push (original)
2026-10-12
Languages
TypeScript, Rust, JavaScript, Shell, CSS
Detected stack
@solana/kitAnchorNext.jsweb3.js
Categories
Other
Licence
none detected: code not quoted on Sol.College
Homepage
https://app.agama.finance/solana

Architecture

52 source files. By extension: .ts ×24, .tsx ×19, .rs ×8, .js ×1.

Top-level directorySource files
web28
scripts15
programs8
idl1

On-chain programs: programs/agama-solana

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
initializeInitializeprograms/agama-solana/src/lib.rs:98
set_paramsAdminOnlyprograms/agama-solana/src/lib.rs:162
set_marketSetMarketprograms/agama-solana/src/lib.rs:216
faucet_usdcFaucetUsdcprograms/agama-solana/src/lib.rs:351
faucet_stockFaucetStockprograms/agama-solana/src/lib.rs:369
supplyLendprograms/agama-solana/src/lib.rs:391
withdrawLendprograms/agama-solana/src/lib.rs:436
earn_depositEarnDepositprograms/agama-solana/src/lib.rs:489
earn_set_targetEarnOwnerprograms/agama-solana/src/lib.rs:534
earn_closeEarnCloseprograms/agama-solana/src/lib.rs:551
amplify_openAmplifyOpenprograms/agama-solana/src/lib.rs:611
amplify_closeAmplifyCloseprograms/agama-solana/src/lib.rs:672
rebalanceAgentprograms/agama-solana/src/lib.rs:706
compoundAgentprograms/agama-solana/src/lib.rs:743
liquidateLiquidateprograms/agama-solana/src/lib.rs:779
pokePokeprograms/agama-solana/src/lib.rs:856

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/agama-solana/src/lib.rsseeds, Program, Pubkey, init_if_needed, has_one, CpiContext
programs/agama-solana/tests/flows.rsPubkey, Keypair, Transaction, seeds
scripts/common.tsPublicKey, Keypair, Connection, SystemProgram, Transaction, getAssociatedTokenAddressSync
programs/agama-solana/src/mints.rsAccountInfo, seeds, CpiContext, invoke, Pubkey, transfer
programs/agama-solana/src/ops.rsAccountInfo, seeds, CpiContext, Pubkey
web/lib/solana/useSolana.tsPublicKey, SystemProgram, Program, Connection, getBalance
web/lib/solana/confidential.tsPublicKey, Connection, transfer, getAccountInfo
web/lib/solana/batch.tsVersionedTransaction, PublicKey, Connection, signTransaction, getLatestBlockhash, transfer
scripts/setup.tsSystemProgram, Transaction, sendAndConfirmTransaction, getAccountInfo, PublicKey, getBalance
scripts/private-e2e.tsKeypair, SystemProgram, Transaction, sendAndConfirmTransaction, PublicKey, transfer
programs/agama-solana/src/state.rsPubkey
scripts/e2e.tsSystemProgram, Transaction, sendAndConfirmTransaction, Keypair, transfer

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/agama-solana/. 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
webnpm run dev
webnpm run start
webnpm run build
.anchor build
.anchor test
.anchor run test
.cargo build
.cargo test

What you could build from it