Perps Tube.
XHomeLaunch App
Documentation

Perps on YouTube views

Perps Tube lets you go long or short on how fast a YouTube video is gaining views, with positions margined and settled in USDC on Solana. This page describes exactly how the price is derived, how positions settle, and where the sharp edges are.

What Perps Tube is

Every listed video is its own market. You take a side on the video's view velocity - how many views per hour it is currently pulling - and your position gains or loses as that rate moves. The house is the counterparty to every position; there is no order book and no matching engine, so fills happen at the mark with no slippage.

What a market is

The index is velocity, not the raw view count. A view count only ever goes up, so longs would win by construction and there would be no market. Velocity rises and falls, so both sides have something to be right about.

index price  =  views gained per hour ÷ 1000

250,000 views/hour  →  price 250     (displayed as 250K/h)
    1,200 views/hour  →  price 1.2   (displayed as 1.2K/h)

A market opens only after its velocity has been measured, so nothing is ever listed on an estimate. Until then it shows as calibrating.

Contract spec

ParameterValue
Contract1 contract = 1 unit of index (1,000 views/hour)
Notionalsize × price
MarginUSDC, minimum $1 per position
Leverage1× to 10×
Maximum position$50,000 notional
Taker fee0.05% of notional, charged on open and close
Maintenance margin0.5% of notional
Candles1 minute, aggregated to 5m / 15m / 1h in the client

PnL and liquidation

size          = (margin × leverage) ÷ entry price
PnL (long)    = (exit − entry) × size
PnL (short)   = (entry − exit) × size
liquidation   = entry × (1 ∓ (1 ÷ leverage − 0.005))

A position is liquidated when its equity - margin plus unrealised PnL - falls to the maintenance requirement. The margin is forfeited to the treasury and the position is closed at the mark.

You cannot lose more than your margin

Losses are capped at the collateral posted for that position. There are no margin calls and no negative balances.

Funding

Funding is quoted hourly and driven by open-interest skew: the crowded side pays the thin side. It is displayed on every market and in the order ticket.

Quoted, not yet charged

Funding is currently informational. It is calculated from real open interest but is not accrued against open positions.

Tenor and settlement

Each market carries the shortest tenor that still ends in the future relative to the video's upload date - 72H, 7D, 30D or 90D. The countdown is shown on every market row.

Deposits and withdrawals

Deposits are ordinary SPL transfers to the Perps Tube treasury, signed by your own wallet. The backend then re-reads the confirmed transaction from chain and credits only what actually arrived - a client-reported amount is never trusted, and the transaction signature is unique, so a replayed request cannot double-credit.

Withdrawals debit your balance first and pay out second. If the transfer fails the balance is credited back, never the reverse. Only free balance can be withdrawn; close positions to release margin first.

Custodial by design

Deposited funds are held in the Perps Tube treasury, not in a smart contract you control. You are trusting the operator to honour withdrawals.

Accounts

There is no email or password. You prove control of a Solana pubkey by signing a one-time nonce, and that becomes your account. The signature costs nothing and triggers no transaction. Any Wallet-Standard wallet works - Phantom, Solflare, Backpack, Glow and others are detected automatically.

Every balance change writes a row to an append-only ledger recording the amount, the reason and the resulting balance.

The oracle

View counts are read from YouTube directly. Velocity is measured across a fixed trailing window rather than against the previous poll, because a baseline that moves forward each refresh collapses the window and turns the rate into rounding noise.

ControlValueWhy
Refreshevery 2 minutesYouTube's public counter updates in bursts, not continuously
Window20 minuteslong enough for the delta to exceed counter granularity
Minimum span10 minutesa market never opens on a read the next measurement would correct
Minimum delta25 viewsbounds relative error; the window extends until it is met
SmoothingEMA, α = 0.35damps single-sample noise on small videos

The mark tracks the index with no synthetic noise term. Every move on the chart corresponds to a real change in how fast the video is gaining views.

Risks

  • The oracle can be influenced. Settlement rides on a view count that YouTube controls and that can be bought. Someone long a video can spend money on views to move their own settlement price.
  • YouTube can revise counts. Bot-detection sweeps remove views retroactively, which can move an index down sharply.
  • The house is the counterparty. Your payout depends on treasury solvency, not on a smart contract escrow.
  • Thin markets. Low-velocity videos have a noisier index than high-velocity ones, even with the precision gates above.
  • Regulatory. Cash-settled derivatives on a third-party index may be a regulated activity where you live.

API

Read endpoints are public. Everything that touches an account requires the session cookie issued by /api/auth/verify.

EndpointMethodPurpose
/api/marketsGETAll live markets, prices, funding, skew
/api/markets/[id]/candlesGETOHLC history for one market
/api/auth/noncePOSTIssue a nonce to sign
/api/auth/verifyPOSTExchange a signature for a session
/api/accountGETBalance, equity, positions, ledger
/api/positionsPOSTOpen a position
/api/positions/closePOSTClose a position
/api/depositGET / POSTTreasury address; credit a deposit
/api/withdrawPOSTRequest a payout
# open a 5x long with $250 of margin
curl -X POST localhost:3000/api/positions \
  -H 'content-type: application/json' \
  -b 'ytm_session=...' \
  -d '{"marketId":"<videoId>","side":"long","margin":250,"leverage":5}'