SpotManager

Inherits: Initializable, OwnableUpgradeable, ISpotManager

Author: Logarithm Labs

SpotManager is a dedicated smart contract that manages spot positions for a trading strategy, enabling it to buy or sell assets on a decentralized exchange (DEX) or other spot market. This manager operates in tandem with a basis strategy, allowing it to adjust the spot position dynamically based on the strategy’s target exposure. The primary objective is to provide liquidity for the basis trade, maintaining optimal spot exposure relative to the short hedge position.

SpotManager is an upgradeable smart contract, deployed through the beacon proxy pattern.

State Variables

SpotManagerStorageLocation

bytes32 private constant SpotManagerStorageLocation = 0x95ef178669169c185a874b31b21c7794e00401fe355c9bd013bddba6545f1000;

Functions

_getSpotManagerStorage

function _getSpotManagerStorage() private pure returns (SpotManagerStorage storage $);

authCaller

Authorizes a caller if it is the specified account.

modifier authCaller(address authorized);

initialize

function initialize(address _owner, address _strategy, address[] calldata _assetToProductSwapPath)
    external
    initializer;

_setManualSwapPath

buy

Buys product in the spot market.

Parameters

Name
Type
Description

amount

uint256

The asset amount to be swapped to product.

swapType

SwapType

The swap type.

swapData

bytes

The data used in swapping if necessary.

sell

Sells product in the spot market.

Parameters

Name
Type
Description

amount

uint256

The product amount to be swapped to asset.

swapType

SwapType

The swap type.

swapData

bytes

The data used in swapping if necessary.

exposure

The spot exposure that is needed to be hedged by the perpetual positions.

uniswapV3SwapCallback

_verifyCallback

strategy

The strategy address.

asset

The asset address.

product

The product address.

Events

SpotBuy

Emitted when product is bought in spot markets.

SpotSell

Emitted when product is sold in spot markets.

Structs

SpotManagerStorage

Last updated