Sol.College

Full lesson

Predix

Predix; trade reliably.

What it does

From the project README:

Predix, kripto analiz dünyasında devrim yaratıyor. Geleneksel platformlarda analistler kendi paraları ile işlem yaparak analiz paylaşırken, bizde tamamen farklı bir yaklaşım benimsedik. Analistlerimiz sadece bilgi ve deneyimlerini paylaşarak gelir elde edebiliyor.
Original
ymbozkurt/Predix
SuperStack fork
Blockchains/Predix @ 6f57791
Stars
0
Last push (original)
2025-06-06
Languages
TypeScript, Rust, HTML, CSS, JavaScript
Detected stack
Anchorweb3.js
Categories
Other
Licence
Apache-2.0

Architecture

16 source files. By extension: .tsx ×9, .ts ×5, .js ×1, .rs ×1.

Top-level directorySource files
app13
migrations1
programs1
tests1

On-chain programs: programs/predix

❌ Does not build as-is, checked 2026-11-02 Tested on 2026-11-02: full log results.json

Build it yourself: step-by-step guide

Every command below was run on 2026-11-02 by tests/run_fork.py against the pinned commit, and the results come from that run. The full output is in the committed log.

1. Prerequisites (versions we tested with)

cargo install --git https://github.com/coral-xyz/anchor avm --locked
avm install 0.29.0 && avm use 0.29.0
sh -c "$(curl -sSfL https://release.anza.xyz/stable/install)"

2. Clone at the tested commit

git clone https://github.com/Blockchains/Predix.git && cd Predix
git checkout 6f577914bb63f29b17892d70ff465d908a46782f

3. Configure

No environment file is needed.

Fixes we had to apply to the pinned commit before it would build or run, with the reason for each:

  1. sed -i "s/pub system_program: AccountInfo<'info>,/pub system_program: Program<'info, System>,/" programs/predix/src/lib.rs. anchor 0.29 safety check rejects an unchecked AccountInfo; use the typed System program
  2. cd app && npm pkg set devDependencies.react-refresh=^0.14.0. craco build needs react-refresh, which the app never declared
  3. sed -i 's#/learn react/i#/select wallet/i#' app/src/App.test.tsx. the Create React App placeholder test looked for 'learn react'; assert the wallet button instead

4. Install dependencies

DirectoryCommandResultTime
.npx -y yarn@1 install --ignore-engines --network-timeout 600000✅ pass3s
appnpm install --no-audit --no-fund --legacy-peer-deps✅ pass17s
.npx -y yarn@1 install --ignore-engines --network-timeout 600000✅ pass1s

5. Build

DirectoryCommandResultTime
.anchor@0.29.0 build✅ pass71s
appnpm run build❌ exit 121s
Output tail: npm run build
ever be fixed. Add "@babel/plugin-proposal-private-property-in-object" to
your devDependencies to work around this error. This will make this message
go away.
Browserslist: caniuse-lite is outdated. Please run:
  npx update-browserslist-db@latest
  Why you should do it regularly: https://github.com/browserslist/update-db#readme

6. Test

DirectoryCommandResultTime
.anchor@0.29.0 test --skip-build --provider.cluster localnet --provider.wallet ~/.config/solana/id.json❌ exit 13s
appnpm run test✅ pass4s
Output tail: anchor@0.29.0 test --skip-build --provider.cluster localnet --provider.wallet ~/
    at Object.exports.requireOrImport (/tmp/scbuild/predix/node_modules/mocha/lib/nodejs/esm-utils.js:60:20)
    at Object.exports.loadFilesAsync (/tmp/scbuild/predix/node_modules/mocha/lib/nodejs/esm-utils.js:103:20)
    at singleRun (/tmp/scbuild/predix/node_modules/mocha/lib/cli/run-helpers.js:125:3)
    at Object.exports.handler (/tmp/scbuild/predix/node_modules/mocha/lib/cli/run.js:374:5)
error Command failed with exit code 1.
Error: No such file or directory (os error 2)

7. Deploy to a local validator

solana-test-validator --reset   # separate terminal
solana config set -ul && solana airdrop 100
anchor deploy --provider.cluster localnet
DirectoryCommandResultTime
.solana airdrop 100 -u localhost >/dev/null; anchor@0.29.0 deploy --provider.cluster localnet --provider.wallet ~/.config/solana/id.json✅ pass5s

Proof: program IDs and transactions

Transaction signatures recorded on the local validator (1 shown). Local ledgers are thrown away after the run, so these work as receipts in the log and can't be looked up on an explorer:

Deploy to devnet (free)

solana config set --url devnet
solana airdrop 2   # or https://faucet.solana.com
anchor deploy --provider.cluster devnet   # native: solana program deploy target/deploy/<name>.so
# point the frontend RPC env var at https://api.devnet.solana.com

How it works

Every instruction handler in the program, with the accounts struct it validates. Each link points to the line at the pinned commit.

InstructionAccountsWhere
init_analystInitAnalystprograms/predix/src/lib.rs:12
participateParticipateprograms/predix/src/lib.rs:32
buy_postBuyPostprograms/predix/src/lib.rs:56

Extend it

  1. Add an integration test that runs the main flow end to end and asserts every account state change.
  2. Add a negative test: call each instruction with the wrong signer or account and check that it fails.
  3. Add an event (emit!) to each state-changing instruction and subscribe to it from the client.
  4. Replace any unchecked AccountInfo with typed accounts plus has_one/seeds constraints.
  5. Make the frontend read the cluster from an env var, deploy it to GitHub Pages and point it at your devnet program.
  6. Wire the build into CI by copying this site's verify-forks workflow.

Open the dapp

✅ Operational on devnet, verified 2026-11-02

Open the dapp Connect Phantom or Solflare. Every transaction is signed in your own wallet.

Devnet proof, verified 2026-11-02: real transactions sent through this program on devnet.

Key code, explained

Excerpts chosen automatically where the code uses the most Solana concepts, pinned to the fork's commit.

ymbozkurt/Predix · programs/predix/src/lib.rs L61–84 @ 6f57791 · Apache-2.0 · original
#[derive(Accounts)]pub struct InitAnalyst<'info> {    #[account(mut)]    pub signer: Signer<'info>,     #[account(init, payer = signer, space = 1000)]    analyst: Account<'info, Analyst>,    pub system_program: AccountInfo<'info>,} #[derive(Accounts)]pub struct CreateInsight<'info> {    #[account(mut)]    pub signer: Signer<'info>,     #[account(init, payer = signer, space = 1000)]    pub insight: Account<'info, Insight>,    pub system_program: AccountInfo<'info>,} #[derive(Accounts)]pub struct ValidateInsight<'info> {    #[account(mut, has_one = analyst)]    pub insight: Account<'info, Insight>,
  1. Line 64 pub signer: Signer<'info>,: Requires this account to have signed the transaction.
  2. Line 66 #[account(init, payer = signer, space = 1000)]: Creates and pays for a new account. Space and payer must be specified.
  3. Line 83 #[account(mut, has_one = analyst)]: Checks that a stored pubkey field matches the passed account.

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 lintprettier */*.js "*/**/*{.js,.ts}" --check
appnpm run startcraco start
appnpm run buildcraco build
appnpm run testcraco test
.anchor buildcompile programs and generate IDLs
.anchor testlocal validator + test suite
.anchor run testyarn run ts-mocha -p ./tsconfig.json -t 1000000 tests/**/*.ts
.cargo buildRust workspace build
.cargo testRust tests

What you could build from it