Full lesson
ZendIQ-Extension-Pro
Solana swap optimiser with MEV protection — intercepts Jupiter & Raydium swaps, scores token risk in real time, and routes through Jupiter Ultra for better fills. Chrome/Brave MV3 extension.
What it does
From the project README:
ZendIQ Pro runs alongside your favourite Solana DEX and springs into action the moment you click **Swap**. An in-page widget and popup give you:
- Original
- ZendIQ/ZendIQ-Extension-Pro
- SuperStack fork
- Blockchains/ZendIQ-Extension-Pro @
6d40d17 - Stars
- 1
- Last push (original)
- 2026-10-13
- Languages
- JavaScript, HTML
- Detected stack
- not detected
- Categories
- DeFi
- Licence
- MIT
Architecture
27 source files. By extension: .js ×27.
| Top-level directory | Source files |
|---|---|
scripts | 19 |
popup | 8 |
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/zendiq-extension-pro/. 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.
scripts/page-network.js L481–504 @ 6d40d17 · MIT · original // submit a second transaction and record the trade as unoptimised. if (decision === 'skip') { return new Response(JSON.stringify({ error: 'Superseded by ZendIQ' }), { status: 400, headers: { 'Content-Type': 'application/json' }, }); } // 'confirm' from the network-path overlay (fallback for non-wallet-hook flows) return _captureConfirmTrade(resource, init, risk); } catch (overlayErr) { console.error('[ZendIQ] /execute overlay error, falling through:', overlayErr?.message); } } } // ── RPC sendTransaction intercept ────────────────────────────────── const isRpc = url && ( url.includes('api.mainnet-beta.solana.com') || url.includes('.helius-rpc.com') || url.includes('rpcpool') ); if (isRpc && (methodName === 'sendTransaction' || methodName === 'send_raw_transaction') && !window.__zendiq_own_tx && !window.location.hostname.includes('pump.fun')) { // ── Raydium "Continue with original route" — tap RPC response for sig ──- Line 488
return _captureConfirmTrade(resource, init, risk);: Creates and pays for a new account. Space and payer must be specified. - Line 495
// ── RPC sendTransaction intercept ──────────────────────────────────: Submits the signed transaction to the cluster.
scripts/page-token-score.js L109–132 @ 6d40d17 · MIT · original // (y² − 1) / (d·y² + 1) is a square mod p. A PDA is off-curve, so no private key exists for it. const _P = (1n << 255n) - 19n; const _D = 37095705934669439343138083508754565189542113879843219016388785533085940283555n; function _modPow(b, e) { let r = 1n; b %= _P; while (e > 0n) { if (e & 1n) r = r * b % _P; b = b * b % _P; e >>= 1n; } return r; } function _isOnCurve(bytes) { let y = 0n; for (let i = 31; i >= 0; i--) y = (y << 8n) | BigInt(i === 31 ? bytes[i] & 0x7f : bytes[i]); y %= _P; const y2 = y * y % _P; const u = (y2 - 1n + _P) % _P; const v = (_D * y2 + 1n) % _P; if (u === 0n) return true; return _modPow(u * _modPow(v, _P - 2n) % _P, (_P - 1n) / 2n) === 1n; } const _isOffCurveB58 = (addr) => { try { return !_isOnCurve(ns.b58Decode(addr)); } catch (_) { return false; } }; // Canonical PDA: SHA-256(seeds || bump || program || "ProgramDerivedAddress"), first // off-curve result from bump 255 down — what findProgramAddressSync returns. async function _findPda(seeds, programB58) { const program = ns.b58Decode(programB58);- Line 129
// Canonical PDA: SHA-256(seeds || bump || program || "ProgramDerivedAddress"), first: Uses the bump seed, the extra byte that pushes the derived address off the ed25519 curve. - Line 130
// off-curve result from bump 255 down — what findProgramAddressSync returns.: Derives a PDA from seeds and the program ID and returns the address with its canonical bump.
How to run
No package.json, Anchor.toml, Cargo.toml, go.mod or Makefile was found near the root. See the project README.
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