MCDEX
Search…
Removing Margin
This guide shows how to remove margin from position by using the ILiquidityPoolFull interface.

Withdraw

Function

function withdraw(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 withdraw. The amount always use decimals 18.

Example

1
ILiquidityPoolFull liquidityPool = ILiquidityPoolFull(liquidityPoolAddress)
2
liquidityPool.withdraw(index, address(this), withdrawAmount)
Copied!

Sample Code

Github
Last modified 14d ago