Connect to Web" to connect to your Metamask wallet.
Writebutton and confirm the transaction in Metamask.
Write Contractbutton and then click
Connectto connect with your Metamask wallet.
Read Contracttab, and then input your wallet address, productId(refer to the Open a Position section) and direction in to the
Write Contracttab, and make sure your wallet is connected. Then input the productId, margin and the direction of the position you want to close into the function
closePosition. The example below shows closing a ETHUSD long position with 100 USDC margin.
Read Contracttab and enter your wallet address, the productId and the position direction into the
getPositionIdfunction. After clicking the
querybutton, your positionId will show up.
Write Contracttab and input your positionId and the margin amount to add, before clicking
Writebutton and confirm the transaction via Metamask. Below is an example of adding 100(10000000000/1e8) USDC margin to a position.