BasisOS
  • INTRODUCTION
    • What is BasisOS
    • Key Concepts in Basis Trading
    • Vision and Value Proposition
  • Basis Vaults
    • Architecture Overview
    • Components and Interactions
    • Managed Approach
    • Execution Flow
  • BASISOS AGENT
    • Overview
    • Core Components
    • System Design and Interactions
    • Agentic Roadmap
      • Stage 0: Assistant
      • Stage 1: Maintainer
      • Stage 2: Curator
      • Stage 3: Sovereign
  • TOKENOMICS
    • Token Distribution
    • Liquidity Mining
      • Distribution Mechanics
      • Rewards Schedule
    • Mindshare Mining
      • Distribution Mechanics
      • Rewards Schedule
  • CORE PROTOCOL
    • LogarithmVault
    • BasisStrategy
    • SpotManager
    • OffchainPositionManager
    • GmxV2PositionManager
    • LogarithmOracle
      • Oracle Provider
    • Contract Addresses
  • RISK MANAGEMENT
    • Funding Risk
    • Liquidity Risk
    • Risk Framework
      • Margin Treasury
      • Maximum Leverage
      • Asset Clustering
      • Strategy Capacity
    • Backtests
Powered by GitBook
On this page
  1. Basis Vaults

Components and Interactions

PreviousArchitecture OverviewNextManaged Approach

Last updated 3 months ago

1. LogarithmVault

Purpose: The LogarithmVault serves as the user interface for depositing and withdrawing funds. It also approves the BasisStrategy to use its funds, allowing it to execute trades. LogarithmVault tracks individual user balances and overall vault balance.

Core Functions:

  • deposit/mint: Accepts user funds, adding them to the pool available for the basis strategy.

  • requestWithdraw/requestRedeem: Allows users to withdraw their funds, including any accrued gains.

  • isClaimable/claim: Allows users to claim assets from the executed withdraw requests.

Details:

2. BasisStrategy

Purpose: The BasisStrategy contract manages the basis trading logic by utilizing SpotManager for spot trades and HedgeManager for perpetual trades. It maintains a market-neutral position by holding opposite positions in spot and perpetual markets, generating funding payment revenue.

Core Functions:

  • utilize: Uses SpotManager to buy assets in the spot market and HedgeManager to place short positions in the perpetual market, thereby hedging the spot exposure.

  • deutilize: Reallocates spot and perpetual holdings based on funding rates, user withdrawals, and market volatility.

  • pendingUtilizations: Helps operators determine the parameters of calling utilize/deutilize functions by returning the maximum amounts.

  • checkUpkeep/performUpkeep: Allows keepers to safe the perpetual position’s leverage, claim funding payments, and rehedge the spot.

Details:

3. SpotManager

Purpose: SpotManager is responsible for executing trades in the spot market, such as Uniswap, to gain exposure to the underlying asset.

Core Functions:

  • buy: Executes buy orders for specific assets in the spot market.

  • sell: Executes sell orders to reduce spot exposure or free up liquidity.

Details:

4. HedgeManager

Purpose: The HedgeManager adjusts the perpetual hedge, selling short to offset spot exposure. It interacts with perpetual protocols (e.g., GMX) and manages funding payments to generate revenue.

Core Functions:

  • adjustPosition: Places short orders in the perpetual market to hedge the spot position. Closes or adjusts short positions in response to changing conditions or withdrawal demands. Modifies the short position size based on market prices and funding rate trends.

  • keep: Collects funding payments and distributes them back to the collateral of the perpetual position.

Implementations:

Different protocol-specific managers have been implemented to operate across different perpetual protocols.

  • GmxV2PositionManager: HedgeManager specific for GMX protocol.

  • OffChainPositionManager: HedgeManager specific for off-chain perpetual protocols including HyperLiquid.

Details:

LogarithmVault
BasisStrategy
SpotManager
GmxV2PositionManager
OffChainPositionManager