Bestia is an in-development protocol that structures illiquid on chain credit assets, such as Real World Assets (RWAs), into Liquid Yield Tokens. It implements innovative mechanisms for efficient capital allocation and risk management.
For more detailed information about the first pool that will launch on Bestia see the draft Whitepaper
- Supports both ERC4626 vaults for liquid assets and ERC7540 for illiquid assets/RWAs
- Mock implementation of ERC7540 to represent RWAs in the current prototype
- Implements a dynamic pricing curve to manage deposits and withdrawals
- Protects the protocol and long-term holders from volatility and potential "bank runs"
- Adjusts the effective exchange rate based on the current reserve ratio
- Banker role invests excess funds into various asset strategies
- Separate logic for investing in liquid (ERC4626) and illiquid (ERC7540) assets
- Maintains a target cash reserve ratio for liquidity management
- Special handling for asynchronous assets (like RWAs) with pending deposits and redemptions
- Tracks pending transactions to maintain accurate total asset calculations
totalAssets()
: Calculates the total value of all assets in the protocoladjustedDeposit()
/adjustedWithdraw()
: Apply swing pricing to deposits and withdrawalsinvestCash()
: Invests excess cash into liquid asset strategiesinvestInAsyncVault()
: Manages investments into illiquid/RWA strategies
This is a work-in-progress prototype. Many of the core mechanisms are in place, but further testing and refinement are needed, especially around the integration of ERC7540 assets. As such, it is:
- Not safe
- Not gas optimized
- Finalize and optimize the ERC7540 integration
- Make sure the 7540Mock is fair and complete its functions
- Fuzz & Invariant Testing
- Create Separate User-Facing Token
- Rebasing Token for yield distribution
- Wrapped Token for defi integrations
- Modular Architecture
- Split Functionality over Modules and Libraries
- Integrate other RWA Protocols
- Single vault contract for efficient rebalancing
- Factory model for permissionless pool creation
- Improve the rebalancing and optimize for capital efficiency & risk management
- Decentralize rebalancing with auctions/intents
We welcome contributions and feedback.
This is an experimental protocol. Use at your own risk. Not audited or ready for production use.
- Built on Solidity ^0.8.20
- Custom implementation of ERC7540 for handling asynchronous assets
This project uses Foundry for development and testing. Follow these steps to get the project up and running on your local machine.
- Install Foundry
- Clone the repository:
git clone [https://github.com/0xCSMNT/bestia_v0.git](https://github.com/0xCSMNT/bestia_v0)
cd bestia_v0
Install dependencies:
forge install
Update Foundry:
foundryup
Compile the contracts:
forge build
Run the test suite:
forge test