Prime liquidity provider

PrimeLiquidityProvider

PrimeLiquidityProvider is used to fund Prime

Solidity API

DEFAULT_MAX_DISTRIBUTION_SPEED

The default max token distribution speed

uint256 DEFAULT_MAX_DISTRIBUTION_SPEED

prime

Address of the Prime contract

address prime

tokenDistributionSpeeds

The rate at which token is distributed (per block)

mapping(address => uint256) tokenDistributionSpeeds

maxTokenDistributionSpeeds

The max token distribution speed for token

mapping(address => uint256) maxTokenDistributionSpeeds

lastAccruedBlock

The rate at which token is distributed to the Prime contract

mapping(address => uint256) lastAccruedBlock

tokenAmountAccrued

The token accrued but not yet transferred to prime contract

mapping(address => uint256) tokenAmountAccrued

initialize

PrimeLiquidityProvider initializer

function initialize(address accessControlManager_, address[] tokens_, uint256[] distributionSpeeds_, uint256[] maxDistributionSpeeds_, uint256 loopsLimit_) external

Parameters

❌ Errors

  • Throw InvalidArguments on different length of tokens and speeds array


initializeTokens

Initialize the distribution of the token

function initializeTokens(address[] tokens_) external

Parameters

⛔️ Access Requirements

  • Only Governance


pauseFundsTransfer

Pause fund transfer of tokens to Prime contract

function pauseFundsTransfer() external

⛔️ Access Requirements

  • Controlled by ACM


resumeFundsTransfer

Resume fund transfer of tokens to Prime contract

function resumeFundsTransfer() external

⛔️ Access Requirements

  • Controlled by ACM


setTokensDistributionSpeed

Set distribution speed (amount of token distribute per block)

function setTokensDistributionSpeed(address[] tokens_, uint256[] distributionSpeeds_) external

Parameters

⛔️ Access Requirements

  • Controlled by ACM

❌ Errors

  • Throw InvalidArguments on different length of tokens and speeds array


setMaxTokensDistributionSpeed

Set max distribution speed for token (amount of maximum token distribute per block)

function setMaxTokensDistributionSpeed(address[] tokens_, uint256[] maxDistributionSpeeds_) external

Parameters

⛔️ Access Requirements

  • Controlled by ACM

❌ Errors

  • Throw InvalidArguments on different length of tokens and speeds array


setPrimeToken

Set the prime token contract address

function setPrimeToken(address prime_) external

Parameters

📅 Events

  • Emits PrimeTokenUpdated event

⛔️ Access Requirements

  • Only owner


setMaxLoopsLimit

Set the limit for the loops can iterate to avoid the DOS

function setMaxLoopsLimit(uint256 loopsLimit) external

Parameters

📅 Events

  • Emits MaxLoopsLimitUpdated event on success

⛔️ Access Requirements

  • Controlled by ACM


releaseFunds

Claim all the token accrued till last block

function releaseFunds(address token_) external

Parameters

📅 Events

  • Emits TokenTransferredToPrime event

❌ Errors

  • Throw InvalidArguments on Zero address(token)

  • Throw FundsTransferIsPaused is paused

  • Throw InvalidCaller if the sender is not the Prime contract


sweepToken

A public function to sweep accidental ERC-20 transfers to this contract. Tokens are sent to user

function sweepToken(contract IERC20Upgradeable token_, address to_, uint256 amount_) external

Parameters

📅 Events

  • Emits SweepToken event

⛔️ Access Requirements

  • Only Governance

❌ Errors

  • Throw InsufficientBalance if amount_ is greater than the available balance of the token in the contract


getEffectiveDistributionSpeed

Get rewards per block for token

function getEffectiveDistributionSpeed(address token_) external view returns (uint256)

Parameters

Return Values


accrueTokens

Accrue token by updating the distribution state

function accrueTokens(address token_) public

Parameters

📅 Events

  • Emits TokensAccrued event


getBlockNumber

Get the latest block number

function getBlockNumber() public view virtual returns (uint256)

Return Values


Last updated