A small walkthrough on futures logic:
A position consists of (size, leverage, margin). A margin is essentially the collateralisation for a futures position. In a simple example, you can think of opening a MakerDAO Vault as a position with 1x leverage and a margin equal to min-c-ratio * dai_generated. The dai_generated would represent the size of your position, and the 150% * eth_price * locked_amount is your min initial margin.
The leverage is used to determine your position size. So I could open a 1x ETH LONG position on MakerDAO as we described before, and liquidation risk would essentially follow linearly wiht price movement. If I doubled my leverage, it would mean that I am 2x as exposed to the price movements.
When implementing futures contracts, the leverage can change but the margin remains constant. So for example, trader A has a position of 10 ETH and 1x leverage, and trader B has a position of 10 ETH and 5x leverage. Using the dYdX ETH perpetuals contracts as an example, the initial mar