> ## Documentation Index
> Fetch the complete documentation index at: https://docs.optimism.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Lend Documentation

> API reference for Actions SDK lending operations, functions, and parameters.

{/*
⚠️ WARNING: DO NOT EDIT THIS FILE DIRECTLY ⚠️

This file is auto-generated from the Actions SDK source code.

To update this documentation:
1. Bump the SDK version in package.json: pnpm add @eth-optimism/actions-sdk@latest
2. Run the generation script: pnpm prebuild

Any manual edits will be overwritten on the next generation.
*/}

## WalletLendNamespace

Wallet Lend Namespace

### Methods

| Function                                      | Description                                              |
| --------------------------------------------- | -------------------------------------------------------- |
| **[getMarkets()](#getmarkets)**               | Get all markets across all configured providers          |
| **[getMarket()](#getmarket)**                 | Get a specific market by routing to the correct provider |
| **[supportedChainIds()](#supportedchainids)** | Get supported chain IDs across all providers             |
| **[openPosition()](#openposition)**           | Open a lending position                                  |
| **[getPosition()](#getposition)**             | Get position information for this wallet                 |
| **[closePosition()](#closeposition)**         | Close a lending position (withdraw from market)          |

#### `getMarkets()`

Get all markets across all configured providers

| Parameter | Type                   | Description                   |
| --------- | ---------------------- | ----------------------------- |
| `params`  | `GetLendMarketsParams` | Optional filtering parameters |

**Returns:** Promise resolving to array of markets from all providers

<sub>[<Icon icon="github" /> Source ↗](https://github.com/ethereum-optimism/actions/blob/@eth-optimism/actions-sdk@0.4.0/packages/sdk/src/lend/namespaces/BaseLendNamespace.ts#L25)</sub>

***

#### `getMarket()`

Get a specific market by routing to the correct provider

| Parameter | Type                  | Description       |
| --------- | --------------------- | ----------------- |
| `params`  | `GetLendMarketParams` | Market identifier |

**Returns:** Promise resolving to market information

<sub>[<Icon icon="github" /> Source ↗](https://github.com/ethereum-optimism/actions/blob/@eth-optimism/actions-sdk@0.4.0/packages/sdk/src/lend/namespaces/BaseLendNamespace.ts#L37)</sub>

***

#### `supportedChainIds()`

Get supported chain IDs across all providers

**Returns:** Array of unique chain IDs supported by any provider

<sub>[<Icon icon="github" /> Source ↗](https://github.com/ethereum-optimism/actions/blob/@eth-optimism/actions-sdk@0.4.0/packages/sdk/src/lend/namespaces/BaseLendNamespace.ts#L46)</sub>

***

#### `openPosition()`

Open a lending position

| Parameter         | Type                     | Description                           |
| ----------------- | ------------------------ | ------------------------------------- |
| `params`          | `LendOpenPositionParams` | Lending position parameters           |
| `params.marketId` |                          | Market identifier to open position in |
| `params.amount`   | `number`                 | Amount to lend                        |

**Returns:** Promise resolving to transaction receipt

<sub>[<Icon icon="github" /> Source ↗](https://github.com/ethereum-optimism/actions/blob/@eth-optimism/actions-sdk@0.4.0/packages/sdk/src/lend/namespaces/WalletLendNamespace.ts#L34)</sub>

***

#### `getPosition()`

Get position information for this wallet

| Parameter         | Type                | Description                      |
| ----------------- | ------------------- | -------------------------------- |
| `params`          | `GetPositionParams` | Position query parameters        |
| `params.marketId` | `LendMarketId`      | Market identifier (required)     |
| `params.asset`    | `Asset`             | Asset filter (not yet supported) |

**Returns:** Promise resolving to position information

<sub>[<Icon icon="github" /> Source ↗](https://github.com/ethereum-optimism/actions/blob/@eth-optimism/actions-sdk@0.4.0/packages/sdk/src/lend/namespaces/WalletLendNamespace.ts#L54)</sub>

***

#### `closePosition()`

Close a lending position (withdraw from market)

| Parameter         | Type                  | Description                            |
| ----------------- | --------------------- | -------------------------------------- |
| `params`          | `ClosePositionParams` | Position closing parameters            |
| `params.marketId` | `LendMarketId`        | Market identifier to close position in |
| `params.amount`   | `number`              | Amount to withdraw                     |

**Returns:** Promise resolving to transaction receipt

<sub>[<Icon icon="github" /> Source ↗](https://github.com/ethereum-optimism/actions/blob/@eth-optimism/actions-sdk@0.4.0/packages/sdk/src/lend/namespaces/WalletLendNamespace.ts#L75)</sub>

***
