Skip to content

FluidVaultT1Admin ​

Git Source

Inherits:Variables, Events, Error

Fluid Vault protocol Admin Module contract. Implements admin related methods to set configs such as liquidation params, rates oracle address etc. Methods are limited to be called via delegateCall only. Vault CoreModule ("VaultT1" contract) is expected to call the methods implemented here after checking the msg.sender is authorized. All methods update the exchange prices in storage before changing configs.

State Variables ​

X8 ​

solidity
uint256 private constant X8 = 0xff;

X10 ​

solidity
uint256 private constant X10 = 0x3ff;

X16 ​

solidity
uint256 private constant X16 = 0xffff;

X19 ​

solidity
uint256 private constant X19 = 0x7ffff;

X24 ​

solidity
uint256 private constant X24 = 0xffffff;

X64 ​

solidity
uint256 internal constant X64 = 0xffffffffffffffff;

X96 ​

solidity
uint256 private constant X96 = 0xffffffffffffffffffffffff;

NATIVE_TOKEN ​

solidity
address private constant NATIVE_TOKEN = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;

addressThis ​

solidity
address private immutable addressThis;

Functions ​

constructor ​

solidity
constructor();

_verifyCaller ​

solidity
modifier _verifyCaller();

_updateExchangePrice ​

updates exchange price on storage, called on all admin methods in combination with _verifyCaller modifier so only called by authorized delegatecall

solidity
modifier _updateExchangePrice();

_checkLiquidationMaxLimitAndPenalty ​

solidity
function _checkLiquidationMaxLimitAndPenalty(uint256 liquidationMaxLimit_, uint256 liquidationPenalty_) private pure;

updateSupplyRateMagnifier ​

updates the supply rate magnifier to supplyRateMagnifier_. Input in 1e2 (1% = 100, 100% = 10_000).

solidity
function updateSupplyRateMagnifier(uint256 supplyRateMagnifier_) public _updateExchangePrice _verifyCaller;

updateBorrowRateMagnifier ​

updates the borrow rate magnifier to borrowRateMagnifier_. Input in 1e2 (1% = 100, 100% = 10_000).

solidity
function updateBorrowRateMagnifier(uint256 borrowRateMagnifier_) public _updateExchangePrice _verifyCaller;

updateCollateralFactor ​

updates the collateral factor to collateralFactor_. Input in 1e2 (1% = 100, 100% = 10_000).

solidity
function updateCollateralFactor(uint256 collateralFactor_) public _updateExchangePrice _verifyCaller;

updateLiquidationThreshold ​

updates the liquidation threshold to liquidationThreshold_. Input in 1e2 (1% = 100, 100% = 10_000).

solidity
function updateLiquidationThreshold(uint256 liquidationThreshold_) public _updateExchangePrice _verifyCaller;

updateLiquidationMaxLimit ​

updates the liquidation max limit to liquidationMaxLimit_. Input in 1e2 (1% = 100, 100% = 10_000).

solidity
function updateLiquidationMaxLimit(uint256 liquidationMaxLimit_) public _updateExchangePrice _verifyCaller;

updateWithdrawGap ​

updates the withdrawal gap to withdrawGap_. Input in 1e2 (1% = 100, 100% = 10_000).

solidity
function updateWithdrawGap(uint256 withdrawGap_) public _updateExchangePrice _verifyCaller;

updateLiquidationPenalty ​

updates the liquidation penalty to liquidationPenalty_. Input in 1e2 (1% = 100, 100% = 10_000).

solidity
function updateLiquidationPenalty(uint256 liquidationPenalty_) public _updateExchangePrice _verifyCaller;

updateBorrowFee ​

updates the borrow fee to borrowFee_. Input in 1e2 (1% = 100, 100% = 10_000).

solidity
function updateBorrowFee(uint256 borrowFee_) public _updateExchangePrice _verifyCaller;

updateCoreSettings ​

updates the all Vault core settings according to input params. All input values are expected in 1e2 (1% = 100, 100% = 10_000).

solidity
function updateCoreSettings(
    uint256 supplyRateMagnifier_,
    uint256 borrowRateMagnifier_,
    uint256 collateralFactor_,
    uint256 liquidationThreshold_,
    uint256 liquidationMaxLimit_,
    uint256 withdrawGap_,
    uint256 liquidationPenalty_,
    uint256 borrowFee_
) public _updateExchangePrice _verifyCaller;

updateOracle ​

updates the Vault oracle to newOracle_. Must implement the FluidOracle interface.

solidity
function updateOracle(address newOracle_) public _updateExchangePrice _verifyCaller;

updateRebalancer ​

updates the allowed rebalancer to newRebalancer_.

solidity
function updateRebalancer(address newRebalancer_) public _updateExchangePrice _verifyCaller;

rescueFunds ​

sends any potentially stuck funds to Liquidity contract.

this contract never holds any funds as all operations send / receive funds from user <-> Liquidity.

solidity
function rescueFunds(address token_) external _verifyCaller;

absorbDustDebt ​

absorbs accumulated dust debt

in decades if a lot of positions are 100% liquidated (aka absorbed) then dust debt can mount up which is basically sort of an extra revenue for the protocol.

solidity
function absorbDustDebt(uint256[] memory nftIds_) public _verifyCaller;