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

ILiquidityPoolFull liquidityPool = ILiquidityPoolFull(liquidityPoolAddress)
liquidityPool.deposit(index, address(this), depositAmount)

Sample Code

Github
Copy link
On this page
Deposit
Function
Example
Sample Code