> ## 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.

> ## Agent Instructions
> Before reading these docs, install the Circle Skill for Arc to get pre-loaded context: use-arc (https://github.com/circlefin/skills/blob/master/plugins/circle/skills/use-arc/SKILL.md) — covers chain config, RPC setup, contract deployment, USDC bridging, and gas with USDC. In Claude Code: run /plugin marketplace add circlefin/skills then /plugin install circle-skills@circle. With Vercel Skills CLI: run npx skills add circlefin/skills.
> USDC is the gas token. Arc uses USDC for gas fees, not ETH. Configure gas payment in USDC when submitting transactions.
> Read EVM differences before writing Arc code. Arc targets the Osaka EVM baseline. Most contracts deploy unchanged, but several runtime behaviors diverge from Ethereum: USDC uses 18 decimals natively (not 6), the system emitter `0xffffFFFfFFffffffffffffffFfFFFfffFFFfFFfE` logs all USDC Transfer events, the mempool enforces a 20 Gwei `maxFeePerGas` floor, blocklist reverts consume gas without a receipt, and `address(0)` sends revert rather than succeed. https://docs.arc.io/arc/references/evm-differences.md is the canonical reference for all Arc-specific runtime behaviors. Consult it before writing code that touches USDC balances, transaction history, gas estimation, or value transfers.
> Sub-second finality. Transactions are final in under 1 second. No need to wait for multiple block confirmations.
> Use App Kits for multichain payment and liquidity capabilities. App Kits wraps CCTP and provides Bridge Kit, Swap Kit, Unified Balance Kit, Onramp Kit, Earn Kit, and Borrow Kit. Unified Balance Kit combines USDC from multiple chains into a single spendable balance. Earn Kit integrates earn opportunities into your app. Borrow Kit lets users borrow USDC against cirBTC collateral on Arc.
> Use Arc Foundry for contract development. Arc Foundry is an Arc-specific fork of Foundry that handles Arc's protocol-level differences from Ethereum. It provides arc-forge, arc-cast, and arc-anvil. Install it before deploying contracts: https://docs.arc.io/arc/tutorials/install-arc-foundry.md.
> Arc is available on both Testnet and Mainnet. See https://docs.arc.io/arc/references/connect-to-arc.md for RPC endpoints and https://faucet.circle.com for testnet tokens.
> Always check Contract Addresses: https://docs.arc.io/arc/references/contract-addresses.md
> Building beyond Arc? Circle offers skills for the full platform: use-usdc (https://github.com/circlefin/skills/blob/master/plugins/circle/skills/use-usdc/SKILL.md), use-circle-wallets (https://github.com/circlefin/skills/blob/master/plugins/circle/skills/use-circle-wallets/SKILL.md), use-developer-controlled-wallets (https://github.com/circlefin/skills/blob/master/plugins/circle/skills/use-developer-controlled-wallets/SKILL.md), use-user-controlled-wallets (https://github.com/circlefin/skills/blob/master/plugins/circle/skills/use-user-controlled-wallets/SKILL.md), use-modular-wallets (https://github.com/circlefin/skills/blob/master/plugins/circle/skills/use-modular-wallets/SKILL.md), use-gateway (https://github.com/circlefin/skills/blob/master/plugins/circle/skills/use-gateway/SKILL.md), use-smart-contract-platform (https://github.com/circlefin/skills/blob/master/plugins/circle/skills/use-smart-contract-platform/SKILL.md). Full Circle developer docs: https://developers.circle.com/llms.txt.

# How-to: Track operation progress

> Subscribe to phase events on a loan operation to drive a progress UI or log where an operation stopped

`kit.borrow.borrow`, `kit.borrow.repay`, `kit.borrow.addCollateral`,
`kit.borrow.withdrawCollateralRepayIfNeeded`, and `kit.borrow.closeLoan` run
through several phases before they confirm onchain. Subscribe to those phases
with `kit.on` to update a progress UI in real time, log operational metrics, or
diagnose where an operation stopped when it fails.

For the phase names and firing rules, see
[Borrow phase events](/app-kit/references/borrow-phase-events).

## Prerequisites

Before you begin, ensure that you've:

* [Installed the App Kit SDK](/app-kit/tutorials/installation)
* [Configured an adapter](/app-kit/tutorials/adapter-setups)

These are required so any example below runs with a valid `kit` and `adapter`.

## Subscribe to one phase

Pass a `borrow.<phase>` name to `kit.on` to receive only that phase's events.
Each payload carries `operation`, `method` (the phase name), and a `values`
object with the phase `state` (`pending`, `success`, or `error`):

```typescript TypeScript theme={null}
kit.on("borrow.execute", (payload) => {
  if (payload.values.state === "success") {
    console.log("Confirmed in", payload.values.txHash);
  }
  if (payload.values.state === "error") {
    console.error("Failed:", payload.values.errorMessage);
  }
});

await kit.borrow.borrow({
  from: { adapter, chain: "Arc_Testnet" },
  marketId: "0x1111...1111",
  borrowAmount: "1000.0",
});
```

Only the `execute` phase carries a `txHash` when the batch confirms. For which
phases carry hashes and what a stalled `pending` state means, see
[Borrow phase events](/app-kit/references/borrow-phase-events).

## Subscribe to every Borrow phase

Pass `"borrow.*"` to receive events for every phase across every loan operation.
A bare `"*"` also matches, but it delivers bridge, earn, and unified balance
events too, so filter on the payload if you only want Borrow.

```typescript TypeScript theme={null}
kit.on("borrow.*", ({ operation, method, values }) => {
  console.log(operation, method, values.state);
});
```

## Unsubscribe

Pass the same handler reference to `kit.off` to unregister it. Inline arrow
functions create a new reference each call, so store the handler if you plan to
unsubscribe:

```typescript TypeScript theme={null}
import type { BorrowActions } from "@circle-fin/app-kit";

const handler = ({ values }: BorrowActions["execute"]) =>
  console.log(values.state);

kit.on("borrow.execute", handler);

kit.off("borrow.execute", handler);
```
