Read more about Teahouse's various smart contracts behind our strategies here.
TeaVault v3 Portfolio
TeaVault v3 Portfolio is a portfolio strategy infrastructure specifically designed to manage multiple ERC20 assets. These ERC20 assets include common fungible tokens, AAVE aTokens, and TeaVault v3 Pair shares. Strategy managers have the flexibility to oversee funds through the vault and adjust the proportion of each asset.
This design tokenizes the funds, providing liquidity providers with a more self-custodial approach, allowing them to enter/exit a strategy at any time. As managers do not directly hold the funds, the TeaVault v3 Portfolio enhances transparency in portfolio management, while supporting both manual and algorithmic management of large funds.
Key Features
Manages multiple assets: fungible ERC20 shares to enable composability, AAVE aTokens for interest accrual, and tokenized liquidity positions (Pairs).
Facilitates rebalancing through various aggregators while incorporating exchange rate protection measures.
Utilizes a carefully designed Uniswap V3-based TWAP oracle for precise performance fee calculation.
Implements a vault-level high watermark-like performance fee mechanism - our GDPS model.
Design
Roles
Users: Deposit assets into the token pool then withdraw appropriate ShareTokens to represent the share of the pool. Withdraw assets by burning the held ShareTokens.
Strategy Managers: Manage the off-chain algorithms that send signals to the Portfolio Vaults to adjust the asset proportions based on market conditions. This encompasses determining the proportion of assets held in the vault, supplying assets to the AAVE pool, and rebalancing funds through the Uniswap v3 swap router or aggregators.
TeaVault V3 Portfolio: The TeaVault V3 Portfolio sports a UUPS upgradable pattern for enhanced flexibility and upgradability. During initialization, the TeaVault V3 Portfolio specifies Uniswap v3-based oracles, AAVE pools, Uniswap v3 swap router, and path recommender. In addition, it can hold multiple ERC20 fungible assets and facilitates asset swapping through swap aggregators and the Uniswap v3 swap router. It also includes functionality for calculating protocol fees and helper functions for front-end development and strategy automation.
Fee Collection Vault: Collects protocol fees, including entry, exit, management, and performance fees.
Uniswap V3-based Oracle: Calculates asset price and value with TWAP from the Uniswap V3 pool and covers three types of oracles: Asset oracle, Pair oracle, and AAVE aToken oracle.
Path Recommender: Recommends a pre-set baseline Uniswap v3 swap route for swaps.
TeaVault v3
The Teahouse Dual-Asset Liquidity Provision (Permissionless) Vaults are designed to allow our off-chain LP strategies to manage liquidity positions on decentralized AMMs (DEXs) using concentrated liquidity. Beginning with Uniswap v3, Teahouse plans to expand to many more concentrated liquidity AMMs on the Ethereum networks and Layer 2’s.
Vault Structure
The LP Vaults employ a specialized smart contract, TeaVault v3, designed to facilitate concentrated liquidity provision by holding multiple liquidity and spot positions. It encompasses various functions including asset custody flow, execution of strategy signals, and fee accounting management.
LP Vault users are empowered to deposit and withdraw their assets in a self-custodial manner. By minting and burning ShareTokens, users can enter or exit strategies at their discretion, ensuring the flexibility and liquidity of their assets.
Liquidity strategy managers are not directly responsible for holding the users’ assets. Instead, they utilize the Vault to manage user funds by rebalancing portfolio holdings and selecting volume and price ranges for liquidity positions. The absence of direct control by managers in TeaVault v3 pairs enhances the safety and transparency in liquidity management and supports automated management of substantial volumes of liquidity
Roles
Liquidity Providers - Deposit assets into the token pool then withdraw appropriate ShareTokens to represent the share of the pool
Strategy Managers - Manage the offline algorithms that send signals to the LP Vaults to open/close/modify the liquidity positions based on market conditions
Vault Owners - Own or sponsor the LP Vaults (usually Teahouse, sometimes can be a Teahouse partner such as a protocol that wants to list their token)
Platform - provides the underlying structure and governance & collect fees
TeaVault v2
For depositing a single Asset Token and issuing ShareTokens of an equivalent value
For Auditors to audit the fund value and other metrics provided by the Fund Manager
Can only transfer assets into a specified TeaVault v.2
Calculate and automatically deduct platform usage fees
TeaVault v.2 is a new and improved TeaVault smart contract used to manage assets and interact with other DeFi projects. It whitelists all the necessary operations and projects, limiting what the Fund Manager (and other malicious players) can do, and thereby greatly increasing the platform security. For example, Fund Managers cannot withdraw funds to another wallet.
Using the Concentrated LP Strategy as an example, its TeaVault v.2 can currently perform operations on Perpetual Protocol (add & remove liquidity) and access certain bridges to bridge funds between ETH mainnet and Optimism.
HighTableVault
Used by Strategy Managers to manage their strategies and user funds, HighTableVault is a smart contract whose main function is accounting and fee calculations.
Asset Tokens <-> ShareTokens Exchange
HighTableVault facilitates the exchange between tokens. Various calculations are made via the HighTableVault to determine the share (portion) of the fund of each user, based on the ShareTokens that they hold.
Taking the Pseudo Market Neutral LP Strategy as an example, when a user deposits USDC, the corresponding HighTableVault will exchange the USDC tokens for ShareTokens of an equivalent value. When the exchange rate is 1 to 1, for each USDC deposited, users will get back 1 OPTEA token after the locking period. The OPTEA tokens will then fluctuate in value based on the strategy performance. When the user wants to exit the strategy, he/she can use the HighTableVault to exchange back USDC by redeeming OPTEA tokens at the current exchange rate.
The Auditor verifies strategy metrics via the HighTableVault
Each round, the Fund Manger provides the Auditor with strategy metrics including the current fund value. The Auditor then verifies this data on-chain and using the HighTableVault, confirm information such as the fund value, lock time, new round start time, and whether the fund (vault) is being closed.
Transfer of funds to specified TeaVault v.2
The whitelisted operations only allow the HighTableVault to transfer funds from itself to a specified TeaVault v2, thus limiting what Fund Managers and potential malicious actors can do. These limitations greatly increase the security of the platform.
Fees calculations & management
Hightable Vault ensures transparency and automation in the calculation and settlement of figures related to strategies, eliminating the need for manual calculation. The vault automatically transfers Teahouse's revenue and manager's fees to the relevant addresses, while being restricted by the limitations of the smart contract, thereby preventing arbitrary access to the assets inside.