← 3Commas

3Commas · DeCommas

Delta-neutral perpetuals vault

Client: DeCommas and 3Commas

A market-neutral yield vault on Optimism — a spot long hedged 1:1 by a short perpetual, earning the funding rate. Deposit USDC, hold an LP token, withdraw USDC.

Stack & integrations

  • Solidity ^0.8
  • Optimism
  • Perpetual Protocol v2
  • Uniswap v3
  • ERC-1967 / UUPS proxy
  • OpenZeppelin Upgradeable

Context

3Commas — a crypto trading-tools company — launched DeCommas, a decentralized toolset for on-chain traders. This is one of its strategy vaults: a delta-neutral (market-neutral) yield vault on Optimism. A user deposits USDC and receives an LP token; the vault earns the perpetual funding rate while holding almost no directional price exposure.

What it does — the product

Earning funding-rate yield by hand means running a spot position on one venue, an opposite perp on another, and constantly rebalancing as prices move. The vault holds both legs at equal size: a spot long (the wrapped asset, bought on Uniswap v3) and a short perpetual (Perpetual Protocol v2). Price moves cancel between the two, so the portfolio value barely changes with the market — what it keeps is the funding rate, plus a USDC buffer for liquidity.

Delta-neutral position: 45% spot long + 45% short perp offset each other (net delta ≈ 0), 10% USDC reserve; the position earns the funding rate
The two legs offset — net delta ≈ 0, income = the perp funding rate

Architecture

A single UUPS-upgradeable vault contract (behind an ERC1967 proxy) composes two external protocols and mints an LP token. Users deposit and withdraw; an off-chain trigger server opens, closes, and rebalances the two legs; the owner controls upgrades and configuration.

Component map: user deposits/withdraws USDC to the vault; trigger server manages positions; vault runs a spot leg on Uniswap v3 and a short leg on Perpetual Protocol v2, mints an LP token, and holds a USDC reserve
Blue = operator/control · green = value (USDC / spot)

Money flow — deposit

A deposit is priced against the vault’s current net asset value, so later depositors don’t dilute earlier ones. The USDC lands in the reserve and is only put to work when the operator next opens or rebalances the position.

Deposit flow: user deposits USDC, the vault prices shares against current NAV, mints the LP token, and holds the USDC in reserve until deployed
Deposit — priced off NAV, minted as LP, held until deployed

Money flow — rebalance (operator)

To open the hedge, the operator posts USDC collateral and opens a short on Perpetual Protocol, then buys the exactly matching amount of spot on Uniswap — so the two legs are the same size and net out. Rebalancing keeps them matched as prices drift; a full close unwinds everything back to USDC.

Rebalance flow: trigger server tells the vault to open the hedge; the vault posts collateral and opens a short perp, then buys the matching spot on Uniswap, leaving a balanced delta-neutral position
Open the hedge — short perp + matching spot long = balanced

Money flow — withdraw

A redemption is valued from current NAV. If the USDC buffer covers it, the user is paid straight away; otherwise the vault unwinds part of both legs (sell spot, close perp, pull collateral) to raise the cash, then pays out and burns the shares.

Withdrawal flow: user redeems LP shares; the vault pays from the USDC buffer if it covers, otherwise unwinds part of both legs to raise USDC, then pays out
Withdraw — pay from the buffer, or unwind part of both legs

On-chain deployment

Verified on Optimism as an ERC1967 proxy pointing at the DeltaNeutralPerp implementation (UUPS-upgradeable):

My contribution

Delivered the delta-neutral vault strategy on Optimism (ERC1967 proxy + UUPS implementation): the deposit / withdraw flow with LP-share accounting priced off live NAV, the market-neutral position management (a spot long on Uniswap v3 hedged 1:1 by a short on Perpetual Protocol v2), the funding-rate and TWAP valuation, and the operator (trigger-server) control surface for opening, rebalancing, and closing the position.

Media

DeCommas — “New Meta: Automating Basis Trading” ↗