Logic implementation for pool



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

Initialize the pool


  • _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


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

Function deposit(address _asset, uint256 _amount) β†’ uint256 liquidityMinted

Deposit funds into the pool


  • _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


  • _fundTokenAmount: the fund token amount

Function execTransaction(address to, bytes data) β†’ bool success

Function to let pool talk to other protocol


  • 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


  • 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


  • 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 modified 4mo ago