Open
How to open a margin trade.
marginTrade
marginTrade opens a leveraged position on the Sovryn Protocol. It can be used to open a new position or modify an existing one.
Arguments
loanId
bytes32
The ID of the loan, 0 for a new loan.
leverageAmount
uint256
The multiple of exposure: 2x ... 5x. The leverage with 18 decimals.
loanTokenSent
uint256
The number of loan tokens provided by the user.
collateralTokenSent
uint256
The amount of collateral tokens provided by the user.
collateralTokenAddress
address
The token address of collateral.
trader
address
The account that performs this trade.
minEntryPrice
uint256
Value of loan token in collateral.
loanDataBytes
bytes
Additional loan data (not in use for token swaps). *
Returns
New principal and new collateral added to the position
Last updated