Repository navigation
v0.6.0 — SPL Tokens, Pyth Oracle, Security Hardening
What's New
Real Token Transfers
- Deposit/withdraw now move actual SPL tokens (e.g. USDC) via
transfer_checkedCPI - PDA-controlled vault (
[b"vault", market.key()]) holds all market collateral - Mint and token account validation enforced by Anchor constraints
On-Chain Pyth Oracle
- Crank instruction reads price directly from a Pyth v2 price feed account
- No more passing oracle price as a parameter — price is read and validated on-chain
- Staleness check (60s max), Trading status required, exponent bounds [-18, 18]
Security Hardening
- Program owner validation on all market account access (prevents fake account injection)
- Pyth oracle account owner validation (must be owned by Pyth program)
- Checked arithmetic for price exponent conversion (no silent overflow/truncation)
- Future oracle timestamps rejected in staleness check
- Self-trade prevention (
account_a != account_b) init_oracle_price > 0andamount > 0validation- Header deserialization returns error instead of panicking
Breaking Changes
deposit/withdrawamount type:u128→u64(matches SPL token amounts)crankno longer acceptsoracle_priceparameter — pass a Pyth feed account insteadkeepernow requires--pyth-feed <PUBKEY>(no longer optional)- Chain CLI commands require
--mintand--token-accountfor deposit/withdraw
Upgrade from Anchor 0.32 → 1.0
- Full Anchor 1.0 compatibility with Solana CLI 3.0
CpiContext::newtakesPubkey(notAccountInfo)
All 6 crates published on crates.io:
percolator-engine · percli-core · percli-program · percli-chain · percli-wasm · percli