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

# How-to: Monitor a loan

> Read a wallet's loans and register webhooks for asynchronous health updates

Monitor a Borrow loan by reading its current state on demand or by registering a
webhook to receive updates when the loan enters a different
[health band](/app-kit/concepts/borrow-loan-health#health-factor-bands).

## Prerequisites

Before you begin, ensure that you've:

* [Installed the App Kit SDK](/app-kit/tutorials/installation) and an adapter
* Opened a loan whose owner matches the connected wallet

## Check loan state

Call `getLoans` with a wallet address and blockchain to fetch a page of the
wallet's loans (up to 100 per call), along with each loan's collateral, debt,
health factor, band, LTV, and liquidation price. Pass the returned
`pagination.pageAfter` cursor back to fetch the next page.

If you already have a `loanId`, call `kit.borrow.getPosition({ loanId })` to
read that specific loan. It returns the same shape, except the owner field is
named `wallet` instead of `walletAddress`.

```typescript TypeScript theme={null}
const { loans } = await kit.borrow.getLoans({
  walletAddress: "0x...",
  chain: "Arc_Testnet",
});

console.dir(loans, { depth: null });
```

Each `Loan` looks like:

```text theme={null}
{
  loanId: "11111111-1111-4111-8111-111111111111",
  chain: "Arc_Testnet",
  marketId: "0x...",
  walletAddress: "0x...",
  dataStatus: "READY",
  status: "active",
  collateral: { token: "cirBTC", tokenAddress: "0x...", amount: "0.05", decimals: 8 },
  borrowed: { token: "USDC", tokenAddress: "0x...", amount: "1000.03", decimals: 6 },
  principalBorrowed: { token: "USDC", tokenAddress: "0x...", amount: "1000.00", decimals: 6 },
  accruedInterest: { token: "USDC", tokenAddress: "0x...", amount: "0.03", decimals: 6 },
  borrowApy: 0.032,
  ltv: 0.42,
  healthFactor: 2.05,
  healthFactorBand: "SAFE",
  liquidationPrice: { token: "USDC", tokenAddress: "0x...", amount: "23230.00", decimals: 6 }
}
```

For what the health fields mean, see
[How loan health works](/app-kit/concepts/borrow-loan-health).

## Subscribe to health updates

Register a webhook to receive updates when a loan enters a different health
band.

### Register a webhook

Call `registerWebhook` with the loan's `loanId` and your `webhookUrl`. The
connected wallet must equal the loan's persisted owner.

```typescript TypeScript theme={null}
const result = await kit.borrow.registerWebhook({
  from: { adapter, chain: "Arc_Testnet" },
  loanId: "11111111-1111-4111-8111-111111111111",
  webhookUrl: "https://example.com/borrow-webhook",
});
```

The wallet signs the registration. There is no onchain transaction.

### Unregister a webhook

Omit `webhookUrl` (or pass `null`) to remove a loan's current webhook.

```typescript TypeScript theme={null}
await kit.borrow.registerWebhook({
  from: { adapter, chain: "Arc_Testnet" },
  loanId: "11111111-1111-4111-8111-111111111111",
});
```
