Skip to content

FluidLiquidityConfigHandler ​

Git Source

Inherits:Constants, Error, Events, Structs

Sets limits on Liquidity for a protocol based on TVL checkpoints.

Functions ​

validAddress ​

Validates that an address is not the zero address

solidity
modifier validAddress(address value_);

onlyRebalancer ​

Validates that an address is a rebalancer (taken from reserve contract)

solidity
modifier onlyRebalancer();

constructor ​

solidity
constructor(
    IFluidReserveContract reserveContract_,
    IFluidLiquidity liquidity_,
    address protocol_,
    address withdrawToken_,
    address borrowToken_,
    LimitCheckPoints memory withdrawCheckPoints_,
    LimitCheckPoints memory borrowCheckPoints_
) validAddress(address(reserveContract_)) validAddress(address(liquidity_)) validAddress(protocol_);

getProtocolSupplyData ​

returns PROTOCOL total supply at Liquidity

solidity
function getProtocolSupplyData()
    public
    view
    returns (uint256 supply_, uint256 oldExpandPercent_, uint256 userSupplyData_);

getProtocolBorrowData ​

returns PROTOCOL total borrow at Liquidity

solidity
function getProtocolBorrowData()
    public
    view
    returns (uint256 borrow_, uint256 oldExpandPercent_, uint256 userBorrowData_);

rebalance ​

Rebalances the configs for PROTOCOL at Fluid Liquidity based on protocol total supply & total borrow. Emits LogUpdateWithdrawLimitExpansion or LogUpdateBorrowLimitExpansion if any update is executed. Reverts if no update is needed. Can only be called by an authorized rebalancer.

solidity
function rebalance() external onlyRebalancer;

_updateWithdrawLimits ​

| | INTERNALS | |__________________________________

solidity
function _updateWithdrawLimits() internal returns (bool updated_);

_updateBorrowLimits ​

solidity
function _updateBorrowLimits() internal returns (bool updated_);

_validateLimitCheckPoints ​

solidity
function _validateLimitCheckPoints(LimitCheckPoints memory checkPoints_) internal pure;