Sol.College

Structure lesson (licence does not allow quoting code)

Honoris

Institutional DeFi Fee Distribution Protocol on Solana

Original
Rahul-Prasad-07/Honoris
SuperStack fork
Blockchains/Honoris @ b1c56f4
Stars
0
Last push (original)
2025-10-30
Languages
Rust, TypeScript
Detected stack
Anchorweb3.js
Categories
DeFi
Licence
none detected: code not quoted on Sol.College

Architecture

127 source files. By extension: .rs ×95, .ts ×32.

Top-level directorySource files
programs90
tests32
rust-sdk4
example1

On-chain programs: programs/cp-amm, programs/honorary-lp

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
process_paymentProcessPaymentexample/lib.rs:74
deposit_fundsDepositFundsexample/lib.rs:186
pause_payrollPausePayrollexample/lib.rs:215
resume_payrollPausePayrollexample/lib.rs:229
create_token_badgeCreateTokenBadgeCtxprograms/cp-amm/src/lib.rs:55
create_claim_fee_operatorCreateClaimFeeOperatorCtxprograms/cp-amm/src/lib.rs:59
close_claim_fee_operatorCloseClaimFeeOperatorCtxprograms/cp-amm/src/lib.rs:63
close_configCloseConfigCtxprograms/cp-amm/src/lib.rs:67
set_pool_statusSetPoolStatusCtxprograms/cp-amm/src/lib.rs:112
create_positionCreatePositionCtxprograms/cp-amm/src/lib.rs:159
close_positionClosePositionCtxprograms/cp-amm/src/lib.rs:195
swapSwapCtxprograms/cp-amm/src/lib.rs:199
claim_position_feeClaimPositionFeeCtxprograms/cp-amm/src/lib.rs:203
lock_positionLockPositionCtxprograms/cp-amm/src/lib.rs:207
split_position2SplitPositionCtxprograms/cp-amm/src/lib.rs:239
handle_close_positionClosePositionCtxprograms/cp-amm/src/instructions/ix_close_position.rs:54
handle_swapSwapCtxprograms/cp-amm/src/instructions/ix_swap.rs:79
handle_create_positionCreatePositionCtxprograms/cp-amm/src/instructions/ix_create_position.rs:78
handle_claim_position_feeClaimPositionFeeCtxprograms/cp-amm/src/instructions/ix_claim_position_fee.rs:73
handle_close_configCloseConfigCtxprograms/cp-amm/src/instructions/admin/ix_close_config.rs:23
handle_create_token_badgeCreateTokenBadgeCtxprograms/cp-amm/src/instructions/admin/ix_create_token_badge.rs:35
handle_create_claim_fee_operatorCreateClaimFeeOperatorCtxprograms/cp-amm/src/instructions/admin/ix_create_claim_protocol_fee_operator.rs:35
handle_close_claim_fee_operatorCloseClaimFeeOperatorCtxprograms/cp-amm/src/instructions/admin/ix_close_claim_protocol_fee_operator.rs:24
handle_set_pool_statusSetPoolStatusCtxprograms/cp-amm/src/instructions/admin/ix_set_pool_status.rs:20
claim_feesClaimFeesprograms/honorary-lp/src/lib.rs:68
handle_claim_feesClaimFeesprograms/honorary-lp/src/instructions/claim_fees.rs:129

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/bankrun-utils/cpAmm.tsPublicKey, Keypair, getLatestBlockhash, getAssociatedTokenAddressSync, SystemProgram, ComputeBudgetProgram
tests/honoraryFullWorkflow.test.tsPublicKey, Keypair, sendAndConfirmTransaction, findProgramAddressSync, Connection, getAccountInfo
tests/initializePolicy.test.tsPublicKey, findProgramAddressSync, Program, Keypair, getAccountInfo, AnchorProvider
programs/cp-amm/src/event.rsPubkey, transfer
tests/claimFees.test.tsPublicKey, findProgramAddressSync, Program, Keypair, getAccountInfo, sendAndConfirmTransaction
tests/distributeFees.test.tsPublicKey, Keypair, Program, sendAndConfirmTransaction, Transaction, getAssociatedTokenAddressSync
tests/CreateInitializeClaimDistribute.test.tsPublicKey, Keypair, Pubkey, SystemProgram, AnchorProvider, Program
tests/bankrun-utils/accounts.tsPublicKey, findProgramAddressSync
tests/bankrun-utils/token.tsPublicKey, Keypair, Transaction, getLatestBlockhash, SystemProgram, getAssociatedTokenAddressSync
programs/honorary-lp/src/instructions/distribute_fees.rsseeds, has_one, Pubkey, CpiContext, Program, init_if_needed
tests/bankrun-utils/common.tsKeypair, PublicKey, mintTo, SystemProgram, Transaction, Program
example/lib.rsProgram, has_one, Pubkey, seeds, transfer, CpiContext

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/honoris/. 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
.npm run lint
.anchor build
.anchor test
.anchor run test
.cargo build
.cargo test

What you could build from it