> **Can't find what you're looking for?** Use `search_docs` on the docs MCP server at `https://sdk.railnet.org/api/mcp` to find what you need.

# spawnAaveV3Vehicle

Deploys an Aave V3 vehicle via the factory contract. Requires a `WalletClient` to sign and send the transaction.

:::warning
The factory pulls an initial deposit from the caller. Approve the factory for at least
[`getInitialDepositAmount`](/actions/getInitialDepositAmount) of `asset` first, and hold at least
that much — this action sends no approval of its own.
:::

## Import

```ts
import { spawnAaveV3Vehicle } from '@railnetorg/railnet-sdk'
```

## Usage

```ts
import { createWalletClient, http } from 'viem'
import { base } from 'viem/chains'
import { spawnAaveV3Vehicle } from '@railnetorg/railnet-sdk'

const walletClient = createWalletClient({
  chain: base,
  transport: http(),
})

const hash = await spawnAaveV3Vehicle(walletClient, {
  factory: '0x1234...',
  asset: '0x6B175474E89094C44Da98b954EedeAC495271d0F',
  poolAddressesProvider: '0x2f39d218133AFaB8F2B819B1066c7E434Ad94E9e',
  accessControl: '0x...',
  queryRegistry: '0x...',
  initialExpectedSupply: 1000000000000000000n,
  account: '0xd2135CfB216b74109775236E36d4b433F1DF507B',
})
```

## Returns

`Hash`

The transaction hash.

:::info
Use [`extractAaveV3VehicleAddress`](/utilities/receiptHelpers#extractaavev3vehicleaddress) to extract the deployed Aave V3 vehicle address from the transaction receipt.
:::

## Parameters

### factory

* **Type:** `Address`

The address of the Aave V3 vehicle factory contract.

### asset

* **Type:** `Address`

The address of the underlying asset.

### poolAddressesProvider

* **Type:** `Address`

The address of the Aave V3 PoolAddressesProvider.

### accessControl

* **Type:** `Address`

The address of the access control contract.

### queryRegistry

* **Type:** `Address`

The address of the query registry contract.

### feeManager (optional)

* **Type:** `Address`

The address of the fee manager contract.

### modulesManager (optional)

* **Type:** `Address`

The address of the modules manager contract.

### forbiddenAddresses (optional)

* **Type:** `Address[]`

Optional list of addresses forbidden from interacting with the vehicle.

### initialExpectedSupply

* **Type:** `bigint`

The initial expected supply.

### querySalt

* **Type:** `Hex`

Salt for the spawn's initial query. Generate it with [`randomSalt`](/utilities/randomSalt).

### deploymentSalt

* **Type:** `Hex`

Fixes the deployed address. Generate it with [`randomSalt`](/utilities/randomSalt) and keep the value.

### account

* **Type:** `Address`

The address of the account executing the transaction.
