API related docs

FundV2

Holds a portfolio of tokens and allows a fund manager to trade and rebalance tokens

Rebalance

function Rebalance(address[] _toAddr, uint256[] _targets) external

Rebalance the Portfolio Vault and redistribute the funds new tokens and weights

Parameters

NameTypeDescription

_toAddr

address[]

Token Addresses

_targets

uint256[]

Target Weights for tokens

Rebalance

function Rebalance(address[] _toAddr, uint256[] _targets, uint32 _slippage) public

Rebalance the Portfolio Vault and redistribute the funds new tokens and weights

Parameters

NameTypeDescription

_toAddr

address[]

Token Addresses

_targets

uint256[]

Target Weights for tokens

_slippage

uint32

DEX slippage for swaps

deposit

function deposit(uint256 amount) external returns (uint256)

Buy fund shares by depositing baseToken

Swaps will be done before shares are created

Parameters

NameTypeDescription

amount

uint256

Amount of baseToken to deposit

Return Values

NameTypeDescription

shares

uint256

Amount of shares received

deposit

function deposit(uint256 amount, uint32 _slippage) public returns (uint256)

Buy fund shares by depositing baseToken

Swaps will be done before shares are created

Parameters

NameTypeDescription

amount

uint256

Amount of baseToken to deposit

_slippage

uint32

DEX slippage for swaps

Return Values

NameTypeDescription

shares

uint256

Amount of shares received

withdraw

function withdraw(uint256 amount) external returns (uint256)

Exchange Portfolio vault shares for baseToken

Performance fee will be charged if a profit is made, if no deposit the entire withdraw amount will be treated as profit

Parameters

NameTypeDescription

amount

uint256

Amount of shares to withdraw

Return Values

NameTypeDescription

tokenAmt

uint256

Amount of baseToken received

withdraw

function withdraw(uint256 amount, uint32 _slippage) public returns (uint256)

Exchange Portfolio vault shares for baseToken

Performance fee will be charged if a profit is made, if no deposit the entire withdraw amount will be treated as profit

Parameters

NameTypeDescription

amount

uint256

Amount of shares to withdraw

_slippage

uint32

DEX slippage for swaps

Return Values

NameTypeDescription

tokenAmt

uint256

Amount of baseToken received

FundV2Factory

Deploys New Portfolio Fund Contracts

createFundPrivate

function createFundPrivate(string name, string symbol, address[] _toAddresses, uint256[] _targetWeight) external

Deploys a new ERC20 Private Portfolio Fund

Parameters

NameTypeDescription

name

string

Name of the Portfolio Fund

symbol

string

Symbol of the Portfolio Fund token

_toAddresses

address[]

Initial allocation token addresses

_targetWeight

uint256[]

Initial allocation target weights

massProcessPlatformFee

function massProcessPlatformFee() external

Process platform fee on all funds

processPlatformFee

function processPlatformFee(address _fundAddr) external

Process platform fee on input fund address

Parameters

NameTypeDescription

_fundAddr

address

Address of fund to collect fee

processManagerFee

function processManagerFee(address _fundAddr) external

Process manager fee on input fund address

Parameters

NameTypeDescription

_fundAddr

address

Address of fund to collect fee

massProcessManagerFee

function massProcessManagerFee() external

Process manager fee on all funds

getLatestFundID

function getLatestFundID() public view returns (uint256)

Gets the ID of the lastest fund created

getFundfromIndex

function getFundfromIndex(uint256 _index) public view returns (address)

Get Portfolio Fund address from fund ID

Parameters

NameTypeDescription

_index

uint256

id of the fund

Return Values

NameTypeDescription

address

address

Address of input fund ID

Last updated