Modular Yield & Liquidity Retention Middleware
Permissionless factory, modular adapter framework, and standard for Liquid Account Vaults (lavNFT) with dual-engine yield streaming and autonomous ragequit mechanics.
lavFACTORY is a non-custodial infrastructure protocol built to convert speculative token volume and creator fees into sustainable, onchain-backed liquidity. Rather than locking capital in isolated staking pools, lavFACTORY acts as composable middleware connecting third-party launchpads, AMM bonding curves, and DEXs to real-yield vaults.
Each vault position is minted as an ERC-721 lavNFT coupled with an ERC-6551 Token-Bound Account (TBA), backed by an immutable 95/5 ragequit floor and automated yield streaming in USDG, native assets, or tokenized equities.
lavFACTORY is designed to be integrated upstream by any launchpad or token factory, and downstream by DeFi primitives:
┌────────────────────────────────────────────────────────────────────────┐
│ Any Upstream Launchpad, Factory or AMM │
│ (Bonding Curves · Token Launchpads · AMM Liquidity Pools · Hooks) │
└───────────────────────────────────┬────────────────────────────────────┘
│ trading volume / creator fees / taxes
▼
┌────────────────────────────────────────────────────────────────────────┐
│ lavAdapters (Modular) │
│ • Lightweight adapter layer for upstream protocol fee routing │
│ • Direct permissionless streaming via syncYield() (zero adapter) │
└───────────────────────────────────┬────────────────────────────────────┘
│
┌──────────────┴──────────────┐
▼ ▼
┌─────────────────────┐ ┌─────────────────────┐
│ Engine 1: Principal │ │ Engine 2: Yield │
│ (Body Growth) │ │ (24h Linear Stream)│
└──────────┬──────────┘ └──────────┬──────────┘
│ │
└──────────────┬──────────────┘
▼
┌────────────────────────────────────────────────────────────────────────┐
│ lavNFT Position Vault │
│ (ERC-6551 TBA · 95/5 Autonomous Exit Floor) │
└───────────────────────────────────┬────────────────────────────────────┘
│ composable collateral
▼
┌────────────────────────────────────────────────────────────────────────┐
│ Downstream DeFi & Secondary Markets │
│ (Lending markets, NFT AMMs, OTC Desks, Structured Credit) │
└────────────────────────────────────────────────────────────────────────┘
The core vault architecture is completely decoupled from any specific liquidity venue or launch platform:
- Agnostic Core Accounting:
LavFactoryandLiquidAccountVaultcontain zero hardcoded dependencies on external platforms. The vault accepts standard ERC-20 deposits, tracks virtual shares with inflation protection, and exposes permissionlesssyncYield()streaming. - Direct Yield Inflow: Any protocol, DAO, or external contract can stream yield directly to any vault permissionlessly without deploying an adapter.
- Modular Adapter Interface (
lavAdapters): For platforms with custom fee-splitting, escrow, or hook mechanics, lightweight peripheral adapters can be deployed to automatically ingest creator fees, perform non-custodial routing, and feed the dual-engine streaming loop.
| Contract | Address | Type |
|---|---|---|
LavFactory |
0x262d4d478eFe72Eb1731310a4f7A252644aA4B5F |
Permissionless Factory |
| Protocol Treasury | 0xeDbc87E40491b9edF65940acF63A5c0E81d8a4f1 |
Safe (2/3 Multisig) |
| ERC-6551 Registry | 0x000000006551c19487814612e58FE06813775758 |
Canonical Singleton |
| ERC-6551 Account Implementation | 0xC55D74fba44eb126ef5F6FbCcb93e443d4f40902 |
Reference Implementation |
- Anyone can deploy a sovereign vault via
LavFactory.createVault(stakingToken, yieldToken), paying the anti-spam fee in the same call. - The name and symbol are not chosen by the caller: both are derived on chain from the staking token's own
symbol(), namelav<SYMBOL> Vaultand symbollav<SYMBOL>. The read is bounded (50 000 gas, 128 bytes of reply), the result is reduced to[A-Za-z0-9 ._+-]and cut to 12 characters, andTOKENis used if nothing usable is left. - The receipt card renderer is attached afterwards by the vault owner with
setDescriptor(address). - Anti-spam creation fee:
CREATION_FEE = 0.002 ETH, forwarded directly to the protocol treasury Safe. - The factory is completely autonomous: no owner, no admin, no pause. The treasury, registry, and ERC-6551 implementation are
immutable. isVault(address) == trueon the factory confirms the vault was deployed byLavFactory.
- Each deposit mints a unique position NFT. Token IDs are generated from a monotonic counter (
nextTokenId++) and are never reused. - Shares are calculated with a virtual offset (
SHARE_OFFSET = 1e6) to protect against initial share inflation and donation exploits:$$\text{shares} = \frac{\text{received} \times (\text{totalShares} + 10^6)}{\text{totalBody} + 10^6}$$ - A deposit that would compute zero shares reverts (
Zero shares minted). - A position can also be minted for someone else with
depositTo(amount, recipient). - Permissionless entry points that pull external balances into the accounting:
syncYield()(yield),notifyTaxBody()(staking-token tax already sitting on the vault) anddistributeYield(amount)(transfer and stream in one call). - Accounting tracks balance deltas (
balAfter - balBefore), so a token that charges a fee on transfer cannot break the deposit accounting.
- Staking tokens sent to the vault via transfer taxes or direct contribution increase the underlying principal (
totalBody). - While the vault has active positions (
totalShares > 0), 10% is routed to the protocol treasury Safe and 90% is credited instantly to stakers pro rata. - Empty-vault tax sweep: If staking-token tax arrives while
totalShares == 0(before the first deposit, or after all positions have exited), there are no stakers to credit. In that case 10% goes to the protocol treasury Safe and 90% is transferred to the current vault owner (TaxSweptEarly). If the transfer to the owner fails, the full amount goes to the protocol treasury Safe. This can occur any number of times over the vault's lifetime.
- Incoming revenue (e.g. trading fees via ecosystem adapters or direct protocol yield) is streamed to active stakers:
- 10% protocol fee to the protocol treasury Safe.
- 90% distributed evenly over a continuous 24-hour stream (
STREAM_DURATION = 86400).
- Any new yield arrival merges with unstreamed tokens (
remaining) and initiates a fresh 24-hour linear release window. - Empty Vault Protection: If all positions exit or before the first deposit (
totalShares == 0), the stream timer pauses automatically (periodFinishshifts forward:periodFinish += block.timestamp - last). When a new deposit arrives, the stream resumes without any loss of reward funds. - The vault owner receives no allocation of reward-token yield and cannot withdraw unstreamed staker funds. The only case where the owner receives staking tokens is the empty-vault tax sweep described in Engine 1.
A vault receives and streams yield through two distinct mechanisms:
- Automated Pool Routing (Adapters): Deployed adapter instances (e.g.
LavAdapterPnsorLavAdapterPnsEth) claim creator fees from upstream fee escrows and route them into the vault stream on eachpull(). Multiple adapters can route into a single vault (1 vault -> N adapters), allowing one vault to aggregate creator fees across multiple pools. - Direct Manual Top-up (Any Vault): Any vault created via
LavFactorycan receive arbitrary yield directly. The project team, community members, or external revenue sources (e.g. protocol fees, OTC sales, merchandise) can transferyieldTokendirectly to the vault contract address and callsyncYield(). The newly received yield is immediately added to the active 24-hour linear streaming schedule for all stakers. - Curve Sweep (
sweepCurve()): Permissionless, and part of the same adapter. Once bound, it pushes creator fees out of the bonding curve into the PNS fee escrow. It returnsfalsewithout reverting when the adapter is not bound, when the token has no curve, or when the curve call fails, and emitsCurveSweep(curve, ok); it reverts withInsufficientGaswhen less thanSWEEP_MIN_GAS = 400 000gas is left for the curve call, so a sweep cannot fail silently for lack of gas.
- Yield Claim (
claimYield): Accrued yield can be claimed at any time with 0% penalty and 0% withdrawal fees. The underlying position remains active. - Ragequit (
ragequit):- Returns at least 95% of the position's pro-rata body,
grossBody = shares * totalBody / totalShares. The body per share never falls: deposits and taxes only add tototalBody, and an exit removes exactly the exiting position's pro-rata part. The 5% burn is what the exit costs; growth of the body since the deposit is what offsets it. - Exactly 5% (
RAGEQUIT_BURN_BPS = 500) is burned to0x000000000000000000000000000000000000dEaD(or held inlockedBurnif transfer to dead address is restricted), exerting perpetual deflationary pressure. - 100% of accrued yield is paid out with zero penalty, with one exception: the yield transfer at exit is best effort (see
docs/RISKS.md). - The principal is sent with a reverting transfer, so a staking token that refuses only delays the exit. The yield is sent with a bounded call (
TOKEN_XFER_GAS = 500 000) that cannot revert the exit: if the token refuses, the position is still closed, the NFT is burned,YieldPayoutFailed(tokenId, to, amount)is emitted, andRagequittedreportsyieldPayout = 0. - The position NFT is permanently burned (
_burn(tokenId)).
- Returns at least 95% of the position's pro-rata body,
- Each minted position NFT automatically owns a deterministic smart contract account on Robinhood Chain.
- Account operations are restricted to
CALL(operation == 0).DELEGATECALLandCREATEare disabled. - Transferring the position NFT seamlessly transfers ownership of the account and all underlying assets held within it.
- Withdraw all assets from the position's token-bound account before calling
ragequit. Burning the position NFT revokes signer authorization for the account, and assets left there become irrecoverable.
The vault creator is the initial vault owner with strictly scoped configuration capabilities:
- Metadata & Appearance: Can update the visual/metadata card descriptor (
setDescriptor), base URI (setBaseURI), contract URI (setContractURI,freezeContractURI), and card color palette (setPalette). - Renderers are modular, not protocol contracts:
LavFactorydoes not pass a descriptor to a new vault, so a fresh vault has none andtokenURIfalls back tobaseURI(an empty string when both are unset). Any contract that implements the single view functiontokenURI(address,uint256)can act as the card renderer, so a renderer can be deployed per project, per art or per collection.0x061Fa7d89728C36b1B0f1928e1F8Eb6cd88A1F68is the renderer the launcher interface binds by default for new vaults, an interface choice rather than a protocol constant. - Ownership Management: Can transfer ownership with
transferOwnership(newOwner). Ownership cannot be renounced: the zero address is rejected (Zero new owner), so the empty-vault sweep always has a recipient. - Empty-Vault Sweep Recipient: Can receive 90% of staking-token tax that arrives while
totalShares == 0(see Empty-vault tax sweep).
The owner cannot access user deposits, adjust fee parameters, pause the vault, block claimYield or ragequit, or withdraw streamed or unstreamed yield. The descriptor is executed exclusively via read-only tokenURI calls and cannot interrupt deposits, claims, or ragequits. The owner can replace it at any time with setDescriptor, including setting it back to the zero address, which returns tokenURI to baseURI.
The core protocol (LiquidAccountVault, LavFactory, and lavNFT) constitutes an autonomous accounting and streaming system that is independent of any specific launchpad platform. The core contracts contain no dependencies on external deployment platforms.
Peripheral adapters serve solely as optional upstream fee conduits for designated launchpad contracts and have no broader functional scope.
-
Scoped Third-Party Targets (
LavAdapterPns,LavAdapterPnsEth)
These adapters interface with designated liquidity contracts on Robinhood Chain (Chain ID: 4663), specifically:PonsV2LaunchFactory(0x7eD598BcEf8bd9Edd8C97A195C6d13f40801EC7e)PonsV2MemeHook(0xE5e702641Ea86F4ae6cC3cDaeD2B886f976Be044)PonsV2FeeEscrow(0xd3AFEB2a57f70eF218Aa82451c51B2fb0416Ac9e)
Their functionality is strictly limited to claiming accumulated creator quote fees from fee escrow contracts and distributing such fees between the vault and the designated team wallet.
-
Standalone Deployments
Tokens deployed outside specific pool architectures do not utilise external escrow adapters. Any ERC-20 staking token may be paired with an arbitrary ERC-20 yield token through theLavFactory.createVault()function. Yield ingestion for standalone vaults is effected by direct transfer of assets to the vault address, followed by permissionless calls to thesyncYield()function.
Ecosystem adapters route liquidity pool creator fees and external revenue streams into individual vaults. Each pool has its own deployed adapter instance:
LavAdapterPns: Universal adapter for ERC-20 quote pairs (including USDG and tokenized stocks). Routes creator trading fees from liquidity pair fee escrows into the corresponding vault.LavAdapterPnsEth: Claims native ETH creator trading fees from fee escrows, wraps them into WETH, and routes WETH yield into the vault stream.
The protocol treasury receives 10% of all incoming creator fees regardless of vaultShareBps (with rounding dust favoring the team):
- Vault portion:
vaultShareBpsis expressed in bps of trading volume (minimumMIN_VAULT_SHARE_BPS = 10, i.e. 0.10%) and cannot exceed the pool's total creator fee (totalCreatorBps). The vault receivesvaultShareBps / totalCreatorBpsof every pulled amount. Inside the vault, 10% is retained by the protocol treasury (YIELD_PROTOCOL_FEE_BPS = 1000) and 90% is streamed over 24 hours to active stakers. - Team portion: The remainder (
total - toVault) is split: 90% to the project team wallet (teamWallet) and 10% to the protocol treasury (PROTOCOL_SHARE_BPS = 1000). - Non-blocking failure recovery: Failed transfers accrue independently to
vaultOwed,teamOwed, andtreasuryOwed. Any caller can settle accrued debts permissionlessly viaclaimVaultOwed(),claimTeamOwed(), andclaimTreasuryOwed(). - Supported tokens: Standard ERC-20 tokens only. Rebasing and transfer-hook (ERC-777) tokens are unsupported and can cause accounting discrepancies or reentrancy. A token that charges a fee on transfer is handled by measuring the amount actually received, on deposits as well as on pulls, but it is still not recommended as a quote or staking token.
- Throughput & Parameters: Adapter throughput is throttled at
maxPullPerCallperminPullInterval(both immutable). Excess fees remain safely in escrow and are paid out in subsequent pulls. Authoritative link is registered as the escrowrecipient;Boundevents are for discovery and indexing only. - Multi-Adapter Support: A single vault can receive yield streams from multiple adapters simultaneously (1 vault -> N adapters). Each adapter is permanently locked to its target vault once bound.
- Dynamic Vaults: Vaults are created permissionlessly via
LavFactory.createVault()and are not listed in static deployment files. Enumerate them onchain viaallVaults(index)and verify any address withLavFactory.isVault(addr).
The protocol treasury retains 10% of gross incoming creator fees pulled by an adapter, regardless of the split configured between the vault and the project team. Because both the vault portion and the team portion are subject to the same 10% rate, the aggregate fee received by the treasury remains 10% across all allocation ratios:
-
Example 1 (40% Vault / 60% Team Allocation):
- Gross creator fees pulled: 100 USDG
- Vault portion (40 USDG): 4 USDG to protocol treasury (10%), 36 USDG streamed to active stakers (90%)
- Team portion (60 USDG): 6 USDG to protocol treasury (10%), 54 USDG paid to team wallet (90%)
- Total protocol fee collected: 4 + 6 = 10 USDG (10% of gross fees)
-
Example 2 (0.10% vault / 99.90% team allocation, the minimum vault floor):
- Gross creator fees pulled: 100 USDG
- Vault portion (0.10 USDG): 0.01 USDG to protocol treasury (10%), 0.09 USDG streamed to active stakers (90%)
- Team portion (99.90 USDG): 9.99 USDG to protocol treasury (10%), 89.91 USDG paid to team wallet (90%)
- Total protocol fee collected: 0.01 + 9.99 = 10 USDG (10% of gross fees)
-
Net Distribution Summary: At any configured
vaultShareBps, the protocol treasury receives 10% of gross fees, active stakers receive 90% of the vault allocation, and the project team receives 90% of the team allocation.
| Setting | Value |
|---|---|
| Solidity Compiler | v0.8.24+commit.e11b9ed9 |
| EVM Version | shanghai |
| Optimizer | enabled: true, runs: 200 |
| Metadata | appendCBOR: false, bytecodeHash: none |
Robinhood Chain, chainId 4663. These are the protocol addresses; vaults are created permissionlessly
and are not listed here, enumerate them on chain with LavFactory.allVaults(index) and verify any
address with LavFactory.isVault(addr).
| Contract | Address | Explorer |
|---|---|---|
LavFactory |
0x262d4d478eFe72Eb1731310a4f7A252644aA4B5F |
view |
| Protocol Treasury (Safe, 2/3) | 0xeDbc87E40491b9edF65940acF63A5c0E81d8a4f1 |
view |
| ERC-6551 Registry | 0x000000006551c19487814612e58FE06813775758 |
view |
| ERC-6551 Account Implementation | 0xC55D74fba44eb126ef5F6FbCcb93e443d4f40902 |
view |
deployments.json carries the same values for tooling, and script/check-onchain.sh re-checks every
one of them against the live chain.
The contracts have not undergone an independent third-party audit. Internal reviews, invariant tests and on-chain verification are not a substitute for one. The scope, the trust model and the vulnerability reporting process are in SECURITY.md; the design trade-offs and what follows from them are in docs/RISKS.md.
UNLICENSED, all rights reserved: the source is published for transparency, auditing and verification purposes only. The full notice, including the list of files that carry a different identifier, is in LICENSE.
src/ERC6551Account.sol is the ERC-6551 reference implementation example, included unchanged, and keeps its MIT identifier.
git clone --recursive https://github.com/lavFACTORY/lavFACTORY-protocol
cd lavFACTORY-protocol
forge build
forge testexport ROBINHOOD_RPC_URL=https://rpc.mainnet.chain.robinhood.com
./script/check-onchain.sh