Sol.College

Structure lesson (licence does not allow quoting code)

agent-settlement-protocol

The Clearing House for AI Agents on Solana - Atomic multi-step settlement with trust-weighted economics

Original
Aleks-NFT/agent-settlement-protocol
SuperStack fork
Blockchains/agent-settlement-protocol @ e57f008
Stars
0
Last push (original)
2026-05-11
Languages
TypeScript, Rust, Shell, JavaScript
Detected stack
Anchorweb3.js
Categories
AI & Agents
Licence
none detected: code not quoted on Sol.College

Architecture

42 source files. By extension: .rs ×22, .ts ×20.

Top-level directorySource files
programs22
packages14
demo4
tests1
sdk1

On-chain programs: programs/agentvault

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
init_reputationInitReputationprograms/agentvault/src/lib.rs:38
lockLockprograms/agentvault/src/lib.rs:42
pre_checkPreCheckprograms/agentvault/src/lib.rs:47
execute_tradeExecuteprograms/agentvault/src/lib.rs:52
create_mock_feedCreateMockFeedprograms/agentvault/src/lib.rs:56
revertRevertprograms/agentvault/src/lib.rs:60
post_checkPostCheckprograms/agentvault/src/lib.rs:64
settleSettleprograms/agentvault/src/lib.rs:68
open_credit_bondOpenCreditBondprograms/agentvault/src/lib.rs:73
close_credit_bondCloseCreditBondprograms/agentvault/src/lib.rs:77
list_for_saleListForSaleprograms/agentvault/src/lib.rs:82
buy_settlementBuySettlementprograms/agentvault/src/lib.rs:87
handlerOpenCreditBondprograms/agentvault/src/open_credit_bond.rs:28
handlerSettleprograms/agentvault/src/settle.rs:52
handlerListForSaleprograms/agentvault/src/list_for_sale.rs:23
handlerCloseCreditBondprograms/agentvault/src/close_credit_bond.rs:19
handlerBuySettlementprograms/agentvault/src/buy_settlement.rs:40
handlerRevertprograms/agentvault/src/revert.rs:6
handlerCreateMockFeedprograms/agentvault/src/mock_feed.rs:5
handlerPostCheckprograms/agentvault/src/post_check.rs:41
handlerInitReputationprograms/agentvault/src/init_reputation.rs:21

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
tests/agentvault-litesvm.tsKeypair, PublicKey, findProgramAddressSync, SystemProgram, Transaction, Program
sdk/AgentVaultClient.tsPublicKey, findProgramAddressSync, SystemProgram, AnchorProvider, Keypair, Program
demo/full-lifecycle.tsKeypair, PublicKey, SystemProgram, Program, mintTo, Connection
demo/factoring-flow.tsKeypair, PublicKey, Program, SystemProgram, mintTo, Connection
packages/mcp-server/src/client.tsPublicKey, findProgramAddressSync, Connection, Keypair, SystemProgram, AnchorProvider
demo/oracle-failure.tsKeypair, PublicKey, SystemProgram, Program, Connection, createMint
demo/get-revert-tx.tsPublicKey, Keypair, SystemProgram, Connection, createMint, mintTo
programs/agentvault/src/lock.rsseeds, Pubkey, Program, init_if_needed, CpiContext, transfer
programs/agentvault/src/revert.rsseeds, Pubkey, CpiContext, transfer, Program
programs/agentvault/src/settle.rsseeds, Pubkey, AccountInfo, Program, transfer, CpiContext
programs/agentvault/src/execute_ix.rsseeds, Pubkey, Program, CpiContext, transfer
packages/mcp-server/src/tools/lock.tsPublicKey, Keypair, SystemProgram

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/agent-settlement-protocol/. 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
.npm run test
packages/mcp-servernpm run start
packages/mcp-servernpm run build
packages/mcp-servernpm run test
.anchor build
.anchor test
.anchor run test
.cargo build
.cargo test

What you could build from it