-
Notifications
You must be signed in to change notification settings - Fork 34
Architecture
The CoinAlpha Fund Protocol utilizes a modular architecture to allow for upgradeability. Because funds issued may be long-term in nature, it is important that funds issued under the protocol have the ability to resolve any security vulnerabilities, upgrade components and fix bugs. In addition, calculations performed by funds rely heavily on market and exchange data supplied by off-chain data sources. Modules that encapsulate interactions with these data sources need to be upgradeable in order to account for future changes.
The Fund contract is the primary contract. It stores all investor and fund-related variables, emits events related to changes in these variables, provides a set of methods that enable investors to perform various actions, and provides the manager with methods to administer the fund. Generally however, complex logic associated with the investor and manager methods are delegated to other modules, so that these modules may be updated in the event a bug fix or security patch is necessary.
The NavCalculator contract is responsible for calculating the Net Asset Value Per Share (navPerShare
), the total value of the fund's assets denominated in US Dollars, less all accrued fees and expenses, divided by the total number of shares issued by the fund.
Since the Fund contract needs to process subscriptions and redemptions at an updated Net Asset Value per Share, the fund manager calls the calcNav()
function periodically. For funds like CoinAlpha's proprietary CoinAlpha Advisors, LLC fund that offer daily liquidity, the interval between periods is typically every business day.
When the manager calls the calcNav()
function on the Fund contract, it calls a corresponding calculate
function in NavCalculator. The calculate
function interfaces the the DataFeed module to retrieve the gross asset value of the fund portfolio and performs a set of calculations to derive the navPerShare
, total accrued management fees (accumulatedMgmtFees
), total accrued performance fees (accumulatedPerFormFees
), and the total amount of losses that the fund needs to make up in order for the manager to earn performance fees, if any (lossCarryforward
). These variables are returned to the Fund contract and stored there.
To calculate navPerShare
, the NavCalculator module first needs the gross asset value, the mark-to-market value of the portfolio. Since the bulk of the portfolio will held and traded on off-chain cryptocurrency exchanges, the protocol uses an oracle contract to retrieve this data. The DataFeed module manages interactions with the oracle.
The InvestorActions module handles logic related to changes in investor balances, such as changes in approved allocations, subscriptions, share balances, redemptions, and withdrawals. For each investor, these balances are housed in an Investor
struct stored in the Fund contract. Upon a function call that modifies one or more Investor
structs, the Fund contract calls a corresponding function in the InvestorActions module. The InvestorActions function checks for invariant conditions, performs calculations, and returns a modified Investor
struct to the Fund contract.
While the CoinAlpha Fund Protocol reduces the need for many of the middlemen involved in traditional asset management, the first iteration of the protocol still places a high degree of trust in various centralized parties. Since hedge fund investors by definition seek an trusted, professional asset manager to actively make investment decisions on their behalf, much of this centralization has been by design.
As blockchain infrastructure becomes more efficient and robust, we plan to revisit these dependencies on central actors to achieve greater decentralization and transparency where it's justified.
-
Manager: The fund manager is responsible for both fund administration and investment management. In the future, we plan on separating these concerns into an Administrator and an Investment Manager role, each with more limited authorities.
-
Cryptocurrency Exchanges: To perform trades in highly liquid markets, funds need to register and hold account at centralized cryptocurrency exchanges. While decentralized exchanges such as EtherDelta and others are available, they don't have the liquidity at this time to be reliable.
-
NAV API: The DataFeed module fetches the portfolio gross asset value via an oracle contract from an off-chain NAV-API service. This NAV-API is responsible for retrieving the balance of each cryptocurrency and fiat currency held by the fund at cryptocurrency exchanges.