primitivefinance / portfolio

Portfolio is an automated market making protocol for implementing custom strategies at the lowest cost possible.

Home Page:https://www.primitive.xyz/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fix: positions are non-fungible because of JIT parameter

Alexangelj opened this issue · comments

Description

Proxy smart contracts cannot be used to manage positions because of a DOS vector enabled by the JIT parameter being set to > 0. If set greater to zero and a proxy contract manages positions on behalf of the users, only a single address (the proxy) will own the position, and thus be unable to deallocate liquidity if there is an allocate call in the same block.

The jit parameter should either be removed or defaulted to zero to avoid this issue. Additionally, the positions themselves are now non-fungible because they have a unique timestamp associated with them. Fungibility is one of the design goals we have with portoflio, so it makes a stronger case for removing the jit parameter entirely.

Made a new branch in case we decide to remove the JIT (https://github.com/primitivefinance/portfolio/tree/feat/no-jit).

Closing this since the PR was merged.