Skip to content
This repository has been archived by the owner on Dec 10, 2020. It is now read-only.
Michael Feng edited this page Oct 31, 2018 · 12 revisions

Basket Protocol: decentralized, non-custodial asset management

version 1.0 (March 2018)

Abstract

The Basket Protocol establishes a decentralized ecosystem that trustlessly fulfills the primary functions of asset management: selection, execution, and custody. Unlike a traditional investment fund, a Basket token is a non-custodial financial instrument collateralized by a portfolio of assets over which the investor has full control and agency.

1. Background

History of asset management

The 2018 cryptocurrency market is rife with frauds, pump-and-dump schemes, high volatility, and market manipulation.

In these respects, the cryptocurrency market bears many similarities to the early equities market. One of the first joint-stock companies was the South Seas Company (SSC), formed in 1711 with exclusive right to trade with South America. Driven by a speculative frenzy based on extravagant claims, SSC’s stock price rose quickly. When these claims proved unfounded, SSC's stock price subsequently collapsed.

SSC and similar cases gave birth to the asset management industry: professionals who evaluate, select, acquire, and manage portfolios of financial assets on behalf of investors. After the financial crisis of 1772-1773, a Dutch merchant, Adriaan van Ketwich, pooled money from various small investors in 1774 to form the first investment trust, diversifying risk across joint stock companies in the Europe and the American colonies. Pooled investment trusts took root in Great Britain and France, leading to the creation of the modern mutual fund, Massachusetts Investment Trust, in 1924 (source: The History of Mutual Funds).

Today, the asset management industry serves an indispensable function for investors. PriceWaterhouseCoopers projects total client assets under management to grow from $202 trillion in 2015 to $284 trillion by 2020 (source: Asset Management 2020: Taking stock).

Asset management and custody

Since its birth, asset management has been tightly coupled with the notion of custody, the need to protect client assets and safeguard them from loss and/or theft. According to the U.S. Securities & Exchange Commission (SEC), an adviser has custody of client assets, and therefore must comply with the rule, when it holds, "directly or indirectly, client funds or securities or [has] any authority to obtain possession of them"(source: Custody of Funds or Securities of Clients by Investment Advisers). This includes situations in which an asset manager has possession of client funds or securities, even briefly, as well as in situations in which they have trading or withdrawal authority over client funds.

Custody over client funds gives rise to a network of intermediaries needed to protect the legal and fiduciary interests of both asset managers and their clients. These include:

  • Limited liability legal vehicles (funds) that issue securities in return for client monies and impose rules and restrictions on how asset managers may use them;

  • Administrators who independently calculate net asset value and handle fund inflows and outfunds of client monies;

  • Accountants who track the value of the assets held by the fund;

  • Auditors who independently opine on the veracity of fund calculations, and;

  • Custodians that maintain and safeguard the assets into which client monies are invested.

To protect investors after the Bernie Madoff scandal, the SEC adopted a rule that any SEC-registered investment adviser who have custody of their clients’ funds or securities must utilize a third-party qualified custodian. A qualified custodian is defined as a bank or broker-dealer that maintains those funds and securities (i) in a separate account for each client under that client’s name; or (ii) in accounts that contain only your clients’ funds and securities, under your name as agent or trustee for the clients.

Problems with custodial asset management

Custodianship adds cost and risk

The need to maintain intermediaries to ensure secure custody add significant operational costs to managing a fund. With respect to establishing a U.S. hedge fund, average startup costs range from $50,000 to $100,000, and first-year operational costs usually total $75,000 to $150,000. These costs present a significant barrier to entry for new fund managers.

While costs may decrease with scale, fraud and theft risk increase as funds take custody of larger sums of client funds and utilize other custodial intermediaries. Most infamously, more than half of the $25 billion of losses incurred during the Madoff scandal came from feeder funds which delegated custody of their client capital to the Madoff funds. While investors in the feeder funds relied upon audited financials by well-known auditors like KPMGs, these auditors simply relied upon the fraudulent statements provided by the Madoff funds (source: The Madoff Fraud: How Culpable Were the Auditors?.

While SEC rule mandate that any fund over $150 million in assets must be registered and utilize qualified custodians, smaller funds are exempt from registration and may self-custody (source: SEC Adopts Dodd-Frank Act Amendments to Investment Advisers Act. Recently, two separate Ponzi schemes perpetuated in New York and Massachusetts, respectively, bilked investors out of over $37 million.

In the cryptocurrency market, the proliferation of unregistered funds and companies coupled with speculative mania has resulted in alleged Ponzi schemes like BitConnect, whose cryptocurrency plummeted in value more than 80%, wiping out $1.8 billion in market value.

Custody requirements stunt growth in crypto asset management

In addition, the qualified custodian requirement for SEC-registered investment advisers poses a strict barrier to entry in new asset classes such as cryptocurrencies, in which secure custody poses an unfamiliar set of requirements for traditional custodians.

Since cryptocurrencies register ownership solely as a balance in a blockchain-based ledger by a public key (address), anyone who knows the corresponding private key has full control over the token balance and can take all the tokens. Therefore, cryptocurrency custodians need to protect against theft via hacks or frauds, as well as accidental loss. Maintaining secure custody of cryptocurrencies may require safeguards such as multi-signature wallets, air-gapped cold storage, and even storing separate parts of a private keys in different, physically isolated bank vaults.

Since many traditional securities custodians do not have the requisite experience to perform this type of custody, few qualified custodians for cryptocurrencies exist, none with a lengthy track record across multiple market cycles. Therefore, many larger, established fund managers with over $150 million in assets cannot meet the qualified custodian requirement and are effectively restricted from entering the cryptocurrency market.

A new paradigm for asset management

One of the primary appeals of cryptocurrencies is decentralization: in return for taking on the responsibility of securely maintaining a wallet, a holder of Bitcoin, Ethereum and other cryptocurrencies gains independence from third party intermediaries like banks that are subject to government regulation, transaction costs, and slow execution.

We believe that a similar decentralized paradigm is possible in asset management. In return for taking on the responsibility for maintaining custody over a blockchain-based token that holds a portfolio of assets, an investor can benefit from the diversification and professional evaluation benefits of asset management, while retaining full agency over the portfolio.

We introduce the notion of the Basket, an Ethereum token collateralized by an immutable portfolio of other Ethereum tokens, which may be either utility or security tokens.

Baskets are purchased for a fixed price, and the quantities of the underlying tokens are set at purchase. After the purchase is complete, no party other than the buyer has discretion or managerial rights over the Basket, and the Basket token itself maintains custody of the underlying token portfolio. The buyer is responsible for maintaining custody of his/her Basket tokens.

Since they have full agency and control over the portfolio, buyers of Basket tokens can extract a portion of underlying tokens, and either (a) transfer the tokens to themselves outright, or (b) create a segregated token, owned wallet contract that contains the constituent tokens.

Unlike in a traditional investment fund, buyers never relinquishes custody over their monies nor the assets into which they are invested. We believe this new paradigm may obviate the need for intermediaries such as administrators, auditors and custodians, mitigate the risk of fraud, and enable the entry of established asset managers into the cryptocurrency market.

Layout

Section 2 discusses related works, other blockchain-based projects upon which the Basket protocol has been developed.

Section 3 introduces the Basket protocol ecosystem along with the roles of its three primary participants: Arrangers, Buyers, and Suppliers.

Section 4 presents the specification for BasketFactory, an Ethereum smart contract that creates other Ethereum smart contracts called Baskets.

Section 5 presents the specification for Basket, an Ethereum smart contract that holds a portfolio of Ethereum ERC-20 tokens.

Section 6 presents the specification and motivation for BasketRegister, an Ethereum smart contract that contains an immutable record of Baskets created using the protocol.

Section 7 discusses the limitations and risks of the Basket protocol, potential mitigants, and future growth areas.

2. Related works

Ethereum and the ERC-20 token standard

The Basket protocol is built on Ethereum, a blockchain that enables the decentralized execution of Turing-complete smart contracts. Ethereum smart contracts that implement standardized functions that govern the ownership and transfer of some fungible contract balance between Ethereum addresses are commonly referred to as tokens. Currently, the standard implemented by most Ethereum tokens is ERC-20 standard, which outlines functions such as transfer, transferFrom, and approve.

While other token standards such as ERC-223 and ERC-777 have introduced alterations designed to address certain issues with ERC-20 standard, they have not been adopted by the majority of the market. We may upgrade future versions of the BasketFactory smart contract to maintain consistency with market standards should the market adopt a standard besides ERC-20.

Decentralized exchange protocols

Decentralized exchange protocols such as the 0x Project (ZRX), Airswap (AST), and Kyber Network (KNC) allow market participants to trustlessly exchange tokens with one another. While these protocols differ in their individual mechanics, they all use smart contracts to swap Ethereum tokens between two counterparties without the custody risk imposed by centralized exchanges.

Like the Basket protocol, decentralized exchange protocols are non-custodial. We design the Basket protocol to be used alongside a decentralized exchange protocol to for purchase and sale of Basket tokens.

In this whitepaper, we describe integration with the 0x Protocol, but other decentralized exchange protocols can also be utilized.

Tokenized investment funds

Tokenized versions of traditional managed investment funds have been a popular application for Ethereum smart contracts. Currently, the largest tokenized fund platform is ICONOMI (ICN), which offers a range of index and actively-managed tokenized funds. In addition, Melonport (MLN) conducted a token sale in early 2017 to fund the development of a blockchain-based fund management protocol.

Prior to developing the Basket Protocol, CoinAlpha, Inc. developed the Fund Protocol, an open source protocol for tokenized investment funds. The goal of the Fund Protocol is to utilize blockchain technology to reduce the need for middlemen such as administrators, custodians, accountants and auditors. The resulting efficiency gains can then be passed to investors as lower fees and faster processing.

Despite the efficiency savings from not having an administrator, funds that utilized the Fund Protocol nonetheless bore the costs and risks associated with the traditional investment fund model. To govern the use of client funds and protect client interests from those of the investment manager, funds still needed a legal entity structure, such as a Delaware or Cayman Islands limited partnership. In addition, since funds still controlled client funds, secure custody is still required.

3. Ecosystem

The Basket Protocol is a set of smart contracts, implemented initially in Ethereum, that enable an open ecosystem of market participants to trustlessly and independently provide the core functions of traditional asset management:

Figure 1: Participants in the Basket Protocol ecosystem

  1. Selection and ongoing evaluation of a portfolio of assets (Arranger)
  2. Execution of the purchase of those assets at fair market prices (Supplier)
  3. Custody of the portfolio (Buyer)

We introduce two roles (Arranger and Supplier) that jointly facilitate the purchase and sale of Baskets by a Buyer. Note that any party can act in any or all of these capacities, subject to the regulatory requirements of their local jurisdiction.

While parties may have certain advantages, objectives, or limitations that align them to a specific role, a single party can act in more than one capacity (such as an Arranger also acting as a Supplier to facilitate the purchase of Baskets) and may even act in all three capacities (such as in the case of a party that wants to create, construct, and hold a collection of tokens for its own account).

Arranger

An Arranger fulfills the evaluation, selection, and monitoring functions of a traditional asset manager. Unlike a traditional asset manager, however, Arrangers do not need to take or manage custody of assets.

An Arranger enables creation of new Baskets by using the BasketFactory smart contract deploying a smart contract that defines the parameters of the Basket, akin to a recipe. Afterwards, the composition and the weights of the underlying tokens in the Basket are fixed and cannot be later modified.

Afterwards, the Arranger can engage in marketing the Basket to attract prospective Buyers and quoting prices for the Basket and/or its underlying tokens which it gets from Suppliers. An Arranger earns fees whenever a new Basket is minted (process described below, in Supplier: Basket “Minter”).

To rebalance the index, Arrangers may deploy new Basket smart contracts with different token compositions or weights. New Baskets are new, independent contracts that do not affect the composition of previously created Baskets. A rebalancing is the exchange of an old Basket for a new Basket, in which the difference in the market value of the token portfolios is reflected in the price of the new Basket.

Since Basket smart contracts are immutable and permanent, a historical series of Basket smart contracts also provides an auditable track record for Arrangers (See BasketRegistry).

Supplier

Suppliers are individual traders or firms that provide liquidity for Baskets by competing with one another to supply Baskets to meet market demand. This is achieved by secondary trading of existing and previously created Baskets, or by the primary function of constructing and minting new Baskets.

In order to mint new Baskets, Suppliers accumulate the constituent tokens defined in the Basket smart contract, transfer ownership of those tokens to the Basket smart contract and, in return, receive newly minted Basket tokens. The Basket tokens are effectively “pass through” tokens, representations of ownership entitlements to the deposited and constituent tokens held within the Basket smart contract.

Minting of Baskets is an ongoing process that happens real-time and in response to market demand. When Buyers bid for the Baskets in open the market, Suppliers (or existing Buyers) can fill orders either by (1) selling any existing holdings of the Basket, or (2) accumulating constituent tokens, minting a Basket, and selling the newly minted Basket to the Buyer.

Buyer

A Buyer purchases a Basket, a single instrument that provides access to a diversified portfolio of tokens, which might be utility tokens, security tokens, or collectibles. Buyers generate the demand for Baskets by placing signed orders that conform to 0x protocol standards.

Upon discovering a signed order whose overall Basket price is higher than the market value of the token portfolio and associated transaction costs, a rational Supplier may be able to earn an arbitrage profit by minting Basket tokens and filling the order via the 0x exchange protocol.

Arrangers may play a vital role in facilitate Buyer purchases by aggregating Buyer demand for a particular Basket, publishing indicative prices they receive from Suppliers, and/or acting as Suppliers themselve

Once the Buyer takes ownership of the Basket token, neither the Arranger nor Supplier have agency over the Basket token or its underlying tokens. At any time, Buyers can exchange Baskets for a proportional share of each of the underlying tokens. These extracted tokens are automatically transferred from the Basket smart contract to the Buyer’s Ethereum address.

Design rationale

Separating the three functions (selection, execution, custody) of traditional asset management into roles trustlessly fulfilled by different parties enables specialization, allowing each party to compete based on their relative strengths.

Arrangers compete with one another:

  • To create Baskets that Buyers want, based on research, brand, the buyer experience, and the track record they generate via the BasketRegister;

  • To facilitate Basket execution by matching Buyer signed orders with Suppliers who can fill them

Suppliers compete with one another to:

  • To minimize spread
  • To minimize execution time
  • To maximize probability that an order is filled

4. BasketFactory

The BasketFactory smart contract is an open-source smart contract maintained by CoinAlpha, Inc. (the Sponsor). Its primary functions are to (a) create Basket smart contracts, and (b) log a record of created Baskets to BasketRegister.

Figure 2: Arranger creates a Basket

In this and all other diagrams in this whitepaper, boxes are Ethereum smart contracts, while rounded boxes are Ethereum accounts. Solid arrows are Ethereum transactions, while dotted arrows are informational linkages. Arrows are directed from the caller to the callee. White, outlined rectangles in the middle of arrows represent transfers of Ethereum ERC-20 tokens. Diamonds are signed orders that may be submitted to the 0x decentralized exchange smart contract.

  1. Arranger calls the createBasket function on the BasketFactory smart contract. Function parameters includes the token compositions, token weights, and the Arranger fee.

  2. The createBasket function automatically creates a new smart contract called a Basket with the parameters specified in the contract call. The Basket is an Ethereum smart contract that complies with the ERC-20 token standard.

  3. The BasketFactory contract logs the created Basket under the Arranger’s address in the BasketRegister contract.

5. Basket

Immediately after creation via BasketFactory, a Basket smart contract is an empty receptacle that specifies what the addresses and compositions of the constituent tokens that it can hold.

Order

Using the 0x decentralized exchange protocol, the Buyer creates a signed order for some quantity of Basket tokens, specifying the amount, price in ETH, and order expiration time. No capital changes hands at this juncture, but this allows a Supplier to submit the signed order along with tokens that meet the order terms to the 0x decentralized exchange smart contract to trustlessly execute the trade.

Figure 3: Buyer places an order for a Basket token

Using the 0x protocol, Buyers may submit either a point-to-point or a broadcast order for the Basket token. Assuming that the Buyer had identified a Supplier who will fill the order, they will publish a point-to-point order.

Table 1: Message format for a point-to-point Basket token order

Name Data Type Description
version address Address of the current 0x exchange contract
maker address Address of the Buyer creating the order
taker address Address of the Supplier who will fill the order
tokenA address Address of the payment token used by the Buyer to pay for the Basket token
tokenB address Address of the Basket contract
valueA uint256 Units of the payment token offered by the Buyer
valueB uint256 Units of the Basket token requested by the Buyer
expiration uint256 Time at which the order expires
v uint8 ECDSA signature of the above arguments (1)
r bytes32 ECDSA signature of the above arguments (2)
s bytes32 ECDSA signature of the above arguments (3)

To incentivize Suppliers to fill the order, the price should reflect a premium to the aggregate market price of the underlying tokens. This premium compensates Suppliers for the transaction costs and inventory risks they bear to fill the order.

Minting

Generating a Basket token requires accumulating that required composition of tokens specified in the Basket contract, transferring their ownership to the Basket contract, and in return, receiving a newly created Basket token representing ownership of the constituent tokens. To compensate the Arranger for creating the Basket contract and for facilitating interaction between the Buyer and the Supplier, a percentage of the Basket tokens minted equal to the Basket contract’s arrangerFee parameter are transferred to the Arranger.

Figure 4: Supplier mints a Basket token

  1. For each constituent token, the Supplier calls the approve function on the token smart contract with the Basket contract address as the spender parameter.

  2. Supplier calls the bundle function on Basket, which transfers the constituent tokens from the Supplier to Basket in the prescribed amounts/proportions required to create the Basket token.

  3. The Basket token are minted and recorded in the Supplier’s balance.

  4. A percentage of Basket tokens minted equal to arrangerFee are recorded in the Arranger’s balance.

Execution

Figure 5: Supplier fills the order

To complete the purchase transaction, the Supplier submits the newly minted Basket token along with the Buyer’s signed order to the 0x decentralized exchange smart contract. If the terms match, the exchange contract facilitates the swap of ETH for the Basket token.

  1. Buyer approves the decentralized exchange contract to access their balance of the token they will use to pay for the Basket token.

  2. Supplier submits the Buyer’s signed order and the Basket token to the 0x decentralized exchange contract (DEX).

  3. DEX authenticates the Buyer’s signature, verifies that the order has not expired, and verifies that the order has not already been filled. If these checks succeed, the DEX transfers the Basket token to the Buyer and the payment token to the Supplier.

Unpacking At any time, a Buyer can call the debundle function to exchange a certain amount of Basket tokens for a proportional share of each underlying token in the portfolio. Since the Basket smart contract is the registered owner of each token, it can transfer ownership to the Buyer.

Figure 6: Buyer unpacks Basket into constituent tokens

  1. Buyer calls the debundle function and specifies a quantity of Basket tokens.
  2. Afterwards, the Basket smart contract automatically calls the transfer function for each constituent token in its portfolio to transfer a proportional ownership to the Buyer. Afterwards, Buyer is the registered owner of the constituent tokens and can access them via any Ethereum wallet.

Sale and rebalance

Subject to transfer restrictions imposed by the Basket, a Buyer may sell a Basket to a Supplier (or any other Ethereum address) using the Point-to-point Order specification as described in the 0x protocol whitepaper.

Afterwards, the Supplier will be the new Buyer and can call the debundle function to own the underlying tokens directly. Assuming the underlying tokens are liquid, the market ask prices for Basket tokens should be equivalent to the weighted average mid-market price of the underlying tokens less a discount. The discount reflects factors such as timing risk, slippage, exchange transaction fees, Ethereum transaction fees and the Supplier’s margins. As more Suppliers enter the market and compete to provide liquidity, this discount should decrease.

Since the primary counterparty for Buyers in the Basket ecosystem is the Arranger from which they purchased the Basket, the Arranger may broker the transaction. The Arranger does not earn any fees directly from the sale via the smart contracts, but they may negotiate compensation from the Supplier off-chain.

To support purchasers of older Baskets whose portfolio composition have been subsequently updated, Arrangers may quote a rebalance price, expressed in units of new Basket tokens divided by old Basket tokens. A rebalance are two back-to-back transactions: 1) the sale of an existing Basket and 2) purchase of a new Basket. The fee earned by the Arranger is the same as for a purchase, but the Arranger may provide a discount to Buyer for rebalancing transactions.

6. BasketRegister

Whenever a new Basket is created, the BasketFactory contract logs data related to the created Basket in the BasketRegister contract. This builds an immutable log of all Baskets created by a particular Arranger. For each Basket, the register keeps track of the total quantity minted, as well as all the Suppliers who have minted the Basket.

Since the BasketRegister contract is separate from the BasketFactory contract, its data persists even if BasketFactory is updated.

The BasketRegister is intended to mitigate the risk of survivorship bias: the tendency for mutual funds with poor performance to be merged into other funds or shut down. Specifically, if we look at the ten-year average returns of funds as of a certain date, we are limited to funds that survived to the end of the period. On average, Morningstar found that the average annual returns for funds in the 20-year period ending on March 31, 2014 dropped from 8.9% to 8.1% when including all funds that started the period (Morningstar Takes a Closer Look at Survivorship Bias).

Given the importance that investors place on performance, fund managers and index creators also have a incentivize to highlight or disclose only their funds that perform well. By creating a registry of each Arranger and a performance history of their Baskets, the Basket Register makes transparent their full track record.

7. Limitations and risks

Below, we discuss potential risks and limitations of the Basket Protocol, along with potential mitigants.

Limited to Ethereum tokens

Since the Basket Protocol relies on the fact that Ethereum smart contracts can own other Ethereum smart contracts, it is initially limited to Ethereum tokens that implement the ERC-20 standard. Currently there are approximately 200 Ethereum tokens with market capitalizations above $25 million. Of these tokens, approximately 20% have more than $10 million average daily trading volume.

In addition, projects such as Polkadot and Cosmos are building standards for cross-chain atomic swaps, which would allow Ethereum tokens to represent value on other blockchains. In the future, relayers using the 0x protocol may also be able to effect cross-chain tokens, by hosting order books for price discovery and relaying messages between chains to trigger the release of funds from the escrow on each chain.

Repackaging exploits

Pump-and-dump schemes are already rife in the current token markets. Similar to how worthless subprime mortgages were repackaged and sold at inflated costs to unsuspecting buyers during the 2008 financial crisis, there is a substantial risk that Baskets may make pump-and-dump schemes even more lucrative through a repackaging exploit.

To execute a repackaging exploit, a malicious Arranger acquires a portfolio of thinly traded tokens and creates a Basket out of them to add a veneer of respectability. Afterwards, the Arranger drives up the price on the exchanges where the tokens trade and markets the Basket at an inflated overall price. Since they already hold the tokens, the Arranger can also act as the Supplier and liquidate their token holdings to unsuspecting Basket Buyers at prices higher than where they acquired them.

To mitigate this risk, we instituted the BasketRegister smart contract, an open and immutable track record of Baskets created by each Arranger using the Basket Protocol. In addition, we believe that the creation of token-curated registries of Arrangers and Baskets via projects such as DIRT Protocol will allow stakeholders to determine quality via voting.

Basket contract security

Until investors call the debundle or extract functions, the address of the Basket smart contract is the owner of the underlying tokens. As a certain Basket becomes more popular and attracts Buyers, it holds more tokens and may become a more lucrative target for hackers.

To mitigate this risk, we will conduct extensive security audits of the contracts in the Basket ecosystem before publication. If a vulnerability is discovered afterwards, we will publish a new version of the BasketFactory contract and work to provide an upgrade path for existing Basket token holders.

In addition, the debundle and extract functions allow a Basket token holder to take ownership of the constituent tokens and to move them to a segregated token wallet (See Section 5: Basket).

False orders / pump-and-dump

Since Basket purchases are only executed when the Supplier delivers the Buyer’s signed order and the Basket token to the 0x exchange contract, the exchange may fail if the Buyer has transferred their payment token out of the wallet after creating the signed order.

A malicious Buyer may submit a large order on a Basket of tokens with low liquidity, and then transfer their payment tokens to any address afterwards. When a Supplier tries to fill this order, the order will fail due to insufficient funds. If the Supplier has hedged their exposure by purchasing the underlying tokens in the open market before filling this order, there may be upward price pressure. A Buyer with an existing exposure to these tokens may attempt this tactic in order to drive up prices and sell their inventory afterwards.