Jevdesk

How Jevdesk works.

what the code does, not what it aims to do.

Two contracts on Robinhood Chain. The engine takes cash-settled positions on tokenized stocks at up to 5x against a house pot, priced by signed prints. The strategy vault sits on top: it holds depositors' USDG, and an operator that asks Jev turns each answer into a position on the engine.

Contracts.

engine
strategies
usdg
print signer
operator

The engine.

  • A listing is a symbol, the official Robinhood token it tracks, a leverage cap (1x to 5x), a spread and an open-interest cap. Caps can only be tightened by the owner; nothing touches an open position.
  • A print is (id, price, ts, live) signed EIP-712 by one key fixed at deployment. The transaction carries it; the contract refuses one older than 90 seconds, older than the last applied, or more than 30% from it.
  • Longs open at mark plus the spread and close at mark minus it; shorts mirror it. While New York is shut the spread is tripled.
  • Open fee 0.10% of margin. Carry 0.02% of notional a day. Liquidation when equity falls to 20% of margin; the liquidator keeps a quarter of what is left. Profit is capped at three times margin, and that best case is escrowed out of the house before the position exists.
  • reduce(pid, print, bps) closes a slice of a position. The slice takes its share of margin, escrow, open interest and equity; what stays keeps its entry and its clock.
  • If no print has been applied to a listing for seven days, anyone may settle its positions at the last print.

The strategy vault.

  • create(name, listing, maxLev, configHash): anyone. The hash is the keccak of the canonical JSON of the config (keys sorted, no whitespace). The text is published to /api/strategy, which accepts it only if it hashes to what the chain holds.
  • deposit(id, amount, print) mints shares at NAV. NAV is cash plus the position's equity at the print, which the call applies first. A flat strategy needs no print.
  • withdraw(id, shares, print) pays NAV × shares ÷ total. Cash first; if that is short, the position is reduced by exactly the fraction needed, or closed if what would remain is under 1 USDG.
  • act(id, print, side, lev, answerHash, probBps): operator only. Applies the print, closes the position if the side or leverage changed (or if more than a tenth of NAV is idle cash), opens the new one with all cash as margin less the engine's fee and the Jev slice, and records the answer hash. A retired strategy is only ever flattened.
  • Sizing: margin = cash × 10000 ÷ 10015, capped by what the house can escrow (houseFree ÷ 3) and by the listing's open-interest room.
  • Budget: 0.05% of every margin posted. settle(id, calls, amount, ref) bills at most maxPerCall per call (0.001 USDG, hard cap 0.01) and only from that strategy's budget, to the operator. Anyone may top a budget up.
  • Endings the vault did not do (a liquidation, a stale settlement) are synced on the next touch: the engine records what it paid, the vault books it as cash.
  • If NAV reaches zero with shares outstanding, the next deposit starts a fresh book; the old shares are void.

The operator.

  • Every minute it walks the strategies. One is due when its everyMin has passed and it holds money or a position.
  • State: symbol, price, previous close, today's change, 5 and 20 day returns, 20 day realized vol, 20 day high and low, whether New York is open, the time, and the position held.
  • Question: direction, a choice among long, short and flat, each with the creator's criteria as its text, sent to Jev through OpenJEV's public API (POST api.openjev.sh/v1/systemone, model openjev).
  • Decision: the chosen option's probability p. If the choice is flat or p < minConf, flat. Else lev = 1 + round((p − minConf) ÷ (1 − minConf) × (maxLev − 1)).
  • The whole exchange is written to the store first; its keccak is the answerHash posted with the act. /api/calls?id=N returns the records; hash one yourself and compare.
  • Billing: once an hour, each unsettled call is priced at what the provider reports for it (OpenJEV returns usage.cost in dollars; a typical call is about $0.00002) in USDG, never under one wei and never over the cap.

What can go wrong.

  • Leverage. A strategy at 5x is liquidated by roughly a sixteen percent move against it, and gaps happen while New York is shut. You can lose your whole deposit; you cannot lose more.
  • The feed. One key signs prices. If it lies, the contract still bounds each print to 30% of the last and the house's escrow bounds the payout. If it dies, the seven-day settlement is the way out.
  • The operator. It can be slow, wrong or absent. It cannot take depositors' money: it can only post Jev's calls and bill the Jev budget within the cap. Withdrawals never need it.
  • Jev. Its answers are probabilities, not knowledge. A strategy is only as good as its criteria and the state it is shown.
  • The house. If the pot is small, strategies are small; houseFree ÷ 3 is the largest margin anyone can post right now.