Difference between revisions of "Frax Finance (FRAX)"

From CryptoWiki

Line 13: Line 13:
*Frax [https://docs.frax.finance/smart-contracts/miscellaneous#frax-bug-bounty offers] up to $10m with a static [[bug bounty]] program (28-2-2022).  
*Frax [https://docs.frax.finance/smart-contracts/miscellaneous#frax-bug-bounty offers] up to $10m with a static [[bug bounty]] program (28-2-2022).  
*Seems like their other 2 audits of 2021 were not easy to find by DeFi Safety at the time. As of 2-2023 there have been [https://docs.frax.finance/other/audits 7 audits].  
*Seems like their other 2 audits of 2021 were not easy to find by DeFi Safety at the time. As of 2-2023 there have been [https://docs.frax.finance/other/audits 7 audits].  
*Scored [https://www.defisafety.com/pqrs/353 81%] on [[DeFi Safety]] (28-2-2022):
*
*Scored [https://t.me/c/1453353094/15850 73%] on [[DeFi Safety]] (24-1-2024):  ''"Frax Finance impresses with easily accessible smart contract addresses, a public software repository, and a non-anonymous team. The protocol shows evidence of testing its deployed code, but there's limited coverage and lack of detailed test results reporting. rax Finance stands out with thorough audits and a substantial bug bounty program. The protocol is particularly strong in documenting admin controls, providing clear explanations of code upgradeability, admin roles, and transaction signing policies. They excel in Oracle documentation, ensuring clarity on how these crucial components are integrated and safeguarded against risks like flashloan attacks."''
*Previously scored [https://www.defisafety.com/pqrs/353 81%] on (28-2-2022):
[[Contract]] FRAX is [https://etherscan.io/address/0x853d955aCEf822Db058eb8505911ED77F175b99e#analytics extremely active]. There is full coverage of deployed [[contracts]] in their software function [https://docs.frax.finance/smart-contracts/oracle#chainlink documentation]. With a Test to Code ratio of 719%, this protocol has clearly undergone an astonishing amount of testing. In all my time writing reviews, no other protocol has seen so much testing. There are no scripts provided for protocol testing. No report was found. This protocol has not undergone formal verification. Frax has been audited once [by [[Certik]]], [https://www.certik.com/projects/fraxfinance before launch]. 3 major findings were not corrected.
[[Contract]] FRAX is [https://etherscan.io/address/0x853d955aCEf822Db058eb8505911ED77F175b99e#analytics extremely active]. There is full coverage of deployed [[contracts]] in their software function [https://docs.frax.finance/smart-contracts/oracle#chainlink documentation]. With a Test to Code ratio of 719%, this protocol has clearly undergone an astonishing amount of testing. In all my time writing reviews, no other protocol has seen so much testing. There are no scripts provided for protocol testing. No report was found. This protocol has not undergone formal verification. Frax has been audited once [by [[Certik]]], [https://www.certik.com/projects/fraxfinance before launch]. 3 major findings were not corrected.



Revision as of 01:03, 19 March 2024

(De)central Bank, a multi product DAO.

Basics

History

Audits & Exploits

  • Frax offers up to $10m with a static bug bounty program (28-2-2022).
  • Seems like their other 2 audits of 2021 were not easy to find by DeFi Safety at the time. As of 2-2023 there have been 7 audits.
  • Scored 73% on DeFi Safety (24-1-2024): "Frax Finance impresses with easily accessible smart contract addresses, a public software repository, and a non-anonymous team. The protocol shows evidence of testing its deployed code, but there's limited coverage and lack of detailed test results reporting. rax Finance stands out with thorough audits and a substantial bug bounty program. The protocol is particularly strong in documenting admin controls, providing clear explanations of code upgradeability, admin roles, and transaction signing policies. They excel in Oracle documentation, ensuring clarity on how these crucial components are integrated and safeguarded against risks like flashloan attacks."
  • Previously scored 81% on (28-2-2022):

Contract FRAX is extremely active. There is full coverage of deployed contracts in their software function documentation. With a Test to Code ratio of 719%, this protocol has clearly undergone an astonishing amount of testing. In all my time writing reviews, no other protocol has seen so much testing. There are no scripts provided for protocol testing. No report was found. This protocol has not undergone formal verification. Frax has been audited once [by Certik], before launch. 3 major findings were not corrected.

With the comment :

"Frax Finance has been developed with good security in mind, and this protocol's massive $10M bug bounty ensures that every inch of this protocol is measured for cracks - this is the largest amount offered by a protocol we have reviewed. Frax combines this with great oracle documentation, earning them a place among the best. To improve, this protocol might consider elaborating when documenting its testing methodologies. This protocol's architecture is certainly complicated, so users should feel reassured that Frax takes care to ensure there are no clear lines of fracture."

Bugs/Exploits

  • Lost and regained its website domain around early November 2023.
  • From Blockthreat (13-4-2022):

"Frax patched a vulnerability that could allow massive slippages after it was responsibly disclosed by Daniel Von Fange."

Governance

Admin Keys

  • FRAX v3 smart contracts will entirely operate onchain using the frxGov module (6-10-2023).
  • When looking into the audits, multiple centralized aspects are raised by Trail of Bits, but not clarified.

From Trail of Bits (10-1-2022):

"Contract owners have near complete control over the system. While the concept of governance exists, its role is unclear."

From Trail of Bits (2023):

"fraxferry is a centralized bridge in bridge in which users have to trust the Frax Finance team to actually relay the transactions to the target chain."

another one regarding frxETH (2023)

"There are numerous methods that the admin could apply to rug pull the protocol and take all user funds."

Answer:

“We are well aware of the permission structure. The owner will most likely be a large multisig.”

"Admin control information was clearly documented at this location. The relevant contracts are not identified. Ownership is clearly indicated in this location. Smart contract change capabilities are not identified. This protocol dose not have a pause control, and this is identified. This protocol's timelock documentation can be found at this location. The timelock is 48 hours."

DAO

  • FRAX v3 smart contracts will entirely operate onchain using the frxGov module (6-10-2023).
  • From their docs (6-2022):

"The Frax Share token (FXS) is the non-stable, utility token in the protocol. It is meant to be volatile and hold rights to governance and all utility of the system. Parameters that are up for governance through FXS include adding/adjusting collateral pools, adjusting various fees (like minting or redeeming), and refreshing the rate of the collateral ratio. No other actions such as active management of collateral or addition of human-modifiable parameters are possible other than a hardfork that would require voluntarily moving to a new implementation entirely."

Treasury

Token

Launch

Token Distribution

  • From their docs (6-2022):

"FXS supply is initially set to 100 million tokens at genesis, but the amount in circulation will likely be deflationary as FRAX is minted at higher algorithmic ratios. The design of the protocol is such that FXS would be largely deflationary in supply as long as FRAX demand grows."

Utility

Other Details

  • Leverages a two-token model to create an algorithmic, partially-collateralized stablecoin.

Stablecoin

  • Has the FRAX stablecoin.

Frax Finance Technology

"At 479 commits, it's clear Frax's development history is as moving as it is inspirational."

Implementations

How it works

"Whenever FRAX trades above $1 the protocol’s collateralization ratio is lowered and its algorithmic mechanics become more pronounced, while this collateralization ratio is increased whenever FRAX trades below $1."

"FRAX maintains its price stability by offloading its volatility to FXS, which is the governance token that also partially collateralizes the system. As long as there is a buyer on the open market for FXS, FRAX should be able to maintain its peg."

"The FRAX model claims to be under-collateralised but rather a more accurate description is that it’s algorithmically collateralised through a two token system. Here’s how it works:

  1. The system starts off being 100% collateral based, which means that in order to mint FRAX you need 1 USDC per FRAX. However, if this is anything below 100% then an equivalent amount of FXS (Frax Shares) need to be deposited. Think of it that rather than depositing 1 USDC you would deposit 0.9 USDC and $0.10 worth of FXS. It’s not really under-collateralized since you still need to deposit at least $1 of value, however it isn’t over-collateralized.
  1. Now, as time goes on, if the price of FRAX is above $1, then the collateral ratio reduces by 0.25% each hour. If the price of FRAX is below $1 then the collateral ratio increases by 0.25% each hour.
  2. The net result is that the system can become something like 90% collateralized meaning only 90% of USDC needs to be deposited and 10% of FXS per FRAX minted.

However, this isn’t what helps FRAX maintain its peg. The crucial part here is that anyone who buys and holds FRAX can redeem it for $1 worth of USDC and/or FXS. This means that the peg can be a lot stronger since arbitragers can buy cheap FRAX if it goes below $1 and redeem it for $1 of real collateral. Similarly if the price of FRAX goes above $1 then arbs can come in and mint 1 FRAX for $1 and then sell it for $1.10 (or whatever the above-peg price is)."

"FRAX is unique; it is the most central bank-like of algorithmic stablecoins I have seen. If you take a real central bank, most of their assets are other sovereign currencies. Similarly, the assets on FRAX’s balance sheet are other stablecoins. In crypto, this might seem like a strange design choice. But also like a true central bank, FRAX is able to adjust its collateralization level according to the demand for its own currency. When there is more demand for FRAX, the system can run looser, and when demand wanes, it can tighten. Like with Seigniorage Shares, the money supply of Frax is elastic. When demand for the FRAX stablecoin increases, the system can expand the money supply beyond the total collateral in the system. But unlike with Seigniorage Shares, FRAX can also tighten monetary policy when market conditions call for discipline.

But perhaps the most interesting element of Frax is its Algorithmic Market Operations (AMOs). Frax allows anyone to propose an AMO strategy via governance (a la Yearn), and if the strategy is good for the Frax ecosystem, it is free to be adopted.

One such AMO involves minting FRAX into a Curve pool to strengthen the peg. (This is essentially like the central bank minting unbacked currency to defend the peg in the market.) Another example might be minting FRAX to lend on Compound to improve its liquidity, and so on. If it is profitable, or accomplishes a socially useful goal, it can be minted just-in-time and funded via an AMO. But if that AMO overreaches and triggers a decrease in confidence in FRAX (as measured by FRAX going below the peg), the AMO can automatically pull back using the same predefined algorithm."

  • But they voted (23-2-2023) to make it 100% collateralised:

"The time has come for Frax to gradually remove the algorithmic backing of the protocol. The Frax protocol has grown and evolved dramatically since the protocol launched in December 2020. The original protocol included a variable collateral ratio which adjusted based on the market demand of FRAX, effectively letting the market dictate how much collateral was necessary for each FRAX to equal $1.00. This was a highly innovative, elegant approach that Frax pioneered but has now outgrown. The costs of being slightly undercollateralized now far outweigh the benefits – especially because it can undermine the perceived safety of FRAX. Gradually shifting the protocol to 100% CR is the best path forward for the long-term health and growth of the protocol.

This is a significant change to the protocol that over time effectively retires the algorithmic backing of Frax. It has become clear to many active in the community that this is the best path forward. The intention of this proposal is to coordinate the community on increasing the CR to 100% permanently. It is more focused on the destination (100% CR) than how we get there - there is no imminent need to increase the CR and there are many ways of reaching the target CR. Ideally growth, asset appreciation and protocol earnings will increase the CR to 100% over time. To be clear, this proposal does not rely on minting any FXS to achieve the 100% CR.

@dennett has made the point that FRAX can be fully collateralized by non-FXS assets and still be fractional reserve by deploying protocol owned liquidity via AMOs. Increasing protocol collateral also means that additional collateral can be deployed via AMOs to create liquidity and revenue for the protocol. The gentlest way to increase the CR is to retain protocol earnings as the protocol grows. As part of this proposal, FXS buybacks will be deferred until the CR reaches 100%. This is effectively an investment in the future of Frax that will increase protocol assets and remove the need for FXS emissions towards locked liquidity. There appears to be little impact from FXS buybacks lately and the impact is probably overestimated at this point."

Fees

Upgrades

  • From the docs on V3 (6-10-2023):
  1. Full exogenous collateralization of FRAX
  2. Sovereign USD peg
  3. IORB oracle
  4. Removal of multi-signature trust assumptions: FRAX v3 smart contracts entirely operate onchain using the frxGov module.

"Unveiled its V2 system, which involves underpinning the FRAX stablecoin with + zero-coupon bonds."

Staking

"veFXS is a vesting and yield system based off of Curve’s veCRV mechanism. Users may lock up their FXS for up to 4 years for four times the amount of veFXS (e.g. 100 FXS locked for 4 years returns 400 veFXS). veFXS is not a transferable token nor does it trade on liquid markets. It is more akin to an account based point system that signifies the vesting duration of the wallet's locked FXS tokens within the protocol. Each veFXS has 1 vote in governance proposals. Staking 1 FXS for the maximum time, 4 years, would generate 4 veFXS. This veFXS balance itself will slowly decay down to 1 veFXS after 4 years, at which time the user can redeem the veFXS back for FXS. In the meantime, the user can also increase their veFXS balance by locking up FXS, extending the lock end date, or both. Cash flow earned from AMOs, Fraxlend loans, and Fraxswap fees were typically used to buy back FXS from the market then distributed to veFXS stakers as yield."

Used to have buybacks and burns, but now (26-2-2023) goes towards getting full collateralization.

Liquidity Mining

  • From Yield Farmer (16-1-2021):

"Has launched a liquidity mining campaign centered around its FXS governance token."

Scaling

Interoperability

Other Details

Oracle Method

"The protocol's oracle source is documented at this location. The contracts dependent are identified. There is relevant software function documentation. This protocol documents front running mitigation techniques. This protocol documents flashloan countermeasures at this location."

Privacy Method

Compliance

Their Projects

Fraxchain

  • Frax Finance plans to rollout its own L2 blockchain named Fraxchain (16-6-2023):

"The network is expected be ready by the end of the year. Fraxchain’s governance will be led by the holders of Frax Shares (FXS) tokens. The network will employ the use of the Frax stablecoin and Frax Ether, Frax's liquid staking derivative, for transaction fees. Furthermore, fees generated by the roll-up network could be partly burned or redirected back to the Ethereum mainnet to be distributed among stakers of FXS governance token.

Fraxchain will incorporate decentralized sequencers. These sequencers are specialized nodes responsible for ordering transactions into batches in a rollup network. They will be operated by any entity chosen via a governance vote. “Fraxchain proposes a solution where sequencer roles can be auctioned off and rotated, creating a decentralized sequencer base. If a sequencer is forced to shut down, Fraxchain would allow the next elected sequencer to pick up from where the previous one left off,” Kazemian said."

Fraxlend

  • Frax Finance is launching Fraxlend, a permissionless lending market that allows anyone to lend or borrow assets with any token that is a part of a Chainlink data feed (6-9-2022):

"First, Fraxlend will enable the protocol to mint new FRAX through the borrowing and lending process. Fraxlend allows the Frax Finance protocol to directly lend FRAX and earn interest through existing money markets. Until now, the only way to do that was by taking out an over-collateralized loan on a lending platform such as Curve. With Fraxlend, the protocol can now do this whole process in-house, which generates an additional cash flow that can be used to “buy back and burn FXS.

The second new application Drake highlighted is the ability to create custom term sheets for protocol-to-protocol deals. Typically, these deals — such as when a DAO wants to send another DAO tokens  — are worked out via Telegram chats and finalized as OTC deals involving multi-sig wallets. Fraxlend lets DAOs set up the deal on chain, automating the process and making it more transparent."

Frax Price Index

  • Inflation-pegged stablecoin. From their docs (8-2022):

"The Frax Price Index (FPI) is the second stablecoin of the Frax Finance ecosystem. FPI is the first stablecoin pegged to a basket of real-world consumer items as defined by the US CPI-U average. The FPI stablecoin is intended to keep its price constant to the price of all items within the CPI basket and thus hold its purchasing power with on-chain stability mechanisms. Like the FRAX stablecoin, all FPI assets and market operations are on-chain and use AMO contracts. The Frax Price Index Share (FPIS) token is the governance token of the system, which is also entitled to seigniorage from the protocol. Excess yield will be directed from the treasury to FPIS holders, similar to the FXS structure. During times in which the FPI treasury does not create enough yield to maintain the increased backing per FPI due to inflation, new FPIS may be minted and sold to increase the treasury. Since the protocol is launched from within the Frax ecosystem, the FPIS token will also direct a variable part of its revenue to FXS holders.

A specialized Chainlink oracle commits this data on-chain immediately after it is publicly released. The oracle's reported inflation rate is then applied to the redemption price of FPI stablecoins in the system contract. This redemption price grows per second on-chain (or declines in rare cases of deflation). The peg calculation rate is updated once every 30 days when bls.gov releases their monthly CPI price data. Thus, the FPI peg tracks the above 12 month inflation rate and pegs to it at all times from the FPI redemption contract. Thus, when buying FPI stablecoins for another asset (such as ETH) the trader is taking the position that CPI purchasing power is growing faster over time than the sold ETH. If selling FPI for ETH, then the trader is taking the position that ETH growth is outpacing the CPI inflation rate of the US Dollar.

At first, the treasury will be comprised solely of $FRAX, but will expand to include other crypto-native assets such as bridged BTC, ETH, and non-crypto consumer goods and services. FPI uses the same type of AMOs as the FRAX stablecoin however it is modeled to keep a 100% collateral ratio (CR) at all times. This means that for the collateral ratio to stay at 100% the protocol balance sheet must be growing at least at the rate of CPI inflation. Thus, AMO strategy contracts must earn a yield proportional to CPI otherwise the CR will decrease to below 100%. During times that AMO yield is under the CPI rate, a TWAMM AMO will sell FPIS tokens for FRAX stablecoins to keep the CR at 100% at all times. The FPIS TWAMMs will be removed when the CR returns to 100%."

Fraxswap

  • From their docs (5-2022):

"Fraxswap is the first constant product automated market maker with an embedded time-weighted average market maker (TWAMM) for conducting large trades over long periods of time trustlessly. It is fully permissionless and the core AMM is based on Uniswap V2. This new AMM helps traders execute large orders efficiently and will be heavily used by the Frax Protocol to increase the stability of the pegs for the FRAX & FPI stablecoins as well as return protocol excess profits to FXS holders through TWAMM purchases. The motivation for building Fraxswap was to create a unique AMM with specialized features for algorithmic stablecoin monetary policy, forward guidance, and large sustained market orders to stabilize the price of one asset by contracting its supply or acquiring a specific collateral over a prolonged period. Specifically, Frax Protocol will use Fraxswap for: buying back and burning FXS with AMO profits, minting new FXS to buy back and burn FRAX stablecoins to stabilize the price peg, minting FRAX to purchase hard assets through seigniorage, and many more market operations in development."

sfrxETH

  • "Users should be aware that there is no mechanism built in to deal with slashing" as per code4reana audit (2023).
  • From Coingecko (20-1-2023):

"Staking ETH with Frax mints you frxETH which is a liquid token that represents 1:1 of staked ETH. However unlike Lido or Rocket Pool, frxETH is neither rebasing or value accruing. In order to earn yield with frxETH, you will need to stake the frxETH with Frax to receive sfrxETH, which grows in value about 6.63% a year, similar to wstETH, but higher than Lido at 5% and Rocket Pool at 4.4%.

The reason sfrxETH is higher than other ETH LSDs is because frxETH does not need to be staked in the validator nodes, and all the yield from all the frxETH that are not staked is given to sfrxETH. Thus the less frxETH is staked, the higher the APR for sfrxETH.

Additionally, in comparison to competing LSD platforms, FRAX benefits from large quantities of CRV/CVX held in the company's treasury, giving them higher bribing power to earn higher yield on Convex Finance by voting for more incentives to be directed to their frxETH LP tokens. Hence, Frax’s ETH LSD currently provide a larger staking income than competing products on the market while also strengthening the LSD liquidity on Curve.

To earn this higher APR, users will need to provide ETH and frxETH LP on Curve and stake it on Convex to earn the 10% APR yield. Because of this yield is high, there will be some users that will opt for this instead of staking their frxETH into sfrxETH, which results in higher APR for sfrxETH as explained previously. In addition, unlike Lido or Rocket Pool, Frax has their own lend product, which lets them keep the lending money generated by users borrowing against their sfrxETH collateral, growing the Frax treasury.

In terms of fees, Frax takes 10% of the staking rewards and splits it 80% to veFXS holders, and 20% to the insurance pool, with the remaining 90% to sfrxETH holders."

Roadmap

  • Can be found [Insert link here].

Usage

Projects that use or built on it

Competition

Pros and Cons

Pros

Cons

"While the FRAX model does move in the right direction, it still has a few major problems:

  1. Right now FRAX only supports USDC meaning it’s a wrapped for USDC in some ways. FRAX v2 attempts to add volatile currencies through the introduction of FRAX bonds.
  2. FRAX can’t be used effectively for leverage (like MakerDAO or ARCx) since depositors have no guarantee that they’ll receive their exact amount and type of collateral back. This may be okay assuming FRAX aims to be a primary MoE exchange coin. However, like others, the main beneficiaries of the FRAX stablecoin are the FXS holders who will have increasing power to mint FRAX with their FXS.

The last point around early holders is something I think that plagues all algorithmic stablecoins, and that’s the fact that they enrich early holders at the expense of later holders. Ultimately this will hinder their ability for real adoption since the late adopters will become the early adopter’s exit liquidity."

Team, Funding, Partners

Team

"Many team members are public and cross-reference their employment."

Funding

"Frax recently closed a strategic round, which was led by us at Dragonfly Capital, with participation from Electric Capital, Robot Ventures (Robert Leshner & Tarun Chitra), Balaji Srinivasan, and Stani Kulechov."

Partners

(:

Knowledge empowers us all and will help us get closer to the decentralised world we all want to live in!

Making these free wiki pages is fun but takes a lot of effort and time.

If you have enjoyed reading, tips are appreciated :) This will help us to keep expanding this archive of information.

ETH tip address: 0x83460bE5F218b1520B69D702cE60A1DE37dD8E31

Also check out my CoinTr.ee for more of my content.