# Any ERC-4626 vault \[Distribute yield from any ERC-4626 vault, no new adapter code]

:::info
Railnet connects ERC-4626 vaults through the generic **`ERC4626Vehicle`** adapter.
:::

[ERC-4626](https://eips.ethereum.org/EIPS/eip-4626) is the tokenized vault standard: one asset in, shares out, share price carries the yield. A vault qualifies when it implements the standard end to end and settles in the calling transaction; one that queues belongs on [Any ERC-7540 vault](/yield-sources/erc-7540).

## At a glance

| | |
|---|---|
| **Protocol** | [ERC-4626](https://eips.ethereum.org/EIPS/eip-4626), tokenized vault standard |
| **Yield** | Whatever the vault earns, in its asset |
| **Vehicle** | `ERC4626Vehicle`, plus the `MaxFunctionsIgnored` variant |
| **Flows** | Instant both ways, bounded by the vault's limits |
| **Deposit assets** | `vault.asset()` |
| **Status** | Factories live on Ethereum and Base |

## How Railnet integrates it

The Vehicle deposits into the vault and holds its shares against the Vehicle shares it mints; a redeem burns them, calls `redeem` and pays the receiver. Both directions are synchronous, so each Query runs `EMPTY → UNLOCKING → SETTLED` in one transaction. The standard adapter reads the vault's `maxDeposit` and `maxRedeem` and refuses anything above them, so a paused, capped or illiquid vault surfaces as a bounded amount in your interface. Vehicles are upgradeable behind a beacon.

## The MaxFunctionsIgnored variant

Some vaults do not implement `maxDeposit` and `maxRedeem` in a way the adapter can trust; Morpho Vaults v2 is the current example. For those Railnet spawns `ERC4626VehicleMaxFunctionsIgnored`, which skips the limit functions and bounds operations by account balances. That trades a cheap pre-check for reliance on the vault reverting correctly, so each candidate runs the full STEAM lifecycle on a fork first.

## Considerations

* Vault risk reaches your users directly: caps, pauses, bad debt and illiquidity pass through.
* A vault at its supply cap reports `maxDeposit` of zero; the variant has no capacity check, so sizing matters more there.
* One Vehicle tracks one vault; spreading across several means an [Allocation Strategy](/strategies/allocation).
* Rewards paid outside the share price are your Conduit's call. See [Rewards](/conduits/rewards).

## Spawn parameters

`vault` is the only source-specific field; the asset follows from `vault.asset()`, and the variant's factory takes the same parameters. The factory seeds the Vehicle from the [AssetRegistry](/developers/contracts/asset-registry), burns the seed shares and enables it in one transaction. Put a Conduit on it: [Quick start](/conduits/quick-start), [Integrate a Conduit](/developers/integrate-conduit).

```solidity [Solidity]
ERC4626VehicleFactory.SpawnParams memory params = ERC4626VehicleFactory.SpawnParams({
    vault: VAULT_ADDRESS,
    accessControl: accessControl,
    feeManager: FeeManager(address(0)),            // address(0) for none
    modulesManager: ModulesManager(address(0)),
    querySalt: bytes32(0),
    deploymentSalt: keccak256("platform-4626-v1"),
    forbiddenAddresses: new address[](0),
    initialExpectedSupply: 0.8e18,                 // 18 decimals, 1 USDC seed
    queryRegistry: queryRegistry
});

ERC4626Vehicle vehicle = factory.spawn(params);
```

Factory addresses: [Deployed contracts](/developers/contracts/deployments).

## Protocols using this adapter

| Protocol | Adapter |
|---|---|
| [Morpho Vaults v1](/yield-sources/morpho-vaults) | `ERC4626Vehicle` |
| [Morpho Vaults v2](/yield-sources/morpho-vaults) | `ERC4626VehicleMaxFunctionsIgnored` |
| [Euler Earn](/yield-sources/euler) | `ERC4626Vehicle` |

Any other ERC-4626 vault connects the same way; see [Request a protocol](/yield-sources/request-a-protocol).

## Next steps

<Cards>
  <Card title="Quick start" description="Specify your Conduit." icon="rocket" to="/conduits/quick-start" />

  <Card title="Any ERC-7540 vault" description="The asynchronous counterpart." icon="layers" to="/yield-sources/erc-7540" />
</Cards>
