Architecture

What Rumor Perps is made of, how a trade travels from your signature to the contract, and what Rumor's server can't do.

Rumor Perps is fully onchain: everything that holds or moves money lives in the Rumor Perps contract on BNB Chain. Your wallet signs your trades, and Rumor's server sends them to the contract.

The parts

  • The Rumor Perps contract holds every open position, the pool, the payout queue and your Shards balance. It opens and closes positions, settles them against the pool and credits Shards.
  • Your wallet signs every open and close. The only transaction it sends itself is the one-time USDT approval.
  • Rumor's server, at Rumor's cost:
    • adds the latest Pyth price to the trades you sign and sends them to the contract;
    • liquidates positions that reach their liquidation price;
    • pays out the payout queue as money comes into the pool;
    • checks the maximum leverage, the maximum position size and the limits on longs and shorts.
  • Pyth supplies the prices; see pricing.
  • A 2-of-2 multisig and a 2-day timelock control the contract; see contracts and admin keys.

A trade, end to end

  1. You click Open long and sign the trade in your wallet. There is no gas to pay.
  2. Rumor's server checks the leverage, the position size and the limit on longs, adds the latest signed Pyth price and sends the trade to the contract. It pays the gas and Pyth's update fee.
  3. The contract checks your signature, Pyth's signature on the price, how fresh the price is, and the minimum margin and position size.
  4. The contract takes the margin from your Queued balance first, then from your wallet, and opens the position at that price.
  5. When you close, you sign again, the contract checks your signature and the price, and settles the position against the pool: your margin and profit go to your wallet, whatever the pool can't pay joins the payout queue, and a loss earns Shards.
  6. The result shows in the Positions and History tabs.

A trade, end to end: your wallet signs the trade with no gas and approves USDT; Rumor's server adds the latest signed Pyth price, pays the gas and also sends liquidations and queue payouts; the Rumor Perps contract on BNB Chain checks your signature, Pyth's signature and that the price is at most 5 seconds old, opens and closes positions at the Pyth price, takes losses into the pool and pays wins from it, queues unpaid profit first in, first out and credits Shards on every loss; margin comes from your wallet, and returns and payouts go back to it.

What Rumor's server can't do

  • Trade for you. It can't open or close a position without your signature. The one exception is liquidation: the server triggers it, and the contract checks that the price really reached the liquidation price.
  • Take your funds. What a position returns and every queue payout go only to your wallet.
  • Make up a price. The contract accepts only prices signed by Pyth and no older than 5 seconds.

On this page