> ## 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: Preview Earn operations

> Inspect the expected outcome of a deposit or withdrawal before submitting a transaction

Each Earn write operation has a paired quote method that returns the expected
outcome without submitting a transaction. Use quotes to display expected values
to your users before they sign.

| Operation | Quote method | Returns |
| - | - | - |
| `deposit` | `getDepositQuote` | Vault details, deposit and expected shares, share price, current APY, applicable fees, and estimated gas fees per transaction in the flow. |
| `withdraw` | `getWithdrawalQuote` | Withdrawal amount and shares to redeem, max withdrawable, share price, applicable fees, estimated gas fees, and optional warnings. |

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

## Preview a deposit

This example quotes a 10.00 USDC deposit into a vault on Arc Testnet:

<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 TypeScript theme={null}
const quote = await kit.earn.getDepositQuote({
  from: { adapter, chain: "Arc_Testnet" },
  vaultAddress: process.env.VAULT_ADDRESS as string,
  amount: "10.00",
});

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

You will see an output similar to:

```bash Shell theme={null}
{
  vaultAddress: "0x...",
  vaultName: "Steakhouse USDC",
  deposit: { symbol: "USDC", amount: "1.0" },
  expectedShares: { ... },
  sharePrice: "1.000617",
  currentApy: 0.042,
  fees: [],
  gasFees: [ ... ],
}
```

<Note>
  `gasFees` includes one entry per transaction in the deposit flow. On a
  first-time deposit, the `Deposit` entry may show `fees: null` with an allowance
  error because the approval has not been submitted yet. The `Approve` entry still
  carries a real estimate. Show a fallback such as "available after approval"
  rather than treating that as a hard failure.
</Note>

## Preview a crosschain deposit

Pass `to` and (optionally) `transferSpeed` to quote a crosschain deposit. The
returned fees break out the source-blockchain charges (such as `FORWARD` and
`PRE_FINALITY`). Same-chain quotes return `fees: []`. See
[How Earn fees work](/app-kit/concepts/earn-fees#deposit-fees) for the full fee
breakdown:

```typescript TypeScript theme={null}
const quote = await kit.earn.getDepositQuote({
  from: { adapter, chain: "Ethereum_Sepolia" },
  to: {
    chain: "Arc_Testnet",
    recipientAddress: process.env.RECIPIENT_ADDRESS as `0x${string}`,
  },
  vaultAddress: process.env.VAULT_ADDRESS as string,
  amount: "100.00",
  transferSpeed: "FAST",
});
```

`transferSpeed` accepts `"FAST"` or `"SLOW"`. FAST uses CCTP's pre-finality lane
and adds a `PRE_FINALITY` fee. SLOW uses standard finality with only the
`FORWARD` fee. Omit `transferSpeed` to use the service default.

## Preview a withdrawal

This example quotes a 10.00 USDC withdrawal from a vault on Arc Testnet:

```typescript TypeScript theme={null}
const quote = await kit.earn.getWithdrawalQuote({
  from: { adapter, chain: "Arc_Testnet" },
  vaultAddress: process.env.VAULT_ADDRESS as string,
  amount: "10.00",
});

const circleFee = quote.fees.find((fee) => fee.type === "circle");
console.log(
  circleFee
    ? `Circle fee: ${circleFee.amount} ${circleFee.symbol}`
    : "Circle fee: 0",
);
console.log(`Expected withdrawal: ${quote.withdrawal.amount}`);
console.dir(quote, { depth: null });
```

You will see an output similar to:

```bash Shell theme={null}
{
  vaultAddress: "0x...",
  vaultName: "Steakhouse USDC",
  withdrawal: { symbol: "USDC", amount: "1.0" },
  sharesToRedeem: { ... },
  sharePrice: "1.000617",
  maxWithdrawable: { ... },
  fees: [],
  gasFees: [ ... ],
}
```

When a Circle withdrawal fee applies, `fees` includes an entry with
`type: "circle"`. When no Circle fee applies, that entry is absent. Treat the
fee as 0. See [How Earn fees work](/app-kit/concepts/earn-fees#withdrawal-fee).

<Note>
  `gasFees` includes one entry per transaction in the withdrawal flow. On a
  first-time withdrawal, the `Withdraw` entry may show `fees: null` with a
  simulation error because the vault-share approval has not been submitted yet.
  The `Approve` entry still carries a real estimate. Show a fallback such as
  "available after approval" rather than treating that as a hard failure.

  Non-empty `earnKitWarnings` indicate non-blocking issues such as reduced
  liquidity. Surface them to the user before they commit to the withdrawal.
</Note>
