How it works

Introduction

Housecat is a decentralized service for permissionless mirroring of trading actions between blockchain participants. Whenever a mirrored user changes their investment portfolio, the subscribed users will replicate the trades automatically, proportionally to the capital they have allocated to the mirrored portfolio.

The Housecat infrastructure includes three main elements: Smart Contracts, User Interface (UI), and Executors. The Smart Contracts are responsible for maintaining the accounting of the funds invested through Housecat in a decentralized fashion. The User Interface is a web application for interacting with the contracts and observing other users’ actions. The Executors are off-chain workers who continuously monitor the blockchain and execute rebalance transactions when a mirrored user changes their portfolio allocation.

Housecat is launched and currently operates on the Polygon chain. However, in the future, we plan to deploy to other EVM-compatible chains as well.

Trade Mirroring

When a user mirrors a portfolio, they deposit MATIC to a pool contract which is linked to the mirrored portfolio and holds tokens in the same proportions. The deposited funds will be used to purchase these tokens to increase the token balances of the pool while maintaining their weights. In exchange, the mirroring user receives a pool token for an amount that represents their ownership within the pool. Thereafter, whenever the token proportions in the mirrored portfolio change, the executors will rebalance the pool such that it will follow the trading strategy of the mirrored user. Upon the user withdrawing their position from the pool, the corresponding percentage of each token in the pool is sold for MATIC and sent back to the user.

Pool Token

Each portfolio that has subscribers on Housecat has a pool contract which is also an ERC20 token. Owning a percentage of the total supply of a pool token is equivalent to owning the same percentage of the assets held by the pool. Upon depositing to a pool, the related pool token is minted and sent to the subscriber. The minted amount is proportional to the quotient of the USD value of the deposit and the total USD value of the assets in the pool. Respectively, when the subscriber withdraws funds from the pool, the corresponding amount of the pool token will be burned.

Pool tokens can be transferred as any regular ERC-20 token. That is, a subscriber can transfer their position in a pool to another party by sending the pool tokens to the address of the other party.

Executors

Executors are off-chain workers that carry out the rebalancing task, ensuring that each pool follows the strategy of the portfolio they mirror. They monitor the blockchain continuously, and whenever a pool has different token weights than the underlying mirrored portfolio, one of the executors will perform a rebalance transaction for the pool. Usually, this happens when the owner of the mirrored portfolio has traded and changed their respective token weights. Upon rebalancing, the executor compares the current token allocation of the pool to the mirrored portfolio, resolves the swap amounts that are required to reach the same proportions, and passes this information to the smart contract via calldata.

Although the executors are an off-chain component, they do not introduce a centralization risk for the users’ funds. Firstly, the on-chain logic in the smart contracts ensures that the executors can only perform transactions such that the weight difference between the pool and the mirrored portfolio decreases. It is not possible for the executors to follow a different investment strategy than what the mirrored user follows or take funds away from the pool. Secondly, should the executors stop working for any reason, this would not prevent users from withdrawing their funds from the pools. A withdrawal can be initiated at any given time.

At the initial stage, the executors will be operated by Housecat or verified actors whitelisted by Housecat. However, at a later stage, we plan to open this task to the public such that anyone willing to run an executor worker will be able to do so. This will be incentivized by utilizing rebalancing rewards, which reduces the degree of centralization from the system's operation. Rebalance rewards are covered more in-depth below.

Weight Difference

Token weights are the percentage allocation of each token within a portfolio, and they always sum up to 100. The weight difference of a pool describes the degree to which the token weights of the pool diverge from the token weights of the portfolio it mirrors. The smallest possible weight difference is 0 and the largest 200. Generally, the total weight difference is the sum of the absolute difference of each token weight between the pool and the mirrored portfolio. The following table exemplifies the logic of calculating the weight differences in a simple setting where only three tokens are supported.

Mirrored PortfolioPoolWeight Difference

[50%, 50%, 0%]

[50% 50% 0%]

(50 - 50) + (50 - 50) + (0 - 0) = 0

[50%, 50%, 0%]

[40%, 30%, 30%]

(50 - 40) + (50 - 30) + (30 - 0) = 60

[50%, 50%, 0%]

[0% 0% 0%]

(50 - 0) + (50 - 0) + (0 - 0) = 100

[50%, 50%, 0%]

[100%, 0%, 0%]

(100 - 50) + (50 - 0) + (0 - 0) = 100

[50%, 50%, 0%]

[0%, 0%, 100%]

(50 - 0) + (50 - 0) + (100 - 0) = 200

The objective of the executors is to maintain zero weight difference for each pool. However, to avoid unnecessary gas use and prevent spamming, a small difference will be allowed. Additionally, certain minimum limits are required for the total values of the pools and the mirrored portfolios. Currently, the maximum allowed weight difference is 5, and the minimum total value is $100 for both the pools and the mirrored portfolios.

Slippage

The rebalance trades, initiated by the executors, are settled on decentralized exchanges that are based on the Automated Market Maker (AMM) protocol. As a result, a small percentage of the pool value is lost on each trade due to slippage. How much slippage occurs depends on the liquidity of the tokens that are being traded. To minimize the slippage effect, the executors optimize the trades by finding the best possible trade paths on multiple exchanges such that the value loss is as small as possible.

The smart contracts limit the maximum amount of value loss within a single rebalance transaction to 1%. Additionally, there is a maximum of 3% cumulative slippage limit over a 7-day period on a rolling basis. These on-chain limits protect the users’ funds by ensuring that the executors cannot execute trades that would cause unnecessarily high slippage.

It is possible that occasionally the slippage of a planned rebalance transaction is too high, and the executors will not be able to complete it in a single transaction. This can happen when the total value of the trade is high in relation to the available liquidity of the trading pair. In such a situation, the executors attempt to complete the transaction in multiple batches over a longer period of time.

Fees

To incentivize the users of Housecat to manage their portfolios successfully and create value for their followers, the portfolio owners are allowed to collect fees from the pools following them. There are two types of fees: management fee and performance fee. The fees have default values, but the portfolio owners may override the defaults as long as they keep within limits that have been specified in the smart contract. From each fee, Housecat takes a 25% cut.

The management fee is a percentage of the pool's total value, and it accrues continuously. For example, if the pool total value is $100 000 and the management fee is 1%, the value that accrues over one day is 100 000 * 0.01 / 365 = $2.74, of which Housecat taxes $0.685. The default management fee is 1% per annum, and the maximum is 25%.

The performance fee is a percentage of the profits the pool and its followers gain. It can be collected when the total value of the pool has increased compared to the previous settlement. When the performance fee is settled, the value of the pool at that time will be the next high water mark, where the pool value will be compared thereafter. For example, if the previous settlement occurred when the pool value was $100 000 and now the value is $110 000, with a 10% performance fee the accrued value would be (110 000 - 100 000) * 0.1 = $1000, including $250 tax to Housecat. The default performance fee is 10%, and the maximum is 25%.

All fees are distributed by minting the pool token to the beneficiaries. That is, the assets held by the pool are not traded to pay the fees, but the positions of the followers are diluted proportionally to the fee amount. The collected fees can be exchanged to MATIC by withdrawing the position from the pool.

The fees accrue automatically, but they are not sent to the beneficiaries until a fee settlement function has been triggered on the pool contract. This function can be triggered manually by anyone at any time, but it is also forced to trigger whenever the pool receives deposits or withdrawals or when the fee settings are changed.

Rebalance Rewards

While the executors carry out the rebalancing task, they have to spend gas on each transaction they execute. To compensate for the gas fees and incentivize the executors to maintain the system, the pools are also subject to a small fee that will be used to pay rebalance rewards to the executors.

The amount of the rebalance reward is 0.25% * pool total value * improvement in the weight difference / 100. For example, if a pool with a total value of $100 000 has a weight difference of 50, the reward after a complete rebalance would be 0.0025 * $100 000 * 50 / 100 = $125.

The rebalance rewards are distributed by minting pool tokens to the executors. As with the fees collected by the portfolio owners, the rebalance rewards are taxed by Housecat at a 25% rate.

Supported Tokens

Housecat supports a limited selection of tokens that can be mirrored. The list can be found here: https://app.housecat.com/supported-tokens. The main reason for limiting the selection is liquidity: In order for the pools to be able to trade a token, it has to have enough liquidity in the decentralized exchanges that Housecat uses. Another minimum requirement is that the token has to have a price feed in ChainLink.

When a portfolio owner holds tokens that are not supported by Housecat, such tokens will be ignored by the mirroring pool. For example, if a portfolio holds ETH, BTC, and DOGE for $1000 each, but only ETH and BTC are supported, the pool would keep its funds in ETH and BTC with a 50/50 allocation. The unsupported tokens will also not be visible in the Housecat UI.

The Housecat team monitors the existing and potential tokens regularly and updates the list of supported tokens if possible or needed. When a new token is added to the list, it will become visible on the UI and recognized by the executors. If there are portfolios holding this token, the mirroring pools will be rebalanced by the executors. In case a token has to be removed from Housecat, it will be marked as delisted, and the executors will sell this position from each pool holding it.

DeFi Integrations

Housecat integrates with other DeFi services that are needed for the executors to rebalance the pools. Currently, the rebalance trades take place in Uniswap V2 compatible exchanges that operate on the Polygon chain, such as QuickSwap and SushiSwap. In the future, we plan to extend the support to the Uniswap V3 interface and other relevant AMMs to maximize the available liquidity.

Currently, it is only possible to buy and hold tokens that are supported. However, in the future, more complicated investment strategies, such as short selling and yield farming, will be enabled.

Smart Contracts

The Smart Contracts are responsible for the accounting of the funds deposited into Housecat. They keep a book of each user's position in different pools by means of the pool token. They also contain the logic to handle the fees and calculate the exchange rates for the pool tokens on deposits and withdrawals. Moreover, the contracts include the rules and logic to trade assets within the pools when they are rebalanced.

There are two kinds of contracts: the core contracts and the adapters. The core contracts are immutable, meaning that it is not possible for the Housecat team to change their logic. They act as gatekeepers who ensure that the users, the executors, or the Housecat team will not be able to fool the system and make unsolicited profits at the expense of other users.

The adapters are upgradeable contracts that include the logic to integrate with other DeFi services in order for the executors to complete the rebalance trades. These contracts can be added and removed by the Housecat team, making it possible to optimize the system and add support for more advanced trading strategies. For example currently, there is an adapter for the UniswapV2 interface, which allows the pools to trade on such exchanges. In the future, we can add support for Uniswap V3 and Aave V2, for instance.

User Interface

Housecat can be used through a user interface that is available at https://app.housecat.com. The UI is connected to the blockchain, allowing interaction with the smart contracts and visualization of the data stored in the blockchain. The UI is also connected to a regular database where Housecat stores optional metadata of the users, such as profile pictures and nicknames.

While the UI is a centralized component managed by the Housecat team, it does not add any degree of centralization for the users’ funds. All necessary actions, such as deposit, withdrawal, and rebalance, can be triggered by connecting directly to the smart contracts. Respectively, it would be possible for anyone to create their own UI on top of the Housecat Smart Contracts.

Last updated