Build and trade with Tracerβs Perpetual Swaps and gain leveraged exposure to any market in the world.
Platform: Code4rena
Start Date: 24/06/2021
End Date: 30/06/2021
Period: 7 days
Status: Completed
Reporters: ninek, moneylegobatman
Pot Size: $80,000 USDC
Participants: 12
Reporters: ninek, moneylegobatman
Judge: cemozer
Id: 16
League: ETH
Auditor per page
This repo will be made public before the start of the contest. (C4 delete this line when made public)
Insurance.sol
TracerPerpetualSwaps.sol
LibMath.sol
, LibInsurance.sol
, LibBalances.sol
InsurancePoolToken.sol
Liquidation.sol
Pricing.sol
, TracerPerpetualSwaps.sol
, Insurance.sol
, GasOracle.sol
LibMath.sol
, LibLiquidation.sol
, LibBalances.sol
, LibPerpetuals.sol
Pricing.sol
TracerPerpetualSwaps.sol
, Insurance.sol
, Oracle.sol
LibMath.sol
, LibPrices.sol
TracerPerpetualsFactory.sol
PerpsDeployerV1.sol
(not in scope), LiquidationDeployerV1.sol
(not in scope), PricingDeployerV1.sol
(not in scope), InsuranceDeployerV1.sol
(not in scope)TracerPerpetualSwaps.sol
Pricing.sol
, Insurance.sol
, Liquidation.sol
, GasOracle.sol
LibMath.sol
, LibPrices.sol
, LibBalances.sol
, LibPerpetuals.sol
, LibSafetyWithdraw.sol
Trader.sol
TracerPerpetualSwaps.sol
LibBalances.sol
, LibPerpetuals.sol
ChainlinkOracleAdapter.sol
IChainlinkOracle.sol
(out of scope)LibMath.sol
GasOracle.sol
IChainlinkOracle.sol
(out of scope)LibMath.sol
LibBalances
LibInsurance
LibLiquidation
LibMaths.sol
LibPerpetuals.sol
LibPrices.sol
SafetyWithdraw.sol
While there is no novel maths present, an understanding of the Tracer perpetual swaps maths and mechanisms will be helpful. You can learn more from our perpetual swaps whitepaper.
All tokens used within the Tracer perpetual swaps system are assumed to conform to the ERC20 standard.
Our security assumptions for the Tracer perpetual swaps contracts are that each market is manipulatable by the owner / deployer of the market, but there should be no cross market manipulation or exploits of any kind. There is no oracle or token whitelisting to ensure that anyone can deploy any market that they want, without restrictions of the protocol getting in their way. This comes with the tradeoff that the deployer of a market can deploy using an oracle they control, and manipulate the price to have the market behave in any way they wish.
We have however provided adapters for Chainlink oracles, and will have DAO deployed markets (owned and managed by the Tracer DAO) that will use both reliable Chainlink oracles and safe underlying ERC20s.
As such, exploits that are executable by the owner of a market (such as changing the oracle at any point in time, using an ERC20 with a dangerous implementation of transfer
, etc) are out of scope for this audit.