NFTXFeeDistributorV3

NFTXFeeDistributorV3.sol

Fee distributor contract for distributing vault fees.

Table of Contents

Constants
Variables
Events
Public Write Functions
Owner Write Functions

Constants

nftxVaultFactory

function nftxVaultFactory() external view returns (address)

Address of NFTX vault factory.

ammFactory

function ammFactory() external view returns (address)

Address of NFTX AMM pool factory.

inventoryStaking

function inventoryStaking() external view returns (address)

Address of NFTX inventory staking contract.

WETH

function WETH() external view returns (address)

Address of WETH contract.

POOL_DEFAULT_ALLOC

uint256 constant POOL_DEFAULT_ALLOC = 0.8 ether

Global liquidity provider vault fee percentage, set to 80%.

INVENTORY_DEFAULT_ALLOC

uint256 constant INVENTORY_DEFAULT_ALLOC = 0.2 ether

Global inventory staker vault fee percentage, set to 20%.

Variables

rewardFeeTier

function rewardFeeTier() external view returns (uint24)

AMM pool fee tier that receives vault fees for liquidity providers.

nftxRouter

function nftxRouter() external view returns (address)

Contract address of NFTX router.

treasury

function treasury() external view returns (address)

Treasury address.

allocTotal

function allocTotal() external view returns (uint256)

Total allocation across all feeReceivers.

feeReceivers

function feeReceivers(
    uint256
)
    external
    view
    returns (
        address receiver,
        uint256 allocPoint,
        ReceiverType receiverType
    )
    
enum ReceiverType {
    INVENTORY,
    POOL,
    ADDRESS
}

List of fee receivers.

distributionPaused

function distributionPaused() external view returns (bool)

Whether fee distribution has been paused.

Events

UpdateTreasuryAddress

event UpdateTreasuryAddress(address oldTreasury, address newTreasury)

Emitted by setTreasuryAddress().

PauseDistribution

event PauseDistribution(bool paused)

Emitted by pauseFeeDistribution().

NewRewardFeeTier

event NewRewardFeeTier(uint24 rewardFeeTier)

Emitted by changeRewardFeeTier().

NewNFTXRouter

event NewNFTXRouter(address nftxRouter)

Emitted by setNFTXRouter().

WethDistributedToInventory

event WethDistributedToInventory(uint256 vaultId, uint256 amount)

Emitted by distribute().

WethDistributedToPool

event WethDistributedToPool(uint256 vaultId, uint256 amount)

Emitted by distribute().

Write Functions

distribute

function distribute(uint256 vaultId) external

Distributes current WETH balance to feeReceivers for vaultId.

distributeVTokensToPool

function distributeVTokensToPool(
    address pool,
    address vToken,
    uint256 vTokenAmount
) external

Distributes vTokens to NFTX AMM pool. Can only be called by NFTXRouter when vTokens have been paid as part of an early withdrawal penalty.

Owner Functions

setReceivers

function setReceivers(
    FeeReceiver[] memory feeReceivers_
) external

struct FeeReceiver {
    address receiver;
    uint256 allocPoint;
    ReceiverType receiverType; // NOTE: receiver address is ignored for `POOL` type, as each vaultId has different pool address
}

enum ReceiverType {
    INVENTORY,
    POOL,
    ADDRESS
}

Sets fee receivers.

changeRewardFeeTier

function changeRewardFeeTier(uint24 rewardFeeTier_) external

Sets new reward fee tier (determining which AMM pool receives vault fees).

Updating the reward fee tier here won't change the cardinality of existing AMM pools already deployed with rewardFeeTier_. That has to be increased externally for each pool. If the new rewardFeeTier pool doesn't exist for a vToken, then the corresponding vault fees immediately become 0 until liquidity is provided in the new pool.

setTreasuryAddress

function setTreasuryAddress(address treasury_) external

Sets new treasury address.

setNFTXRouter

function setNFTXRouter(INFTXRouter nftxRouter_) external

Sets NFTXRouter address.

pauseFeeDistribution

function pauseFeeDistribution(bool pause) external

Pauses (or resumes) fee distribution.

rescueTokens

function rescueTokens(IERC20 token) external

Rescues ERC20 token.

Last updated