The Lux perpetual futures protocol enables leveraged trading of any oracle-priced asset without expiry dates. Traders open long or short positions with up to 50x leverage, collateralized by USDC. A funding rate mechanism keeps the perpetual price aligned with the oracle spot price. Liquidity is provided by a shared vault (the LPX pool) that acts as counterparty to all trades.
Position {
owner address
market bytes32 // e.g., keccak256("LUX/USD")
isLong bool
size uint256 // position size in USD
collateral uint256 // USDC collateral
entryPrice uint256 // oracle price at open
entryFunding int256 // cumulative funding at open
}
Leverage = size / collateral. Maximum 50x.
The LPX vault provides liquidity for all markets:
Funding rate aligns perp price with oracle price:
fundingRate = (perpPrice - oraclePrice) / oraclePrice * fundingFactor
fundingFactor = 0.01 (1% per 8h at full divergence)Funding is accrued continuously and settled on position modification.
Positions are liquidated when margin ratio falls below maintenance margin:
marginRatio = (collateral + unrealizedPnL - pendingFunding) / size
maintenanceMargin = 0.5% (50x) to 1% (25x), scaled by leverage
Liquidators receive a 0.5% keeper fee. Remaining collateral (if any) returns to the trader.
Markets are added by governance. Each market specifies:
1. Oracle dependency: all PnL calculations use K-chain oracle prices (LP-038). Oracle manipulation directly impacts positions.
2. Vault risk: in extreme one-directional markets, the LPX vault can lose capital. Maximum open interest limits bound this risk.
3. Cascading liquidations: rapid price moves can trigger liquidation cascades. A liquidation buffer (auto-deleverage) reduces systemic risk.
github.com/luxfi/standard/contracts/perps/ |LPXVault.sol |Copyright (C) 2024-2026, Lux Partners Limited. All rights reserved.
Licensed under the MIT License.