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

# Uniswap pools

> Add liquidity to the USDC ↔ local-currency pools that back Pesarc corridors, via the Uniswap UI or programmatically.

Pesarc's corridors route through Uniswap-style pools that pair settlement USDC
with a local-currency stablecoin (cNGN, cGHS, cKES, …). This page shows how to
supply liquidity both from the Uniswap interface and programmatically.

<Info>
  This is advanced and involves real financial risk (impermanent loss,
  smart-contract risk). Nothing here is financial advice.
</Info>

## Before you start

<Steps>
  <Step title="Get the canonical addresses">
    Open the Pesarc app → **Developers** and copy the exact contract addresses
    for the settlement token (USDC) and the local-currency token, plus the pool
    fee tier, on your chain. Do not rely on token symbols.
  </Step>

  <Step title="Fund your wallet">
    Hold both tokens in the ratio the pool needs, plus a little of the chain's
    gas token for the add-liquidity transaction.
  </Step>

  <Step title="Pick the right chain">
    Corridors live on the hub (Arbitrum) and on native chains such as Arc and
    Celo. Provide liquidity on the chain that carries the corridor you want to
    support.
  </Step>
</Steps>

## Option A — the Uniswap app (no code)

1. Go to the Uniswap app and connect your wallet on the correct network.
2. Open **Pools → New position**.
3. Paste the **exact** USDC and local-currency token addresses from the
   Developers screen. Confirm both names resolve to what you expect.
4. Choose the **fee tier** that matches Pesarc's pool for that corridor.
5. For a concentrated (v3/v4) position, set a price range. A range **around the
   local peg** captures the most corridor volume; a wider range takes less
   management.
6. Enter deposit amounts, approve each token, and confirm **Add**.
7. You'll receive an LP position that accrues fees. Manage or withdraw it any
   time from **Pools**.

## Option B — programmatic (viem)

Add liquidity from your own service using the Uniswap position manager. The
sketch below shows the shape; fill in the **canonical addresses, fee tier and
tick range** for your chain from the Developers screen.

```ts theme={null}
import { createWalletClient, http, parseUnits } from "viem";
import { privateKeyToAccount } from "viem/accounts";

// From the Pesarc Developers screen — verify these before use.
const USDC = "0x...";            // settlement token
const LOCAL = "0x...";           // e.g. cNGN
const POSITION_MANAGER = "0x..."; // Uniswap NonfungiblePositionManager (per chain)
const FEE = 500;                 // pool fee tier (e.g. 0.05%)

const account = privateKeyToAccount(process.env.LP_PRIVATE_KEY as `0x${string}`);
const wallet = createWalletClient({ account, transport: http(process.env.RPC_URL) });

// 1) Approve both tokens to the position manager (erc20 `approve`) — omitted.
// 2) Mint a position across your chosen tick range.
await wallet.writeContract({
  address: POSITION_MANAGER,
  abi: positionManagerAbi,
  functionName: "mint",
  args: [{
    token0: USDC < LOCAL ? USDC : LOCAL,       // token0 must be the lower address
    token1: USDC < LOCAL ? LOCAL : USDC,
    fee: FEE,
    tickLower,                                  // set around the local peg
    tickUpper,
    amount0Desired: parseUnits("1000", 6),
    amount1Desired: parseUnits("1000", 6),
    amount0Min: 0n,                             // set real slippage bounds in prod
    amount1Min: 0n,
    recipient: account.address,
    deadline: BigInt(Math.floor(Date.now() / 1000) + 600),
  }],
});
```

<Warning>
  The snippet omits approvals, exact decimals, tick math and slippage protection.
  In production, compute `tickLower`/`tickUpper` from the pool's current tick, set
  real `amount*Min` slippage bounds, and simulate the transaction first. Test on a
  testnet corridor before committing mainnet funds.
</Warning>

## Managing the position

* **Fees** accrue to the position; collect them from the Uniswap app or via
  `collect` on the position manager.
* **Rebalance** a concentrated position if price drifts outside your range (it
  stops earning fees when out of range).
* **Withdraw** by decreasing liquidity and burning the position.

## Checklist

<Check>Verified both token addresses against the Developers screen.</Check>
<Check>Matched Pesarc's fee tier for the corridor.</Check>
<Check>Set a price range around the local peg (for concentrated positions).</Check>
<Check>Set real slippage bounds and simulated before sending.</Check>
<Check>Understand impermanent loss for this pair.</Check>
