Skip to main content
Papertrade trades real USDC, unrelated to Paper trading (circuit run --simulated); a Paper trading session trades Papertrade with Papertrade’s live prices, rules and rates, without its intent queue or payout queue. It settles synthetic perpetuals on HyperEVM against its own liquidity pool at Hyperliquid’s order-book mid: no order book, spread, slippage or funding. Every trade is its own isolated position with fixed margin and leverage up to 1000×; there are no resting orders, partial closes or margin top-ups. agent.papertrade.positions.open({ asset, side, amount: { value }, leverage, fundFrom }) opens a position with the fields of the shared perpOpen: asset is a market Papertrade lists, such as "BTC" or "ETH", as markets.list() names them; side is "long" or "short", value is the position’s USDC notional, and its margin is value ÷ leverage, truncated to 18 decimals. fundFrom: "queued" takes that margin from queued winnings instead of the available balance (the default): Papertrade pays winning profit it cannot cover into a payout queue, so queued margin keeps that capital trading. Such a position’s surviving margin returns to queued when it closes, and a liquidation forfeits it. Papertrade’s keeper moves the minimum margin and notional; read them from markets.list() below rather than remembering them. Circuit refuses an open below either with BELOW_MINIMUM before anything is sent. The result is the shared venue order: orderId is the venue’s positionId, size is in the market’s base asset and averageFillPrice is the entry. agent.papertrade.positions.close({ positionIds }) closes one to twelve positions at the current mid and returns one reduce-only order per position, its averageFillPrice the exit and its venueStatus Liquidated when a liquidation closed it first. agent.papertrade.positions.closed({ positionIds }) returns how each named position that has closed ended, however it closed: its exitPrice, pnl in USDC after Papertrade’s win impact and fee, the paperMinted PAPER a losing close earns, and whether a liquidation closed it (liquidated). Papertrade queues every intent and executes it in a later batch; the write resolves when it executes or its one-hour deadline passes. agent.operations.cancel({ operationId }) withdraws an open, a one-position close, a stake, an unstake or a claim while it still waits in that queue, such as the other leg of a pair when one leg is refused. agent.papertrade.account.retrieve() returns the session wallet’s live Papertrade account: available balance, queued winnings, every open position on the wallet, including ones opened elsewhere, and paper with unstaked balance, staked PAPER and claimable USDC rewards. A paper session reads its own paper account, whose queued is always "0". PAPER, which Papertrade mints to traders and which cannot be transferred, earns USDC rewards while staked. agent.papertrade.paper.stake({ amount }) and agent.papertrade.paper.unstake({ amount }) move PAPER in or out of staking instantly with no lockup; amounts are PAPER decimal strings, and Circuit refuses a stake below markets.list()’s minimumStake with BELOW_MINIMUM before anything is sent. agent.papertrade.paper.claim({}, options?) credits every claimable reward to the wallet’s Papertrade USDC balance and returns the claimed USDC, which is "0" when nothing is claimable. Papertrade USDC is asset 0 on network papertrade, with 18 decimals. A swap from dollars on any network deposits into the wallet’s Papertrade deposit address in one transaction: HyperCore USDC moves directly, and other networks bridge straight to the deposit address. A swap back withdraws to HyperCore USDC; each way moves at least 10 USDC. Papertrade credits a deposit once its sweeper moves the funds, usually within minutes. Before the first trade, Circuit registers a 30-day session key derived from the wallet’s signature and renews it before it expires. A session key registered elsewhere, such as on papertrade.xyz, does not count: Circuit registers its own alongside it. Holdings report each of the session’s open Papertrade positions as its own kind: "perp" holding with its positionId, valued at Hyperliquid’s mid, with its isolated margin as marginUsedInCollateralHolding and its liquidationPrice. A liquidation, or a close sent from papertrade.xyz with another session key, counts as the opening session’s own close, so its holdings and P&L follow it. The PAPER the session’s closes minted, less what it staked, is a token holding on ethereum:999, and its staked PAPER a token holding STAKED_PAPER on papertrade. Every session shares Papertrade’s limits; a session may use at most a quarter of them, and a call waits for its turn within its deadline before failing with CAPACITY_EXHAUSTED. Read once per decision, never retry a failed read or refused action on a timer, and time periodic work such as staking from a per-session offset of agent.sessionId on the wall clock rather than from process start, since Circuit restarts every continuous session within a few minutes of each release. agent.papertrade.markets.list() returns one entry per market Papertrade lists, with the rules Papertrade enforces right now; Circuit reads them live, sharing Papertrade’s venue state for up to 5 seconds and winFeeRate, a venue-wide contract setting, for up to a minute, and owns Papertrade’s formats, so read this instead of exchange.papertrade.xyz. paused maps each of Papertrade’s actions, openPosition, closePositions, paperStake, paperUnstake, paperClaim, registerDeposit, withdrawToCore and registerSessionKey, to whether Papertrade refuses it now with VENUE_PAUSED; openPosition also covers a global trading pause and a paused market. minimumMargin, minimumNotional and maximumNotional are USDC, with maximumLeverage; minimumStake is the smallest PAPER stake. headroom.long and headroom.short are the largest notional in USDC one open on that side fits under Papertrade’s per-side open-interest cap now, valued at Hyperliquid’s best bid/ask midpoint: a larger open fails with OPEN_INTEREST_CAP, and others’ opens can take the room before yours lands. Rates are fractions, 0.02 meaning 2%. A losing close pays only its loss. A winning close keeps notional × move × (1 − impact.baseRate) / (1 + 1/(move × impact.rateMultiplier) + impact.referenceNotional/(10^6 × move × impact.positionMultiplier)), where move is the exit’s distance from entry as a share of entry less impact.deadband, and nothing when that is not positive; Papertrade then keeps winFeeRate of it. A long liquidates at entry × (1 − 1/leverage) × (1 + bustBuffer) and a short at entry × (1 + 1/leverage) × (1 − bustBuffer), forfeiting its whole margin, so a leg never loses more than its margin. A market fact Circuit cannot read is null and that market’s errors says why, without blocking its other facts or other markets: never act on a null fact; skip what it governs and surface the error. When Papertrade’s venue-wide state is unreadable, the call throws. agent.papertrade.headroom.list() returns only each market’s asset, long and short headroom and errors.