Skip to content

About

Permissionless factory and standard for Liquid Account Vaults (lavNFT) with dual-engine yield streaming and ERC-6551 TBA on Robinhood Chain.

Topics

Resources

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

lavFACTORY

CI

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.


Architecture: Plug-and-Play Integration

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)      │
└────────────────────────────────────────────────────────────────────────┘

Universal Protocol Integration

The core vault architecture is completely decoupled from any specific liquidity venue or launch platform:

  1. Agnostic Core Accounting: LavFactory and LiquidAccountVault contain zero hardcoded dependencies on external platforms. The vault accepts standard ERC-20 deposits, tracks virtual shares with inflation protection, and exposes permissionless syncYield() streaming.
  2. Direct Yield Inflow: Any protocol, DAO, or external contract can stream yield directly to any vault permissionlessly without deploying an adapter.
  3. 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.

Core Protocol Contracts (Robinhood Chain, chainId 4663)

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

How It Works

1. Permissionless Vault Creation

  • 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(), name lav<SYMBOL> Vault and symbol lav<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, and TOKEN is 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) == true on the factory confirms the vault was deployed by LavFactory.

2. Share Accounting & Virtual Offset

  • 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) and distributeYield(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.

3. Dual-Engine Tokenomics

Engine 1: Body Growth (Staking Token)

  • 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.

Engine 2: Yield Streaming (Reward Token)

  • 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 (periodFinish shifts 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.
Yield Inflow Paths: Adapters & Direct Top-ups

A vault receives and streams yield through two distinct mechanisms:

  • Automated Pool Routing (Adapters): Deployed adapter instances (e.g. LavAdapterPns or LavAdapterPnsEth) claim creator fees from upstream fee escrows and route them into the vault stream on each pull(). 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 LavFactory can receive arbitrary yield directly. The project team, community members, or external revenue sources (e.g. protocol fees, OTC sales, merchandise) can transfer yieldToken directly to the vault contract address and call syncYield(). 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 returns false without reverting when the adapter is not bound, when the token has no curve, or when the curve call fails, and emits CurveSweep(curve, ok); it reverts with InsufficientGas when less than SWEEP_MIN_GAS = 400 000 gas is left for the curve call, so a sweep cannot fail silently for lack of gas.

4. Claiming & Ragequit Exit

  • 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 to totalBody, 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 to 0x000000000000000000000000000000000000dEaD (or held in lockedBurn if 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, and Ragequitted reports yieldPayout = 0.
    • The position NFT is permanently burned (_burn(tokenId)).

5. ERC-6551 Token Bound Accounts (TBA)

  • Each minted position NFT automatically owns a deterministic smart contract account on Robinhood Chain.
  • Account operations are restricted to CALL (operation == 0). DELEGATECALL and CREATE are 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.

6. Vault Ownership & Descriptors

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: LavFactory does not pass a descriptor to a new vault, so a fresh vault has none and tokenURI falls back to baseURI (an empty string when both are unset). Any contract that implements the single view function tokenURI(address,uint256) can act as the card renderer, so a renderer can be deployed per project, per art or per collection. 0x061Fa7d89728C36b1B0f1928e1F8Eb6cd88A1F68 is 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.


Ecosystem Modules & Adapters

Architecture Boundaries and Scope of Adapters

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 the LavFactory.createVault() function. Yield ingestion for standalone vaults is effected by direct transfer of assets to the vault address, followed by permissionless calls to the syncYield() 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.

Fee Split & Protocol Treasury Mechanics

The protocol treasury receives 10% of all incoming creator fees regardless of vaultShareBps (with rounding dust favoring the team):

  • Vault portion: vaultShareBps is expressed in bps of trading volume (minimum MIN_VAULT_SHARE_BPS = 10, i.e. 0.10%) and cannot exceed the pool's total creator fee (totalCreatorBps). The vault receives vaultShareBps / totalCreatorBps of 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, and treasuryOwed. Any caller can settle accrued debts permissionlessly via claimVaultOwed(), claimTeamOwed(), and claimTreasuryOwed().
  • 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 maxPullPerCall per minPullInterval (both immutable). Excess fees remain safely in escrow and are paid out in subsequent pulls. Authoritative link is registered as the escrow recipient; Bound events 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 via allVaults(index) and verify any address with LavFactory.isVault(addr).

Protocol Fee Accounting & Split Breakdown

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:

$$\text{Total Fee} = 10% \times \text{Vault Share} + 10% \times \text{Team Share} = 10% \times (\text{Vault Share} + \text{Team Share}) = 10%$$

  • 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.


Compiler Settings

Setting Value
Solidity Compiler v0.8.24+commit.e11b9ed9
EVM Version shanghai
Optimizer enabled: true, runs: 200
Metadata appendCBOR: false, bytecodeHash: none

Deployments

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.

Security

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.


License

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.

Build & Test

git clone --recursive https://github.com/lavFACTORY/lavFACTORY-protocol
cd lavFACTORY-protocol
forge build
forge test

Onchain Verification

export ROBINHOOD_RPC_URL=https://rpc.mainnet.chain.robinhood.com
./script/check-onchain.sh

About

Permissionless factory and standard for Liquid Account Vaults (lavNFT) with dual-engine yield streaming and ERC-6551 TBA on Robinhood Chain.

Topics

Resources

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Used by

Contributors

Languages