Skip to main content
Your users interact with Railnet through the Conduit you deployed. The Conduit provides a simplified deposit and withdrawal interface — the same experience regardless of whether the underlying strategy uses sync protocols (Aave), async protocols (Ethena), or a mix of both.

Deposit through a Conduit

Users deposit base assets (e.g., USDC) and receive Conduit shares representing their proportional ownership.
1

Approve the Conduit

IERC20(usdc).approve(address(conduit), amount);
2

Create the deposit

Query memory query = Query({
    owner: address(conduit),
    receiver: address(conduit),
    mode: Mode.DEPOSIT,
    input: new Asset[](1),
    output: new Asset[](0),
    salt: bytes32(uint256(nonce)),
    data: ""
});
query.input[0] = Asset({
    asset: address(usdc),
    value: amount
});

// Create the deposit — auto-processes for sync Vehicles
conduit.create(query, userAddress);
For sync underlying strategies, the deposit settles in the same transaction — the user receives shares immediately.For async underlying strategies, the query enters PROCESSING. A keeper will call process() automatically when the operation is ready to settle.

Withdraw through a Conduit

Users return Conduit shares and receive base assets.
1

Approve Conduit shares

conduit.approve(address(conduit), shareAmount);
2

Create the withdrawal

Query memory query = Query({
    owner: address(conduit),
    receiver: address(conduit),
    mode: Mode.REDEEM,
    input: new Asset[](1),
    output: new Asset[](0),
    salt: bytes32(uint256(nonce)),
    data: ""
});
query.input[0] = Asset({
    asset: address(conduit),
    value: shareAmount
});

// Create the withdrawal — auto-processes for sync Vehicles
conduit.create(query, userAddress);
Same behavior as deposits: sync strategies settle immediately, async strategies are settled automatically by keepers.

Automated settlement

For async operations, keepers call process() on your Conduit’s active queries when the underlying protocol is ready to settle. This means:
  • Your platform doesn’t need to build async monitoring infrastructure
  • Users never need to return to manually claim after cooldown periods
  • The experience is the same for sync and async strategies from the user’s perspective

Keeper setup

How keeper automation works and how to configure it.

Preview operations

Use estimate() to preview deposits and withdrawals including fees before executing:
// Preview: how many shares will the user get for 100 USDC?
Asset[] memory input = new Asset[](1);
input[0] = Asset({asset: address(usdc), value: 100e6});

Asset[] memory estimated = conduit.estimate(
    input,
    Mode.DEPOSIT,
    EstimationType.OUTPUT
);
// estimated[0].value = shares the user will receive (after fees)
estimate() includes fees and slippage. For pure share-to-asset conversion without fees, use convert() instead.