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

# Quickstart: Deposit into an Earn vault

> Discover available vaults and deposit USDC into one on Arc Testnet

Deposit USDC into an Earn vault on Arc Testnet. Returns are generated by the
underlying lending protocol. This quickstart uses Circle Wallets, but you can
use any compatible [adapter setup](/app-kit/tutorials/adapter-setups).

## Prerequisites

Before you begin, ensure that you've:

* Installed [Node.js v22+](https://nodejs.org/).
* Obtained an
  [API key](https://developers.circle.com/api-reference/keys#creating-an-api-key-for-developer-services)
  and
  [entity secret](https://developers.circle.com/wallets/dev-controlled/register-entity-secret)
  from the
  [Circle Console](https://developers.circle.com/w3s/circle-developer-account).
* Created a developer-controlled wallet on Arc Testnet using the Circle Console.
* Funded your Arc Testnet wallet with testnet USDC from the
  [Circle Faucet](https://faucet.circle.com/).

<Note>
  Earn operations work without an API key. For higher rate limits, pass an
  optional [API key](/app-kit/earn#api-key) as `apiKey` in the operation config.
  Keep the API key server-side. The App Kit SDK rejects an API key passed from a
  browser context.

  <Accordion title="Example: passing an API key">
    ```typescript TypeScript theme={null}
    const result = await kit.earn.deposit({
      from: { adapter, chain: "Arc_Testnet" },
      vaultAddress: "0x...",
      amount: "10.00",
      config: { apiKey: process.env.API_KEY as string },
    });
    ```
  </Accordion>
</Note>

## Step 1. Set up the project

### 1.1. Create the project and install dependencies

Create a new directory and install the App Kit SDK with the Circle Wallets
adapter and supporting tools:

```bash Shell theme={null}
# Set up your directory and initialize a Node.js project
mkdir app-kit-earn-deposit-circle-wallets
cd app-kit-earn-deposit-circle-wallets
npm init -y
npm pkg set type=module

# Set up run scripts
npm pkg set scripts.explore-vaults="tsx --env-file=.env explore-vaults.ts"
npm pkg set scripts.deposit="tsx --env-file=.env deposit.ts"

# Install runtime dependencies
npm install @circle-fin/app-kit @circle-fin/adapter-circle-wallets tsx

# Install dev dependencies
npm install --save-dev typescript @types/node
```

<Tip>
  Only need Earn and want a lighter install than the full App Kit? Install the
  standalone package instead: `@circle-fin/earn-kit`
</Tip>

### 1.2. Configure TypeScript (optional)

<Info>
  This step is optional. It helps prevent missing types in your IDE or editor.
</Info>

Create a `tsconfig.json` file configured for ESM and Node:

```bash Shell theme={null}
cat <<'EOF' > tsconfig.json
{
  "compilerOptions": {
    "target": "ESNext",
    "module": "ESNext",
    "moduleResolution": "bundler",
    "strict": true,
    "types": ["node"]
  }
}
EOF
```

### 1.3. Set environment variables

Create an `.env` file in the project directory:

```bash Shell theme={null}
touch .env
```

Add your credentials. Replace `YOUR_API_KEY` with your Circle Developer API key,
`YOUR_ENTITY_SECRET` with your entity secret:

```text .env theme={null}
CIRCLE_API_KEY=YOUR_API_KEY
CIRCLE_ENTITY_SECRET=YOUR_ENTITY_SECRET
```

<Tip>
  Edit `.env` files in your IDE or editor so credentials are not leaked to your
  shell history.
</Tip>

## Step 2. Discover available vaults

`kit.earn.exploreVaults` returns the vaults available on a chain along with each
vault's address, current APY, fees, and status. Use it to pick a vault to
deposit into.

### 2.1. Create the discovery script

Create an `explore-vaults.ts` file:

```typescript explore-vaults.ts theme={null}
import { AppKit } from "@circle-fin/app-kit";

const kit = new AppKit();

async function main() {
  const { vaults, pagination } = await kit.earn.exploreVaults({
    chain: "Arc_Testnet",
    sortBy: "apy",
  });

  console.log(`Found ${pagination.totalCount} vaults`);
  console.dir(vaults, { depth: null, colors: true });
}

void main();
```

<Tip>
  `kit.earn.exploreVaults` accepts filter, sort, and pagination parameters such as
  `protocol`, `asset`, `minApy`, `minTvl`, `sortBy`, `page`, and `pageSize`. For
  lazy iteration across all pages, use `kit.earn.exploreVaultsIterator`.
</Tip>

### 2.2. Run the discovery script

In your terminal, run:

```bash Shell theme={null}
npm run explore-vaults
```

You'll see output like:

```bash Shell theme={null}
Found 4 vaults
[
  {
    vaultAddress: '0x...',
    chain: 'Arc_Testnet',
    name: 'Steakhouse USDC',
    protocol: 'MORPHO',
    asset: 'USDC',
    assetAddress: "0x...",
    currentApy: 0.042,
    nativeApy: 0,
    vaultFee: 0,
    rewards: [],
    collateral: [],
    status: "active",
    circleGuarded: false,
    totalDeposits: "0.0",
    liquidity: "1000000.0",
  },
  ...
]
```

<Note>
  Only deposit into a vault with `status: 'active'`. A `'low_liquidity'` vault may
  not have enough liquidity for withdrawals.
</Note>

`kit.earn.exploreVaults` returns all Morpho vaults on the blockchain. No
allowlist is applied, so integrators choose any active vault to deposit into.
Crosschain deposits are an exception: gas-sponsored crosschain routes use a
manually allowlisted set of destination vaults.

### 2.3. Pick a vault

Choose a vault from the output and copy its `vaultAddress`. You'll use it in the
next step.

## Step 3. Deposit USDC

<Note>
  If your wallet is on a different blockchain than the vault, see
  [Deposit crosschain into an Earn vault](/app-kit/tutorials/earn/crosschain-deposit)
  instead.
</Note>

### 3.1. Create the deposit script

Create a `deposit.ts` file. Replace `YOUR_SELECTED_VAULT_ADDRESS` with the vault
address you copied in the previous step and `YOUR_CIRCLE_WALLET_ADDRESS` with
the address of your Circle Wallets wallet. This script deposits 10.00 USDC into
the vault:

<Note>
  Pass `amount` as a positive decimal string (for example `"10.00"`). Zero and
  negative values are rejected. For USDC and EURC, use at most 6 decimal places.
  Leading zeros and leading-dot forms (for example `"00.5"` or `".5"`) are
  rejected.
</Note>

```typescript deposit.ts theme={null}
import { AppKit } from "@circle-fin/app-kit";
import { createCircleWalletsAdapter } from "@circle-fin/adapter-circle-wallets";

const kit = new AppKit();
const amount = "10.00";
const vaultAddress = "YOUR_SELECTED_VAULT_ADDRESS";

const adapter = createCircleWalletsAdapter({
  apiKey: process.env.CIRCLE_API_KEY!,
  entitySecret: process.env.CIRCLE_ENTITY_SECRET!,
});

async function main() {
  const result = await kit.earn.deposit({
    from: {
      adapter,
      chain: "Arc_Testnet",
      address: "YOUR_CIRCLE_WALLET_ADDRESS",
    },
    vaultAddress,
    amount,
  });

  console.dir(result, { depth: null, colors: true });
}

void main();
```

<Tip>
  Preview the expected outcome of a deposit before submitting with
  [`kit.earn.getDepositQuote`](/app-kit/tutorials/earn/preview-operations#preview-a-deposit).
</Tip>

### 3.2. Run the deposit script

In your terminal, run:

```bash Shell theme={null}
npm run deposit
```

When the script completes, you'll see output like:

```bash Shell theme={null}
{
  kind: "same-chain",
  txHash: "0x...",
  explorerUrl: "https://explorer.testnet.arc.io/tx/0x...",
  vaultAddress: "0x...",
  amount: "10",
}
```

Use the `txHash` to verify the transaction on the Arc Testnet block explorer. To
confirm the vault shares credited to your wallet, see
[Check your Earn position](/app-kit/tutorials/earn/check-position). When you're
ready to redeem, see
[Withdraw from an Earn vault](/app-kit/quickstarts/earn-withdraw).
