MCDEX
Search…
Adding Margin
This guide shows how to add margin into position by using the ILiquidityPoolFull interface.

Deposit

Function

function deposit(uint256 perpetualIndex, address trader, int256 amount)
parameters
type
description
perpetualIndex
uint256
index of perpetual in the liquidity pool
trader
address
address of trader
amount
int256
amount of collateral to deposit. The amount always use decimals 18.

Example

1
ILiquidityPoolFull liquidityPool = ILiquidityPoolFull(liquidityPoolAddress)
2
liquidityPool.deposit(index, address(this), depositAmount)
Copied!

Sample Code

Github
Last modified 14d ago