# Thesis PERPS > Thesis PERPS is a Solana perpetuals platform using MagicBlock Ephemeral Rollups for delegated trading state and Solana mainnet for token custody and settlement. ## Documentation - [Solana and MagicBlock: readable HTML](/docs/onchain.html): Complete explanation below, available without JavaScript. - [Full site docs](/docs#/intro/what-is-thesis-perps): Trading, collateral, FIFO payouts, ownership, custody and risks. - [Current deployment](/deployment.json): Public program and token configuration for this host. ## Solana & MagicBlock Solana programs execute the trades. MagicBlock accelerates delegated state. Solana mainnet settles the funds. ### Why MagicBlock is part of our Solana architecture MagicBlock Ephemeral Rollups extend Solana with a specialized Solana Virtual Machine (SVM) runtime. Thesis PERPS delegates selected Solana state accounts to an ER validator, executes its Solana program against that state, and commits the resulting state back to Solana. Users keep their Solana wallets and deposited tokens remain in Solana program-controlled vaults. This is onchain program execution in an auxiliary Solana execution environment. An ER confirmation is not the same as a finalized Solana mainnet transaction: commitments and base-layer settlement are separate steps. Delegation and the ER validator add their own security and availability assumptions. Delegate Solana state → Execute in MagicBlock → Commit to Solana - [MagicBlock: Ephemeral Rollups](https://docs.magicblock.gg/pages/ephemeral-rollups-ers/introduction/why) - [MagicBlock: delegation, commitment and undelegation](https://docs.magicblock.gg/pages/ephemeral-rollups-ers/introduction/ephemeral-rollup) ### What “fully onchain” means here The authoritative financial state is held in program accounts across the ER and Solana base layer. The program records positions and their opening and closing prices, applies PnL and liquidation rules, and enforces the settlement accounting. Mainnet programs control token transfers, settlement swaps, the FIFO payout queue, ownership balances and staking rewards. The browser displays that state. The backend relays prices, prepares transactions, submits keeper actions and caches history. Those services run offchain, but a database edit alone cannot transfer vault tokens or create an onchain claim. They submit transactions and inputs that must pass the program’s checks. ### Price updates in milliseconds MagicBlock documents Pyth Lazer oracle-account updates every 50–200 milliseconds, depending on the asset. Thesis PERPS’s price sampler targets 250-millisecond intervals, and the shared browser price relay sends up to four updates per second. These are feed specifications and scheduling targets, not a guarantee of end-to-end trade latency or a measurement of every live update. The trading program reads supported market oracle accounts in the ER. Existing account notifications also drive the live chart and price display. Each displayed tick does not require its own Solana mainnet transaction. Commits and settlement still have costs, and a displayed tick is not a guaranteed execution price. - [MagicBlock: oracle feeds and update frequencies](https://docs.magicblock.gg/pages/tools/oracle/introduction) - [Thesis PERPS: market prices and collateral quotes](/docs#/how/pricing) ### From a position to spendable tokens Opening and closing update delegated position state in the ER. Required state is then committed or released to Solana, where settlement transactions return unused collateral, execute any required swaps and record the final pool and ownership amounts. Winning profit enters the onchain FIFO queue and is paid in the market backing token at its USD spot price as liquidity permits. A closed position, a completed settlement and a paid FIFO claim are different events. Fast price updates do not promise an instant withdrawal or payout. ### Onchain execution still has trust assumptions Thesis PERPS relies on MagicBlock’s validator and oracle accounts, authorized publisher inputs for collateral valuation and settlement, keepers, and the program’s upgrade authority. Freshness, permissions and replay checks constrain accepted inputs; they do not make an authorized publisher’s quote independently trustless. The current market-price path consumes MagicBlock-attested oracle account data; Thesis PERPS does not independently verify every underlying Pyth Lazer signature. Onchain describes where financial rules execute and state is recorded. It does not mean every service runs onchain, every input is independently verified, or every ER update has already finalized on mainnet. - [Architecture and authority](/docs#/how/architecture) - [Custody and recovery](/docs#/how/custody) - [Risks and limitations](/docs#/how/risk) ## Architecture overview Solana custody, a fast execution layer, and real settlement swaps. ### Three parts of the system The frontend displays balances and signs user actions. A backend relays public prices, prepares sponsored transactions and runs settlement keepers. On-chain programs validate state transitions and own the custody rules. MagicBlock ephemeral rollups execute delegated trading state. Solana’s base layer holds token custody and processes the actual swaps, payouts and withdrawals. Browser wallet → MagicBlock execution → Solana settlement ### What the UI cannot decide A displayed number does not authorize a payout. Confirmed program state and settlement receipts determine balances and claims. Delegation, operator permissions, oracle inputs and upgrade authority remain meaningful trust assumptions. ### An ordinary position lifecycle Deposit → make trading funds available → open → close or liquidate → commit/release required state → execute settlement → issue ownership or service the FIFO claim. Some phases complete separately, so the UI shows progress instead of pretending every step is instantaneous. ## Pricing: oracles and swap quotes Market direction and collateral liquidity use different evidence. ### Market prices through MagicBlock Supported market feeds are read from MagicBlock’s oracle accounts. Existing account notifications feed a shared backend relay and a browser event stream. Rendering another price animation does not itself require another on-chain price-write transaction. MagicBlock documents 50–200 ms oracle updates per asset. Thesis PERPS targets a 250 ms sampling interval and limits the browser relay to four updates per second. Feed cadence, program execution, ER confirmation and Solana settlement are separate stages; those intervals are not a settlement-time guarantee. - [Solana & MagicBlock](/docs#/intro/solana-magicblock) - [MagicBlock oracle documentation](https://docs.magicblock.gg/pages/tools/oracle/introduction) ### Executable collateral value A token’s spot price or market cap is not enough to value a large bag. The opening and closing quotes account for the quantity, the supported pool’s reserves, fees and price impact. SOL uses the SOL/USD oracle and USDC uses its quote-collateral accounting path. The current design compares opening and closing collateral quotes. It does not preserve the lowest collateral tick throughout the trade. Bet backing replaces that earlier design. ### Freshness and order Stale, malformed or out-of-order data must not replace newer verified state. Opening and closing can briefly wait for fresh inputs; confirmation, swap and payout phases can still take longer than that price-readiness window.