// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.13; import "@equilibria/root/number/types/PackedUFixed18.sol"; import "./Position.sol"; /// @dev PackedPosition type struct PackedPosition { /// @dev Quantity of the maker position PackedUFixed18 maker; /// @dev Quantity of the taker position PackedUFixed18 taker; } using PackedPositionLib for PackedPosition global; /** * @title PackedPositionLib * @dev A packed version of the Position which takes up a single storage slot using `PackedFixed18` values. * @notice Library for the packed Position type. */ library PackedPositionLib { /** * @notice Creates an position from a packed position * @param self packed position * @return New position */ function unpack(PackedPosition memory self) internal pure returns (Position memory) { return Position({maker: self.maker.unpack(), taker: self.taker.unpack()}); } }