Function: update(address address, UFixed6 UFixed6, UFixed6 UFixed6, UFixed6 UFixed6, Fixed6 Fixed6, bool bool)
Updates the maker, long, and short positions as well as the collateral account and protected status of an account. If the positions are altered, it creates an order with the change in position. If the collateral is nonzero, it transfers the specified amount of the underlying token.
Inputs
account
Control: Arbitrary.
Constraints: Must be the sender unless account is protected for liquidation, sender is an operator of the account as recorded by the MarketFactory, or sender is repaying collateral shortfall for another account without modifying its position.
Impact: The account that is updated.
newMaker
Control: Arbitrary.
Constraints: New position does not fail invariants.
Impact: New maker position.
newLong
Control: Arbitrary.
Constraints: New position does not fail invariants.
Impact: New long position.
newShort
Control: Arbitrary.
Constraints: New position does not fail invariants.
Impact: New short position.
collateral
Control: Arbitrary.
Constraints: New position does not fail invariants.
Impact: Change in collateral. If nonzero, it causes underlying tokens to be pushed or pulled to the sender.
protect
Control: Arbitrary.
Constraints: New position does not fail invariants. Specifically,
protect
may only be set if the current position is zero, the collateral is insufficient, and the added collateral meets the liquidation fee.Impact: Account is protected until next tick.