ShadowPerp Documentation

ShadowPerp is a private perpetual trading app on Solana. It combines encrypted positions, delegated session trading, and Arcium Multi Party Computation so traders can operate without exposing order details on chain by default.

Overview

ShadowPerp enables private perpetual futures trading on Solana. Trade size, direction, leverage, and margin are encrypted before they reach the on chain program. Sensitive calculations run through Arcium's MPC network rather than being exposed in plaintext on the ledger.

Only the minimum public state required for settlement is written on chain. The protocol is designed to prevent position data from becoming exploitable public information.

ShadowPerp supports 6 trading pairs: SOL-USD, BTC-USD, ETH-USD, JUP-USD, PYTH-USD, and ORCA-USD. Each pair routes to its own on-chain market PDA, while delegated sessions and shared collateral keep execution reusable across supported markets. The selected pair persists across page refreshes.

ShadowPerp is currently deployed on Solana Devnet at program ID ESyrZFvBAbZmTgjEQwuNCrM7Jwaupt4jkNQE32pBt7N4. All balances are test funds.
Current live status: delegated sessions, delegated collateral actions, shared-collateral migration flows, shielded-collateral base flows, and the hardened relay/runtime stack are working on devnet. The remaining blocker is the Arcium-backed open-position lane, which still fails before reaching a stable Open state on the current namespace.

How It Works

Each trade follows the same core path:

  1. Encrypt | Your browser encrypts sensitive trade inputs including size, price, leverage, direction, and margin before submission.
  2. Queue | The encrypted payload is submitted to the Solana program, which queues an Arcium MPC computation.
  3. Compute | Arcium's MPC network evaluates trade logic, margin checks, PnL, and liquidation conditions without exposing raw inputs to any single node.
  4. Callback | Arcium returns a verified, replay hardened result to the Solana program.
  5. Settle | ShadowPerp updates the margin account and position state from the verified output.

After your session is approved, the relay submits trades on your behalf. You sign once for the session instead of approving a wallet prompt for every action.

ShadowPerp now keeps longer callback wait windows and surfaces on-chain callback failures more directly. That improves diagnosis and keeps failed opens from looking like indefinite pending states, but it does not change the current devnet open-lane blocker itself.

Session Trading

ShadowPerp uses a delegated session model to keep the trading experience seamless. Here is what happens when you start a session:

  1. You sign a CreateTradeSessionV2 transaction by default. This creates a wallet scoped session PDA tied to your wallet and the relay, and reusable across supported markets.
  2. You sign a short authorization message. This is not a transaction. It simply proves that the relay can act for you during the session window.
  3. For the rest of that session, the relay can submit trades and delegated collateral actions without opening a wallet popup each time.

Session Limits

ParameterDefault
Session durationDefault 5 hours, up to 48 hours
Max actions200 trades
Max margin per action1,000 USDC
RevocableYes, anytime on chain
The session authorization signature is tied to a specific session ID, scope, and expiry. With the default wallet scoped session model, the same session can be reused across supported markets until it expires or is revoked. Older market scoped sessions remain supported for backward compatibility.

Revoking a Session

You can revoke your active session at any time from the Settings panel. Open Settings, go to the Trading tab, and click Revoke Session. This submits a transaction that invalidates the session on chain immediately. The relay will reject all further requests from that session the moment the transaction confirms.

Privacy Model

ShadowPerp relies on Arcium as the privacy layer behind trading. Here is the practical boundary between what stays private and what remains visible:

What is private

  • Position size
  • Entry price
  • Leverage
  • Direction
  • Margin amount
  • Unrealized PnL

What is public

  • Your wallet address, which is used for the margin account and session
  • Token transfers to and from the vault (Solana constraint)
  • The fact that a trade was queued, but not the details
  • Session creation and revocation

What is becoming private (shielded collateral)

  • Internal collateral ownership and allocation
  • Margin lock and release transitions
  • Per-user balance within the protocol
The reference orderbook pulls live market depth from external venues including Binance, Coinbase, Bybit, and Gate.io depending on the selected pair. Provider selection happens through the server-side reference depth pipeline, with cached client state used as a graceful fallback when a provider is temporarily unreachable. The orderbook provides market context only and does not represent ShadowPerp's own venue liquidity. It does not reveal other traders' positions.

Margin and Leverage

ShadowPerp supports two margin modes and leverage up to 50x.

The current devnet namespace now uses a migration-backed shared collateral model for adopted markets. After your wallet is migrated from any legacy per-market margin accounts, one owner scoped collateral balance can back positions across supported pairs instead of requiring a separate funding bucket per market.

Cross Margin

Your full margin balance is shared across all cross margin positions. If one position loses, the rest of the balance absorbs it, which can reduce liquidation risk on a single position but exposes more of your account to aggregate losses.

Isolated Margin

A fixed amount of margin is assigned to one position. If that position is liquidated, only that isolated margin is at risk and the rest of your balance stays untouched.

Leverage

Leverage increases both upside and downside relative to your margin. Available range: 1x to 50x.

Shared collateral across pairs is active on adopted markets, but it is not automatic for every wallet. If you have legacy per-market balances, you still need the migration runbook before treating your collateral as one global pool.
LeverageRisk LevelLiquidation Sensitivity
1x to 5xLowLarge move required to liquidate
10x to 15xMediumModerate move liquidates
20x to 30xHighSmall adverse move liquidates
40x to 50xVery HighMinimal move liquidates

Order Types

Market Order

A market order executes against the current oracle price. The position is queued for MPC computation and opens once the Arcium callback returns successfully.

Limit Order

A limit order is queued in the browser and triggered when the market price crosses your chosen level. When that happens, the relay submits the order for you.

Limit orders currently run in the browser. That means the tab needs to stay open for them to trigger. Also note that market-order queueing is working on devnet, but end-to-end open finalization is still under active investigation on the current namespace.

Take Profit / Stop Loss

Each open position can have optional TP and SL rules. These are stored locally and monitored by the client.

  • Take Profit (TP) | closes the position when price reaches your target.
  • Stop Loss (SL) | closes the position when price reaches your protection level.

You can set TP and SL in the trading panel before opening a position, or edit them later from the position row. Use the Save action to keep the rule.

Validation Rules

  • For long positions, TP must be above entry and SL must be below entry.
  • For short positions, TP must be below entry and SL must be above entry.
  • TP and SL must be at least 0.10% away from entry price.

Liquidation

A position is liquidated when its health ratio falls below the maintenance threshold. The health ratio is calculated as:

Health = (Equity / Maintenance Margin) x 100%

  • Liquidation threshold: set per market in basis points, enforced by the on-chain program
  • Liquidation penalty: 5% to the liquidator, with the remainder returned to the trader

In cross margin mode, your full balance acts as equity. In isolated mode, only the position's allocated margin counts.

Liquidation is enforced on chain through Arcium's MPC network. The liquidator never sees your plaintext position details.

Shielded Collateral

ShadowPerp already has the base shielded collateral flow deployed on devnet. Deposits, private withdrawal requests, proof verification callbacks, and delayed finalization are live. The remaining work is private margin lock and private position settlement through Arcium MPC.

How it works

  1. Deposit | You deposit USDC to the vault. The token transfer is public (Solana constraint), but the protocol creates a private commitment in a Merkle tree instead of updating a plaintext balance.
  2. Trade | Margin lock and release transitions happen through Arcium MPC, consuming and producing commitments without revealing your internal balance.
  3. Withdraw | You first create a pending withdrawal, then queue an Arcium MPC proof check, and only finalize after the callback marks that withdrawal as verified and the delay window has passed.

What stays private

  • Your internal balance within the protocol
  • How much margin is allocated to each position
  • The connection between deposits and trading activity

What remains public

  • USDC transfers to and from the vault (Solana L1 constraint)
  • The fact that a deposit or withdrawal happened
  • Timestamps of transactions
Shielded collateral deposit, withdrawal request, proof verification callback, and finalization are deployed on devnet. The current withdrawal proof is a simplified additive-binding MPC check over the claimed amount, commitment secret, and nullifier preimage. It is not yet a full private Merkle-membership proof of note ownership. Private margin lock and settle transitions are still in progress.

FAQ

Do I need to keep the browser open?

For market orders, the relay and callback path continue after submission, so you do not need to keep the tab open just to keep the request alive. For limit orders and TP and SL automation, yes. Those flows still run in the browser and need the tab to stay open.

How do I deposit collateral?

Click Collateral in the trading panel, or use the deposit button in the portfolio summary. You must deposit USDC before you can open a position. For devnet testing, use a devnet USDC faucet to fund your wallet with the correct test mint.

Why does my position show "Queued" or "Finalizing"?

Those states mean the trade was submitted successfully and is moving through the protected callback path. Queued means Shadow is still waiting for the Arcium MPC callback to return. Finalizing means the callback completed and the remaining on-chain settlement steps are finishing. On devnet this typically takes 30 to 120 seconds depending on cluster load. If it takes longer, the cluster may be temporarily delayed, but your collateral remains safe and the position will either resolve once settlement completes or fail into a terminal state if the callback aborts on chain.

Current devnet status: wallet scoped delegated sessions and delegated collateral actions are working across supported markets. The open position callback path is still being debugged on the current namespace. A new staged diagnostic harness now shows the abort survives tuple-only, margin-check, and full-check probes, so the current evidence points away from simple margin or leverage business logic drift.

Is my data stored anywhere?

Trading preferences, session info, automation rules, cached activity, layout preferences, and RPC settings are stored in your browser's localStorage. Actual on chain position state is still read from Solana, but the app also keeps a few local convenience snapshots so the interface can restore faster. Server-backed features such as the relay and history routes may receive your public wallet address and encrypted trade inputs when needed to fulfill the request.

Can I use ShadowPerp on mainnet?

Not yet. ShadowPerp is currently devnet only. Mainnet deployment depends on a fully verified open and close flow, production operational confidence, and a comprehensive audit.

Privacy Policy

Effective: March 2026

Information We Collect

ShadowPerp does not require account registration and does not collect personally identifiable information. When you connect a wallet, your public key is used only to identify your on chain margin account and trading session. Some server-backed features, including relay requests and wallet history lookups, may receive your public wallet address in order to fulfill the request, but the product does not create a user profile or account around that data.

The relay server receives encrypted trade inputs and your session authorization signature. These are used only to submit transactions on your behalf. ShadowPerp is not designed to retain plaintext trade inputs as application records, but normal operational logs and hosting telemetry may still capture request metadata during debugging or incident handling.

Cookies and Local Storage

ShadowPerp stores session information, automation rules, theme and layout preferences, RPC preferences, activity cache entries, and some UI convenience metadata in your browser's localStorage. This data stays on your device unless a specific server-backed feature needs your public wallet address or encrypted payload to complete the request. No third party tracking cookies are used.

Blockchain Data

Solana transactions are public by nature. ShadowPerp minimizes what is written on chain by keeping position details encrypted and recording only settlement outputs. Collateral deposits and withdrawals still involve public USDC transfers.

Third Party Services

ShadowPerp uses Pyth Network for primary oracle price feeds, with public APIs from Coinbase and Binance for reference data. ShadowPerp does not intentionally send personal profile data to these services. Arcium processes encrypted trade inputs, and individual MPC nodes do not get access to the plaintext data.

Contact

Questions about privacy can be sent to @emperoar007 on X.

Terms of Use

Effective: March 2026

Acceptance

By accessing ShadowPerp, you agree to these terms. If you do not agree, please do not use the platform.

Prototype Status

ShadowPerp is an experimental prototype deployed on Solana Devnet. All balances are test funds with no real monetary value. Do not send real assets to devnet addresses. The protocol should not be treated as fully live until end-to-end open and close are both signed off on the active namespace.

No Financial Advice

Nothing on ShadowPerp is financial, investment, or trading advice. Perpetual futures carry meaningful risk. You are responsible for your own trading decisions.

Prohibited Use

  • Using ShadowPerp to launder funds or bypass financial regulation
  • Attempting to exploit, manipulate, or attack the protocol
  • Reverse engineering the encrypted computation system
  • Accessing ShadowPerp from jurisdictions where this type of service is prohibited

Limitation of Liability

ShadowPerp is provided "as is" without warranty. The developers are not liable for loss of funds, data, or opportunity arising from use of the platform, including smart contract bugs, MPC failures, or network disruptions.

Changes

These terms may be updated over time. Continued use after changes means you accept the revised terms.

Cookie Policy

Effective: March 2026

What We Use

ShadowPerp does not use traditional HTTP cookies for tracking or analytics.

We do use browser localStorage for a few practical product features:

KeyPurposeExpires
shadow-themeLight or dark mode preferencePersistent
shadowperp.relay.session.v1:*Active trading session info per wallet and scope. Wallet scoped sessions use the same namespace with an all markets key.Session expiry
shadowperp:ui:margin-mode:v1:*Margin mode preference per walletPersistent
shadowperp:automation:v1:*Limit orders and TP or SL rules per walletPersistent
shadowperp:posviews:v1:*UI convenience snapshots of decrypted position views keyed by walletPersistent
shadowperp-trading-settingsTrading settings such as slippage and default leveragePersistent
shadowperp-selected-pairLast selected trading pairPersistent
shadowperp.rpc.endpointsSaved custom RPC endpoint listPersistent
shadowperp.rpc.override / shadowperp.rpc.indexActive RPC override and selected endpoint preferencePersistent
shadowperp-panel-visibilityLayout panel visibility preferencesPersistent
shadowperp-layout-locked / shadowperp-layout-v7Saved terminal layout lock state and grid arrangementPersistent
shadowperp:ui:activity:v2:*Cached wallet activity labels used by the wallet popupRolling local cache

Third Party Cookies

No third party analytics, advertising, or tracking cookies are used. External APIs may set their own cookies if you visit them directly, but ShadowPerp only uses their public endpoints on the server side.

Clearing Your Data

You can clear all ShadowPerp local data through your browser developer tools by clearing localStorage for the ShadowPerp domain, or by using your browser's clear site data option.

Back to homepage