The position object is the one that holds the information about a position and is crucial in managing reserved funds and profit/loss calculations.
Depending on the parameters of the order (leverage, expiration date) the appropriate futures contract hash is generated by the Finn Exchange Web Application and sent for matching to the Finn Exchange server.
The matching is performed as is usually done on an exchange, buy orders and sell orders are matched against one another and if the price condition matches, a new trade is created. The trade is then sent to the Smart Contract and a position is opened.
A position contains the following parameters:
Each position has its unique hash comprised from the user address, futures contract hash and side.
function generatePositionHash (address user, bytes32 futuresContractHash, bool side) public view returns (bytes32)
return keccak256(this, user, futuresContractHash, side);