PoolLogic

Logic implementation for pool

Functions:

Events:

Function initialize(address _factory, bool _privatePool, string _fundName, string _fundSymbol)

Initialize the pool

Parameters:

  • _factory: address of the factory

  • _privatePool: true if the pool is private, false otherwise

  • _fundName: name of the fund

  • _fundSymbol: symbol of the fund

Function setPoolPrivate(bool _privatePool)

Set the pool privacy

Parameters:

  • _privatePool: true if the pool is private, false otherwise

Function deposit(address _asset, uint256 _amount) → uint256 liquidityMinted

Deposit funds into the pool

Parameters:

  • _asset: Address of the token

  • _amount: Amount of tokens to deposit

Return Values:

  • liquidityMinted Amount of liquidity minted

Function withdraw(uint256 _fundTokenAmount)

Withdraw assets based on the fund token amount

Parameters:

  • _fundTokenAmount: the fund token amount

Function execTransaction(address to, bytes data) → bool success

Function to let pool talk to other protocol

Parameters:

  • to: The destination address for pool to talk to

  • data: The data that going to send in the transaction

Return Values:

  • success A boolean for success or fail transaction

Function getFundSummary() → string, uint256, uint256, address, string, uint256, bool, uint256, uint256

Get fund summary of the pool

Return Values:

  • Name of the pool

  • Total supply of the pool

  • Total fund value of the pool

  • Address of the pool manager

  • Name of the pool manager

  • Time of the pool creation

  • True if the pool is private, false otherwise

  • Numberator of the manager fee

  • Denominator of the manager fee

Function tokenPrice() → uint256 price

Get price of the asset

Parameters:

  • price: A price of the asset

Function availableManagerFee() → uint256 fee

Get available manager fee of the pool

Return Values:

  • fee available manager fee of the pool

Function mintManagerFee()

Mint the manager fee of the pool

Function getExitCooldown() → uint256 exitCooldown

Get exit cooldown of the pool

Return Values:

  • exitCooldown The exit cooldown of the pool

Function getExitRemainingCooldown(address sender) → uint256 remaining

Get exit remaining time of the pool

Return Values:

  • remaining The remaining exit time of the pool

Function setPoolManagerLogic(address _poolManagerLogic) → bool

Set address for pool manager logic

Function managerName() → string _managerName

Get name of the manager

Return Values:

  • _managerName The name of the manager

Function isMemberAllowed(address member) → bool

Return true if member is allowed, false otherwise

Function executeOperation(address[] assets, uint256[] amounts, uint256[] premiums, address originator, bytes params) → bool success

execute function of aave flash loan

Parameters:

  • assets: the loaned assets

  • amounts: the loaned amounts per each asset

  • premiums: the additional owed amount per each asset

  • originator: the origin caller address of the flash loan

  • params: Variadic packed params to pass to the receiver as extra information

Last updated