Docs
How Okean Perps works, from pricing to wind-down, in the contracts’ own terms.
What Okean Perps is
Okean Perps lets anyone trade perpetual futures on tokens that have a USDG pool on Robinhood Chain. You go long or short with USDG as margin. You never post the token you trade.
Each market stands alone. It holds its own USDG, with its own vault and its own insurance. Nothing that happens in one market can touch another. Each network runs its own markets, and nothing moves between networks.
Anyone can launch a market, but only on one of two preset tiers. Nobody chooses their own leverage, margin or price limits, and the contracts have no owner who could change them.
Prices come from a pool’s time-weighted average, never its spot price. You can close a position and withdraw your free margin at any time, without anyone’s permission.
Getting started
- A wallet. Connect a wallet you already use, or sign in with email or a social account and get a wallet made for you. Sign-in is run by Privy.
- The network. Connect, and the app offers to switch your wallet to Robinhood Chain, adding it if your wallet does not know it yet. Its details are under Networks and contracts.
- Gas. Keep a little ETH on Robinhood Chain: it pays for every transaction.
- USDG. Hold USDG on Robinhood Chain. It is the margin of every market there, as the market factory names it.
- Margin. Pick a market on Markets, deposit USDG into it, then trade. Your wallet first asks you to let that market take the amount. Margin sits in that market only.
How a market is priced
A pinned pool. Each market is tied to one USDG pool when it launches. The market reads only that pool, and every read checks that it is the same one.
A 30 minutes average. The mark price is the pool’s 30 minutes time-weighted average. The spot price is never read, so a single large swap barely moves the mark.
Capped steps. Each accepted update can move the mark only a capped step from the last one, set by the tier. No tier’s step can be under 0.5% or over 10%, so the cap can never be switched off. An update is accepted at most once every 30 seconds. Trades, margin moves, vault deposits and withdrawals, and liquidations each try one first, and anyone can ask for one.
An entry band. Opening or adding to a position needs the mark within 2% of the pool’s 5 minutes average.
A size limit. Open interest is capped at a share of what it costs to move the pool’s price 2%, set by the tier. The cap follows the pool: liquidity pulled out lowers it within about 30 minutes.
Old prices. If no update is accepted for 10 minutes, the market turns close-only. Closes still go through, but pay no profit until the price is fresh again. After 60 minutes, liquidations pause too.
Trading
Fills. Every fill is at the worse of two prices for you: the mark and the 5 minutes average. A buy fills at the higher one and a sell at the lower. You set a limit, and a fill worse than it fails with nothing changed. The smallest position is 10 USDG.
Fees. Every open and close pays a trading fee of 0.06% of the size traded, at the fill price. 50% goes to the vault, 20% to insurance, 20% to the protocol treasury and 10% to the market’s creator. Once insurance holds 5% of the open interest, its share goes to the vault.
Skew fee. The skew is the gap between long and short size. A trade that widens it pays a skew fee as well; one that narrows it pays none. The fee grows as the skew nears its cap, up to a top rate set by the tier, and all of it goes to the vault.
Caps. The skew cap is a share of the vault’s capital, set by the tier. No trade may widen the skew past it, or push either side or the skew past the open-interest cap.
Funding. The crowded side pays funding every second. The thin side receives it at the same rate per token, and the vault keeps the rest. The rate grows with the skew, up to an hourly maximum set by the tier when the skew reaches its cap. It settles whenever your position is touched, so no keeper is needed.
Leverage. The thin side, or anyone in an empty book, can use the tier’s full leverage. On the crowded side, the most leverage steps down in a straight line as the skew grows, to 1x when the skew reaches its cap. This applies when you open or add, and to how much margin you can withdraw.
Who can trade. A market’s creator and its liquidity providers can never trade in it. Closing and reducing stay open at all times, even outside the entry band and during a wind-down. A reduce must leave at least 10 USDG; below that, close in full.
Liquidations
Your equity is your margin plus your profit or loss at the mark. The maintenance margin is a share of your position’s value at the mark, set by the tier. When your equity falls below it, anyone can liquidate your position.
Partial first. A liquidation cuts the position back until what is left holds the liquidation target, set by the tier. It closes in full only when a cut cannot get there, or would leave less than 10 USDG. The cut fills at your own close price.
The fee. It costs 1% of the closed size at the mark, from your margin. Half goes to whoever liquidates, up to 100 USDG, and the rest to insurance.
Underwater accounts. If no margin is left to pay the fee, insurance pays the liquidator instead: the fee that was due, at most 5 USDG, when insurance holds that much.
Liquidations use the mark, never a single fill, and they pause when the price is 60 minutes old.
Where losses go
A losing trade pays the vault from the trader’s margin. A loss bigger than the margin leaves bad debt, which falls in this order:
- The trader’s margin, down to zero. Margin never goes below zero.
- The market’s insurance, which pays the vault what the trader could not.
- The creator’s stake. It covers liquidity’s share before liquidity bears any of it.
- Vault liquidity, once the stake is gone.
- A haircut on winners. Profits are paid from the stake, then liquidity, then insurance. If traders are owed more than those three hold, each profit is paid in proportion: that capital divided by what traders are owed. The market shows this ratio at all times.
Vaults
Each market’s vault is the other side of every trade. It holds the creator’s stake and liquidity from anyone who adds it. It earns fees, funding and traders’ losses, shared between stake and liquidity by size, and it pays traders’ profits, stake first.
Shares. Adding USDG gives you shares, which cannot be transferred. The first deposit gets one share per USDG; later ones get shares at the vault’s value. A deposit counts traders’ open profits and losses, and a withdrawal counts only their profits. Deposits need a live price. A trader with margin or a position in a market cannot add liquidity to it.
Cooldown and window. To withdraw, request it first. After 24 hours you have 48 hours to take it. After that the request expires and you make a new one.
Free capital. A withdrawal pays at most what the vault holds beyond what the current skew needs. If it pays only part, the rest of your request stays open in the same window.
Write-off. If liquidity falls to zero while shares remain, those shares are worth nothing. The next deposit writes them off: they then read as zero, any request for them is dropped, and that deposit gets one share per USDG.
The creator’s stake is withdrawn the same way, with a request, the cooldown and the window, but only while the market has no open interest.
Launching a market
- Register the pool. Anyone can, once per pool. It must be a pool from Uniswap’s official v3 factory on Robinhood Chain, with USDG on one side, a token of at most 18 decimals on the other, and a tick spacing of at least 10. You can also pay for the pool to keep more price history.
- The watch period. The factory watches the pool from registration for the tier’s pool age. A pool does not record when it was created, so the watch starts at registration.
- The depth rule. The pool must answer for a 30 minutes average, and moving its price 2%, up or down, whichever is cheaper, must cost at least the tier’s minimum. Depth is time-weighted over both the last 30 minutes and the whole watch, taking the lower, so liquidity added just before launch barely counts.
- The stake. In the same transaction you stake at least the tier’s minimum in USDG and become the creator. The market starts with its pool pinned and an open-interest cap set from the pool’s depth.
Each pool has one market. It can be replaced only once it is inactive: its stake below the tier’s minimum and no open interest. New positions need the stake at or above that minimum. The creator earns 10% of trading fees.
The two tiers
Every market uses one of two preset tiers. Guarded suits younger, shallower pools. Standard needs an older, deeper pool and allows more. The numbers below are read from the market factory’s tierParams on Robinhood Chain.
Reading the tiers from the market factory…
Wind-down
A market’s creator can start a wind-down. It cannot be undone. From then on the market is close-only: no new positions, no adding to positions and no new liquidity. Closing, reducing, withdrawals and liquidations carry on as before.
From 7 days after the start, anyone can call closeExpired for any account that still has a position. It closes the position as its holder’s own close would, at any fill, with no trading or skew fee. The caller is paid nothing.
The market’s own page on Markets and its vault page count down to that moment, then offer to close what is left.
Networks and contracts
Each network runs its own copy of the contracts, with its own markets, margin token and accounts. Nothing moves between networks. These are the addresses this site uses, from each network’s deployments file. Every market and its price adapter are deployed by the market factory, which lists them all. The margin token is the one the market factory names.
| Chain ID | 4663 |
|---|---|
| RPC | https://rpc.mainnet.chain.robinhood.com |
| Gas token | ETH |
| Margin token | Reading it from the market factory… |
| Explorer | robinhoodchain.blockscout.com |
| Market factory: registers pools and launches every market | 0x1a8149d35BffF444563951364D1DF6BE738BB1F0 (opens the Robinhood Chain explorer) |
| Market deployer: deploys markets for the factory only | 0x306B000AF51AbF3F229b9669C9B691340b63ef2A (opens the Robinhood Chain explorer) |
| Uniswap v3 factory: only its pools can have a market | 0x1f7d7550B1b028f7571E69A784071F0205FD2EfA (opens the Robinhood Chain explorer) |
| Chain ID | 99901 |
|---|---|
| RPC | https://rpc.elysium.kinetiq.xyz |
| Gas token | HYPE |
| Margin token | Reading it from the market factory… |
| Explorer | elysium.kinetiq.xyz/explorer |
| Market factory: registers pools and launches every market | 0x16FC5043D8f76D561ff221398f94639a7df81Fbf (opens the Elysium explorer) |
| Market deployer: deploys markets for the factory only | 0x5E9aEf138E6b94502550458Dc3522C23e0cA862F (opens the Elysium explorer) |
| Uniswap v3 factory: only its pools can have a market | 0x1707327F626496A7b5b3872e7E4d2879Df7d7a9f (opens the Elysium explorer) |
Risks
Smart contract bugs. The contracts may contain bugs. A bug could lose some or all of the USDG held in a market.
Losing all your margin. Leveraged trading can lose all the margin you deposit, and quickly. Leverage multiplies losses, and a liquidation fee comes out of the same margin. A trader cannot lose more than the margin held in that market: what a loss leaves unpaid becomes bad debt for insurance and the vault. Liquidity providers and creators can lose all they put in, and winners can be paid only part of their profit under a haircut.
Thin pools. A market is only as sound as its pool. A thin pool can be pushed. The averages, the step cap and the open-interest cap make that costly, not impossible. The mark trails the pool on purpose, so after a sharp move it can sit well away from the live price. If updates stop, the market turns close-only and closes pay no profit.