Frax API
Frax integration.
Frax is a decentralised finance protocol that originated as the first fractional-algorithmic stablecoin. The protocol has evolved into a comprehensive DeFi ecosystem encompassing stablecoins (frxUSD), liquid staking derivatives (frxETH/sfrxETH), lending markets (Fraxlend), an automated market maker (Fraxswap), and its own Layer 2 chain (Fraxtal).
Fraxlend is the lending component of Frax Finance, providing isolated lending pairs where lenders deposit assets
and earn interest from borrowers. Each Fraxlend pair is an ERC-4626 compatible vault. Every pair exposes its own
timelock-controlled share of interest revenue as feeToProtocolRate. The integration reads this value on-chain
at the requested block because the fee varies between pairs. Fraxlend internalises the fee by minting shares to
the protocol, diluting lenders when interest accrues.
Frax also operates sFRAX and sfrxUSD stablecoin staking vaults. These products distribute protocol yield through
an increasing share redemption value, have no time lock and do not charge explicit vault-level management,
performance, deposit or withdrawal fees. Because Fraxlend and staking have different economics, the integration
uses separate FraxlendPairVault and
FraxStakingVault readers while reporting both as Frax.
Fraxlend candidates are discoverable from the deployer’s LogDeploy event and the standard Deposit event
emitted when a new pair is seeded. Runtime classification uses the pair’s immutable DEPLOYER_ADDRESS()
accessor as a single contract probe and checks its result against the event-derived Frax deployers. The reviewed
staking deployments use address-based routing because their linear-reward implementation is not unique to Frax.
Links
Frax lending and staking vault support. |
|
Frax vault deployment constants and product metadata. |