Sol.College

Structure lesson (licence does not allow quoting code)

FairOdds

Original
corki1337/FairOdds
SuperStack fork
Blockchains/FairOdds @ 5951932
Stars
0
Last push (original)
2026-10-11
Languages
TypeScript, Rust, HTML, CSS, JavaScript, PowerShell
Detected stack
AnchorNext.jsweb3.js
Categories
Other
Licence
none detected: code not quoted on Sol.College

Architecture

113 source files. By extension: .ts ×62, .rs ×33, .tsx ×13, .js ×4, .py ×1.

Top-level directorySource files
app48
programs31
scripts29
tests3
migrations1
examples1

On-chain programs: programs/aichain, programs/yield_park

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_parkInitializeParkprograms/yield_park/src/lib.rs:15
seed_reserveSeedReserveprograms/yield_park/src/lib.rs:19
depositDepositprograms/yield_park/src/lib.rs:23
cover_principal_dustCoverPrincipalDustprograms/yield_park/src/lib.rs:27
withdrawWithdrawprograms/yield_park/src/lib.rs:31
handlerCoverPrincipalDustprograms/yield_park/src/instructions/cover_principal_dust.rs:15
handlerInitializeParkprograms/yield_park/src/instructions/initialize_park.rs:38
handlerWithdrawprograms/yield_park/src/instructions/withdraw.rs:45
handlerDepositprograms/yield_park/src/instructions/deposit.rs:50
handlerSeedReserveprograms/yield_park/src/instructions/seed_reserve.rs:39
attach_market_policyAttachMarketPolicyprograms/aichain/src/lib.rs:54
place_betPlaceBetprograms/aichain/src/lib.rs:58
lock_marketLockMarketprograms/aichain/src/lib.rs:62
resolve_marketResolveMarketprograms/aichain/src/lib.rs:66
cancel_expiredCancelExpiredprograms/aichain/src/lib.rs:70
claim_winningsClaimWinningsprograms/aichain/src/lib.rs:74
refundRefundprograms/aichain/src/lib.rs:78
harvest_to_treasuryHarvestToTreasuryprograms/aichain/src/lib.rs:82
withdraw_treasuryWithdrawTreasuryprograms/aichain/src/lib.rs:86
initialize_seasonInitializeSeasonprograms/aichain/src/lib.rs:90
place_season_betPlaceSeasonBetprograms/aichain/src/lib.rs:91
resolve_seasonSettleSeasonprograms/aichain/src/lib.rs:92
cancel_seasonSettleSeasonprograms/aichain/src/lib.rs:93
claim_seasonClaimSeasonprograms/aichain/src/lib.rs:94
faucet_mintFaucetMintprograms/aichain/src/lib.rs:96
initializeInitializeSeasonprograms/aichain/src/instructions/seasons.rs:53
betPlaceSeasonBetprograms/aichain/src/instructions/seasons.rs:89
settleSettleSeasonprograms/aichain/src/instructions/seasons.rs:130
claimClaimSeasonprograms/aichain/src/instructions/seasons.rs:186
handlerInitializeGlobalprograms/aichain/src/instructions/initialize_global.rs:41

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
scripts/common.tsPublicKey, findProgramAddressSync, Program, SystemProgram, transfer, ComputeBudgetProgram
tests/program-test/integration.rsPubkey, Keypair, transfer, Transaction, seeds, has_one
programs/aichain/src/instructions/seasons.rsseeds, Program, CpiContext, Pubkey, has_one, transfer
app/src/lib/anchor.tsPublicKey, findProgramAddressSync, AnchorProvider, Program, Connection
app/src/lib/cranks.tsPublicKey, Program, Connection, SystemProgram, ComputeBudgetProgram, getAssociatedTokenAddressSync
programs/aichain/src/yield_cpi.rsAccountInfo, seeds, CpiContext, transfer
scripts/seed-liquidity.tsKeypair, PublicKey, SystemProgram, transfer, AnchorProvider, findProgramAddressSync
scripts/smoke-devnet.tsPublicKey, Keypair, SystemProgram, getAssociatedTokenAddressSync, Transaction, transfer
app/src/lib/server/markets.tsPublicKey, Program, SystemProgram, Transaction, getAssociatedTokenAddressSync, AnchorProvider
app/src/lib/seasons.tsPublicKey, Program, Connection, SystemProgram, findProgramAddressSync
tests/api/transactions.test.tsKeypair, PublicKey, Transaction, getLatestBlockhash
app/src/lib/serverWallet.tsKeypair, Transaction, VersionedTransaction, sendTransaction, Connection, signTransaction

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/fairodds/. 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
appnpm run dev
appnpm run start
appnpm run build
appnpm run lint
.anchor build
.anchor test
.anchor run test
.cargo build
.cargo test

What you could build from it