Perennial is a powerful DeFi primitive built from first-principles to scale to the needs of traders, liquidity providers, and developers. This update introduces on the next major iteration of Perennial with intent support.
Scope
On what chains are the smart contracts going to be deployed?
Currently deployed to Arbitrum. Other EVM L2s are eligible but only Optimism Chains and Arbitrum are currently supported for gas pricing
If you are integrating tokens, are you allowing only whitelisted tokens to work with the codebase or any complying with the standard? Are they assumed to have certain properties, e.g. be non-reentrant? Are there any types of weird tokens you want to integrate?
DSU and USDC (native USDC on L2s)
The new Emptyset reserve strategies can interact with Aave aTokens and Compound v3 cTokens
Are there any limitations on values set by admins (or other roles) in the codebase, including restrictions on array lengths?
The Protocol parameter identifies some maximum/minimum values that are able to be set for market parameters. Refer to ProtocolParameter.sol
and where those fields are used in MarketParameter.sol
and RiskParameter.sol
The OracleParameter.sol
determines the limits of the KeeperOracleParameter.sol
Are there any limitations on values set by admins (or other roles) in protocols you integrate with, including restrictions on array lengths?
No
For permissioned functions, please list all checks and requirements that will be made before calling the function.
For most permissioned functions there is a modifier which checks if the calling address is a specific address set in state. For example, onlyOwner
requires the caller to be the owner()
of the contract
Is the codebase expected to comply with any EIPs? Can there be/are there any deviations from the specification?
No
Are there any off-chain mechanisms or off-chain procedures for the protocol (keeper bots, arbitrage bots, etc.)?
Yes - there are keepers for oracle updates + settlements, liquidations, and order types. There is also a new Intent system which matches taker orders with corresponding netting orders from Market Makers, along with intents for Collateral Accounts and Trigger Orders
Are there any hardcoded values that you intend to change before (some) deployments?
Yes - will update the parameters that are set for the various GasOracles based on the cost to do certain actions on the respective chains. We will also update certain keeper bonuses. There are also values in the various __Parameter.sol
structs that may be modified before deployment
If the codebase is to be deployed on an L2, what should be the behavior of the protocol in case of sequencer issues (if applicable)? Should Sherlock assume that the Sequencer won't misbehave, including going offline?
Sequencer downtime should be essentially handled as if the market is closed (no new position changes can be posted to the market). If there are other adverse effects of sequencer downtime we would like to know about them.
Should potential issues, like broken assumptions about function behavior, be reported if they could pose risks in future integrations, even if they might not be an issue in the context of the scope? If yes, can you elaborate on properties/invariants that should hold?
Yes - function behavior is defined in the natspec comments and if they pose integration risk we would like to be aware of that.
Please discuss any design choices you made.
Nothing stands out - Perennial is a complex codebase so we encourage auditors to thoroughly read documentation and comments, as well as ask us any questions about design decisions that they might have.
Please list any known issues and explicitly state the acceptable risks for each known issue.
Coordinators are given broad control over the parameters of the markets they coordinate. The protocol parameter is designed to prevent situations where parameters are set to malicious steal funds. If the coordinator can operate within the bounds of reasonable protocol parameters to negatively affect markets we would like to know about it
Oracle providers (Pyth, Chainlink, etc) are expected to provide and verify prices correctly. If they provide incorrect prices that are still verified on-chain, we have no ability to correct for this
There is no cure period for positions after sequencer downtime
We will report issues where the core protocol functionality is inaccessible for at least 7 days. Would you like to override this value?
We'd like to know of any issues which leave the functionality inaccessible for at least 24 hours
Please provide links to previous audits (if any).
Please list any relevant protocol resources.
V2.3 Intents Doc: https://docs.google.com/document/d/12nCBzhwYRCwAvNESxV0HHYVTFsS2-yNu5BsD9BRjI9M
V2 Docs: https://docs.perennial.finance (note: this is not updated for v2.3)
V2 Mechanism 1-pager: https://docs.google.com/document/d/1f-V_byFYkJdJAHMXxN2NiiDqysYhoqKzZXteee8BuIQ
Additional audit information.
The base of this audit should be this commit: https://github.com/equilibria-xyz/perennial-v2/commit/f61cbe10830da3ef6c636c22d517bf4bd075991b
This update enables Intents in the Perennial system - this allows for orders to be matched by an off-chain system and submitted on-chain by the market maker for the intent. This results in numerous signature based messages which are verified on-chain by the intent system. We have also moved some the existing extensions to the signature based system, such as trigger orders
Coming from update #2, we opted to fully remove "no-op" settles which allow for settlement without any changes to the account. We have also made settlement and liquidation fees gas-aware
Here's the doc about migration from 2.2 to 2.3 and issues that come from migration explained in this doc and have H/M impact, will be considered valid https://github.com/equilibria-xyz/perennial-v2/blob/edcf4d1a8ddd01f979118d2a9e7bfab3fd6f6c75/runbooks/MIGRATION_v2.3.md
Total Rewards
Contest Pool
Lead Senior Watson
Judging Pool
Lead Judge
54,500 USDC
32,000 USDC
2,700 USDC
3,300 USDC
Status
Scope
Start Time
End Time
Judging Rules