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

ILiquidityPoolFull liquidityPool = ILiquidityPoolFull(liquidityPoolAddress)
liquidityPool.withdraw(index, address(this), withdrawAmount)

Sample Code

Github
Last modified 10mo ago
Copy link
On this page
Withdraw
Function
Example
Sample Code