# Maple \[Distribute Syrup lending yield, with queued exits handled by keepers]

:::info
Railnet connects Maple's Syrup pools through the **`SyrupVehicle`** adapter.
:::

[Maple](https://maple.finance) lends to institutional borrowers against collateral and passes the interest to lenders. Syrup is its permissionless side: deposit USDC or USDT, receive syrupUSDC or syrupUSDT, earn the pool's lending rate plus Maple's Drips incentives. Exits go through a withdrawal queue the pool delegate services as liquidity comes in, so withdrawals are not instant; the Vehicle turns that into a pending withdrawal Railnet's keepers finish.

## At a glance

| | |
|---|---|
| **Protocol** | [Maple](https://maple.finance), institutional lending (Syrup pools) |
| **Yield** | Borrower interest, through a rising pool exchange rate; Drips incentives on top |
| **Vehicle** | `SyrupVehicle` (native adapter, not upgradeable) |
| **Deposits** | Instant |
| **Withdrawals** | Queued, serviced by the pool delegate in order as liquidity allows |
| **Networks** | Ethereum mainnet |
| **Deposit assets** | USDC (syrupUSDC), USDT (syrupUSDT), one Vehicle per pool |
| **Status** | Available |

## How Railnet integrates it

The Vehicle deposits through the pool's Syrup router and holds the pool tokens, so a deposit is one instant Query. A redeem burns the Vehicle shares and the pool tokens behind them at once, clones an Account dedicated to that Query, and files a withdrawal request from it; the Query sits in `PROCESSING` until the delegate services the request, then the assets in the Account go to the receiver. Burning at request time keeps the share price exactly invariant for the holders who stay, and the per-Query Account keeps every exit separable, including the two cases Maple's queue allows: a request serviced in several steps, and one the delegate removes or parks for manual withdrawal. Keepers detect each case and finish it without the user coming back. `totalAssets()` converts the Vehicle's pool tokens at the pool's rate; `maxDeposit` follows the pool's own cap and `maxRedeem` is the holder's full balance, since filing a request needs no pool liquidity.

## Considerations

* A redeem Query stays pending until the delegate services it. Most Syrup exits settle in under a day, but Maple sets no deadline; show a pending state, not a countdown.
* The amount paid is fixed at servicing time, at the pool's exit rate then, which nets any loan impairment. Treat the preview as indicative.
* A pending exit can be cancelled while it is still wholly unserviced, returning the shares to the receiver.
* Drips incentives sit outside the share price; your Conduit decides where they go ([Rewards](/conduits/rewards)).
* Credit risk is Maple's and the pool delegate's. See [Risk management](/strategies/risk-management).

## Spawn parameters

`syrupRouter` is the only source-specific field: the Vehicle deposits through it and resolves the pool, its asset and its withdrawal manager from there. Put a Conduit on it: see [Quick start](/conduits/quick-start), then [Integrate a Conduit](/developers/integrate-conduit) for the pending state.

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

SyrupVehicle vehicle = factory.spawn(params);      // Emits SpawnedSyrupVehicle
```

## Pools

| Pool | Asset | Pool | Router |
|---|---|---|---|
| syrupUSDC | USDC | [0x80ac24aA929eaF5013f6436cdA2a7ba190f5Cc0b](https://etherscan.io/address/0x80ac24aA929eaF5013f6436cdA2a7ba190f5Cc0b) | [0x134cCaaA4F1e4552eC8aEcb9E4A2360dDcF8df76](https://etherscan.io/address/0x134cCaaA4F1e4552eC8aEcb9E4A2360dDcF8df76) |

## Next steps

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

  <Card title="Sync vs async" description="How pending Queries settle." icon="timer" to="/developers/contracts/sync-vs-async" />
</Cards>
