In Railnet smart contracts, a Yield Source is connected via a Vehicle adapter. See Glossary for all terminology.
What you will build
A Vehicle adapter implements theIVehicle interface, which defines a universal lifecycle for deposits and redemptions through a state machine. Your adapter handles the protocol-specific logic (calling your contracts, managing positions) while Railnet handles orchestration, fee management, and access control.
The integration path depends on your protocol’s withdrawal mechanics:
- Standard vaults (immediate deposits and withdrawals) produce the simplest adapters. Examples include Aave, Compound, and standard ERC-4626 vaults.
- Custom protocols (cooldown periods, withdrawal queues, or per-address restrictions) require async adapters with keeper automation. Examples include Ethena and Syrup.
Two paths to integration
Wrap an existing vault
Connect a standard ERC-4626 vault to Railnet — the plug-and-play path for protocols with immediate deposits and withdrawals.
Build a custom adapter
Handle withdrawal delays, cooldown periods, and per-address restrictions with the async adapter pattern.
Value proposition
By connecting your yield source to Railnet, you gain access to the entire distribution network:- Instant distribution — asset managers across Railnet can allocate capital to your protocol through the standardized STEAM interface
- No bilateral integrations — one adapter serves every Strategy and Conduit on the network
- Automated operations — keepers handle routine async transitions, so your protocol works seamlessly even with cooldown periods or withdrawal queues
- Composability — your yield source can be included in multi-source Strategies alongside Aave, Morpho, tokenized bonds, and other protocols
Vehicle adapter inheritance hierarchy
Every adapter inherits from a structured hierarchy that maximizes code reuse while allowing protocol-specific specialization:- IVehicle defines the STEAM lifecycle methods:
create,resume,unlock,recover, plus view methods likestate,estimate, andtotalAssets. - BaseVehicle implements ERC20 shares, query management, the facet pattern (to stay within the 24KB bytecode limit), and reentrancy protection.
- SingleAssetBaseVehicle adds default routing, input/output validation, and share pricing math for single-asset adapters.
- Concrete Vehicles implement the actual protocol interaction logic — your code lives here.
What you implement
When you create a new adapter, you focus on:- Protocol interaction — the logic to deposit into and withdraw from your yield source.
- State transitions — defining when a query moves from
PROCESSINGtoUNLOCKING(synchronously increate()or asynchronously via a keeper). - Capacity checks — implementing
_maxDepositand_maxRedeembased on your protocol’s liquidity and constraints.
Additional resources
Set up keeper automation
Automate async adapter operations with keeper bots that monitor state and execute transitions.
Write adapter tests
Validate your adapter with Railnet’s testing framework. Inherit 100+ state machine tests automatically.
Supported protocols
See all supported DeFi protocols, native adapters, and factory addresses.
Create a Conduit
Build a Conduit on top of your yield source for direct end-user access.