Spot Hedge Maker

Liquidity provision is whitelisted until initial beta testing has completed

Overview

Spot hedge maker model is based on Hot Tub, vaults developed by Perpetual Protocol during 2022-2023. Spot hedge maker vaults are divided into Base (asset token, e.g. ETH, BTC) and Quote (settlement token, e.g. USDT) vaults.

The basic concept is that all taker trades made via this vault on the perpetual futures DEX are automatically hedged using tokens purchased on spot markets. So if a trader on Perp v3 opens a 1 ETH long, thus creating a 1 ETH short for the maker, the vault will automatically buy 1 ETH on spot markets to hedge the maker's position. The futures trade and the spot hedge occur atomically.

Requests to fill an order (fillOrder()) should be made via the Order Gateway.

SpotHedgeBaseMaker

Each vault accepts liquidity deposits in one base asset (e.g. ETH, BTC), so each market has a distinct vault.

Taker opens short

Base vault sells an equal amount of base asset to hedge the maker's long.

Taker opens long

Base vault buys an equal amount of base asset to hedge the maker's long.

Utilization Ratio

utilRatio = 1 - (assetBalance / assetLiability)

/// @notice Example
///         LP deposits 1 ETH, and taker opens a 1 ETH short
deposit 1 ETH → 
    assetLiability += 1 ETH
    assetBalance += 1 ETH
fillOrder(1 ETH short) → 
swap(1 ETH) →
     assetBalance -= 1 ETH
utilRatio = 1 - (0 ETH / 1 ETH) = 1

Maker shares

Liquidity providers receive shares (similar to LP tokens) representing their stake in the liquidity pool. Shares must be redeemed to withdraw funds from the vault.

totalAsset = assetBalance + accountValueAsAsset

/// @notice `totalShare` is updated on deposit and withdrawal
/// @notice Deposit
totalShare <- totalShare * (1 + deltaAsset / totalAsset)
deltaAsset > 0
assetBalance <- assetBalance + deltaAsset
assetLiability <- assetLiability + deltaAsset

/// @notice Withdraw
deltaAsset = totalAsset * deltaShare / totalShare
deltaShare < 0
deltaAsset < 0
assetBalance <- assetBalance + deltaAsset
totalShare <- totalShare + deltaShare
/// @notice `assetLiability` is updated in a similar way openNotional is updated when reducing position on the Exchange
assetLiability <- assetLiability * (1 - deltaShare / totalShare)
/// @dev Withdraw will revert if
abs(deltaAsset) > assetBalance
vaultMarginRatio < minMarginRatio // after withdrawal

SpotHedgeQuoteMaker

Quote maker vaults are not currently available and will launch at a future date.

Quote vaults work the same way as base vaults, but in reverse. Each vault accepts liquidity deposits in one quote asset (e.g. USDT), so each market has a distinct vault.

Circuit Breaker

Maker will stop filling orders if risk thresholds are reached. When called, fillOrderCallBack() will check minMarginRatio to ensure it is above the set threshold.

For details, see Circuit Breaker.

fillOrderCallBack()

In many instances, a maker must withdraw funds from the vault to execute a spot trade. This is managed using the fillOrderCallBack() function and is currently executable by whitelisted users only.

Last updated