← Protocols
Deri Protocol
01Description

Decentralised derivatives protocol offering perpetual futures, everlasting options, power perpetuals, and gamma swaps under one liquidity pool. Deri V4 splits state across an i-Chain (interaction layer on Arbitrum / BNB Chain / zkSync / zkEVM) and a d-Chain (Arbitrum Orbit L3) for cross-chain risk netting.

02Best for
  • 01perpetual futures on long-tail assets
  • 02everlasting (perpetual) options without expiry
  • 03power perpetuals (ETH^2 / ETH^0.5)
  • 04gamma swaps for vol exposure
  • 05BNB Chain + Arbitrum derivatives UIs
03Install
  • pnpm add viem ethers
  • forge install deri-protocol/deriprotocol-v3
04Environment variables
VariableScopeDescription
NEXT_PUBLIC_DERI_RPC_URLClientRPC for the i-Chain you target (Arbitrum One, BNB Chain, zkSync Era, or Polygon zkEVM).
DERI_POOL_ADDRESSClientAddress of the v4 `Pool` (i-Chain implementation) for the asset universe you trade — different per chain.
DERI_API_URLClientOff-chain price/oracle helper API (`https://api.deri.io`) used to fetch signed mark prices and funding curves.
05Prompt snippet
Use viem against the Deri V4 `Pool` on your chosen i-Chain. Deposit margin with `Pool.addMargin(symbolId, amount)` (USDC base) and open a position via `Pool.trade(symbolId, tradeVolume, priceLimit, signedPriceData)` where `signedPriceData` is fetched from `https://api.deri.io/v4/price/{symbol}`. Symbols look like `BTCUSD-PERP`, `ETHUSD-EVERLASTING-CALL-3000`, `ETHUSD-POWER-2`, or `ETHUSD-GAMMA`. Close a leg with the opposite trade. Read margin and PnL via `Pool.getMarginInfo(account)`. Funding is paid continuously per block and accrues into your margin balance — there is no expiry on options or power perpetuals, but margin maintenance is enforced by `Pool.liquidate(account)` keepers.
06Gotchas
  • Everlasting options are priced via a continuously paid funding rate that approximates the option's theta — high-IV regimes spike funding sharply, and a long position can bleed faster than a traditional dated option even though it never expires.
  • Power perpetuals (ETH^2 etc.) accrue funding to keep the mark close to spot^k; in trending markets longs/shorts pay each other large funding flows that make naive backtests dramatically wrong.
  • V4 i-Chain / d-Chain split: trades happen on i-Chain but cross-pool risk is netted on the d-Chain Arbitrum Orbit L3; deposit-confirm latency can be tens of seconds. UIs must poll `Pool.getTraderState()` for confirmed margin, not trust the local pending tx.
  • Mark prices come from an off-chain signer pushing oracle data on each trade — if the API is down, `trade()` reverts with `INVALID_PRICE_SIGNATURE`. Always have a fallback path or graceful UI failure.
  • BNB Chain liquidity historically dominates ETH-pair trading; thin Arbitrum books mean the same symbol can have very different funding on each i-Chain. Aggregate carefully if you compose across deployments.
  • DERI token has its own staking/`veDERI` flow on a separate contract from the v4 Pool — do NOT confuse staking rewards with trader margin.
07Alternatives