Full lesson
stellalpha
Stellalpha is a non-custodial, Solana-native automated copy-trading protocol. Users follow high-performing on-chain traders, and StellAlpha automatically mirrors their trades using a secure PDA vault architecture without ever taking custody of user funds.
What it does
From the project README:
Stellalpha is a non-custodial execution layer designed to replicate **trade intent** instead of raw transaction data. By moving beyond naive wallet mirroring, Stellalpha enables stablecoin capital to follow high-signal on-chain traders with institutional-grade risk alignment and sub-second execution.
- Original
- akm2006/stellalpha
- SuperStack fork
- Blockchains/stellalpha @
494cbf6 - Stars
- 0
- Last push (original)
- 2026-06-21
- Languages
- TypeScript, Rust, TeX, CSS, JavaScript
- Detected stack
- Next.jsweb3.js
- Categories
- DeFi
- Licence
- MIT
- Homepage
- https://stellalpha.xyz
Architecture
204 source files. By extension: .ts ×138, .tsx ×54, .rs ×12.
| Top-level directory | Source files |
|---|---|
lib | 104 |
components | 42 |
app | 36 |
carbon-parser | 12 |
worker | 3 |
(root) | 2 |
hooks | 2 |
contexts | 2 |
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/stellalpha/. Until then, the lesson and step-by-step guide below are complete, and you can run it locally with the commands below.
Key code, explained
Excerpts chosen automatically where the code uses the most Solana concepts, pinned to the fork's commit.
lib/live-pilot/rpc-rate-limit.ts L1–24 @ 494cbf6 · MIT · originalimport type { Connection } from '@solana/web3.js'; const DEFAULT_RPC_MIN_INTERVAL_MS = 40;const DEFAULT_RPC_MAX_CONCURRENCY = 2;const DEFAULT_RPC_429_BACKOFF_MS = 1_500;const DEFAULT_RPC_429_BACKOFF_MAX_MS = 15_000; const RPC_METHODS_TO_LIMIT = new Set([ 'confirmTransaction', 'getAccountInfo', 'getBalance', 'getLatestBlockhash', 'getParsedAccountInfo', 'getParsedTokenAccountsByOwner', 'getSignatureStatuses', 'getTokenAccountBalance', 'sendRawTransaction', 'sendTransaction',]); type QueueItem<T> = { run: () => Promise<T>; resolve: (value: T) => void; reject: (error: unknown) => void;- Line 12
'getLatestBlockhash',: Fetches a recent blockhash. Transactions expire if it gets too old. - Line 18
'sendTransaction',: Submits the signed transaction to the cluster.
lib/live-pilot/token-account-rent.ts L169–192 @ 494cbf6 · MIT · original transaction.sign([owner]); return transaction;} async function submitCloseTargets(args: { connection: Connection; owner: Keypair; closeTargets: TokenAccountCloseTarget[];}) { const { connection, owner, closeTargets } = args; const latestBlockhash = await connection.getLatestBlockhash('confirmed'); const transaction = buildCloseTransaction({ owner, closeTargets, blockhash: latestBlockhash.blockhash, }); const signature = await connection.sendTransaction(transaction, { maxRetries: 0, skipPreflight: TOKEN_ACCOUNT_RENT_SWEEP_SKIP_PREFLIGHT, preflightCommitment: 'confirmed', }); const confirmation = await waitForSignatureConfirmation(connection, signature, { timeoutMs: TOKEN_ACCOUNT_RENT_SWEEP_CONFIRM_TIMEOUT_MS,- Line 179
const latestBlockhash = await connection.getLatestBlockhash('confirmed');: Fetches a recent blockhash. Transactions expire if it gets too old. - Line 186
const signature = await connection.sendTransaction(transaction, {: Submits the signed transaction to the cluster.
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.
| Directory | Command | Runs |
|---|---|---|
. | npm run dev | tsx lib/banner.ts && next dev |
. | npm run start | next start |
. | npm run build | next build |
. | npm run test | vitest run |
. | npm run lint | eslint . |
What you could build from it
- Fork the SuperStack copy and extend it within the DeFi gaps listed on the idea page.
- Learn the pattern first: Program Derived Addresses (PDAs)
- Learn the pattern first: Cross-Program Invocations (CPIs)
- Learn the pattern first: SPL Tokens: mints, accounts and transfers