primitivefinance / portfolio

Portfolio is an automated market making protocol for implementing custom strategies at the lowest cost possible.
https://www.primitive.xyz/
GNU Affero General Public License v3.0
113 stars 8 forks source link

Audit/spearbit july #430

Closed Alexangelj closed 1 year ago

Alexangelj commented 1 year ago

I did make a major change to the poolId encoding - it now includes a leading 0x1 flag if the strategy is not default. It also brings the 0x01 controller flag to the front, so the first byte of the poolId leads with these flags packed into the single byte. This makes it easier to discern if a pool has a non-default strategy.

I also changed getInvariant -> getInvariantDown and added getInvariantUp for functions with respective rounding directions to make it more clear whats being used and where