Vault

The Perp v3 vault is a collection of contracts responsible for holding and managing all user collateral (maker, taker).

Vault

Deposit and withdraw.

/// @notice `amountXCD` uses collateral token decimals (6 decimals for USDT)
function deposit(
    address trader, 
    uint256 amountXCD
)

function withdraw(
    uint256 amountXCD
)

Add / remove margin. Get marketId from Metadata.

/// @inheritdoc IVault
/// @notice `amountXCD` uses collateral token decimals (6 decimals for USDT)
function transferFundToMargin(
    uint256 marketId, 
    uint256 amountXCD
)

function transferMarginToFund(
    uint256 marketId, 
    uint256 amountXCD
)

Read PnL, margin and other account data. Get marketId from Metadata.

IMarginProfile

Last updated

Was this helpful?