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

# Balances and funding

> Check balances across one or many chains and fund the smart wallet through the Trails widget.

`balances` reports holdings for one chain or many. `fund` returns a Trails widget URL that lets a finance operator fund the smart wallet in fiat (card, ACH, wire) or in crypto from another wallet. The CLI never constructs funding URLs manually, `fund` always uses the official Trails surface so the recipient address is correct.

Keep at least **0.1 USDC or 0.1 POL** in the smart wallet at all times for gas. The CLI auto-selects USDC over native POL when both are available.

***

## How it works

<div style={{border:"1px solid #C8CFE1",borderRadius:"12px",overflow:"hidden",marginBottom:"24px"}}>
  <div style={{background:"linear-gradient(180deg,#EAE4F5 0%,#F6F3FB 100%)",borderBottom:"1px solid #D5C4F2",padding:"10px 16px",fontSize:"11px",fontWeight:"700",color:"#670DE5",letterSpacing:"0.06em",textTransform:"uppercase"}}>Funding flow</div>

  <div style={{borderBottom:"1px solid #EEF0F9",padding:"9px 16px",display:"flex",alignItems:"center",gap:"10px"}}>
    <span style={{color:"#929EBA",fontSize:"11px",fontWeight:"700",minWidth:"16px",textAlign:"right"}}>1</span>
    <span style={{background:"#EEF0F9",color:"#48526F",padding:"2px 8px",borderRadius:"4px",fontSize:"11px",fontWeight:"600",whiteSpace:"nowrap"}}>Operator</span>
    <span style={{color:"#670DE5",fontWeight:"700"}}>→</span>
    <span style={{background:"#EEF0F9",color:"#48526F",padding:"2px 8px",borderRadius:"4px",fontSize:"11px",fontWeight:"600",whiteSpace:"nowrap"}}>CLI</span>
    <span style={{fontFamily:"'Geist Mono',ui-monospace,monospace",fontSize:"12px",color:"#141635"}}>polygon-agent fund --wallet treasury</span>
  </div>

  <div style={{borderBottom:"1px solid #EEF0F9",padding:"9px 16px",display:"flex",alignItems:"center",gap:"10px"}}>
    <span style={{color:"#929EBA",fontSize:"11px",fontWeight:"700",minWidth:"16px",textAlign:"right"}}>2</span>
    <span style={{background:"#EEF0F9",color:"#48526F",padding:"2px 8px",borderRadius:"4px",fontSize:"11px",fontWeight:"600",whiteSpace:"nowrap"}}>CLI</span>
    <span style={{color:"#670DE5",fontWeight:"700"}}>→</span>
    <span style={{background:"#EAE4F5",color:"#670DE5",padding:"2px 8px",borderRadius:"4px",fontSize:"11px",fontWeight:"700",whiteSpace:"nowrap"}}>Trails</span>
    <span style={{fontSize:"13px",color:"#141635"}}>Returns funding URL (wallet.polygon.technology)</span>
  </div>

  <div style={{borderBottom:"1px solid #EEF0F9",padding:"9px 16px",display:"flex",alignItems:"center",gap:"10px"}}>
    <span style={{color:"#929EBA",fontSize:"11px",fontWeight:"700",minWidth:"16px",textAlign:"right"}}>3</span>
    <span style={{background:"#EEF0F9",color:"#48526F",padding:"2px 8px",borderRadius:"4px",fontSize:"11px",fontWeight:"600",whiteSpace:"nowrap"}}>Finance</span>
    <span style={{color:"#670DE5",fontWeight:"700"}}>→</span>
    <span style={{background:"#EAE4F5",color:"#670DE5",padding:"2px 8px",borderRadius:"4px",fontSize:"11px",fontWeight:"700",whiteSpace:"nowrap"}}>Trails</span>
    <span style={{fontSize:"13px",color:"#141635"}}>Pays via card, ACH, wire, or crypto</span>
  </div>

  <div style={{borderBottom:"1px solid #EEF0F9",padding:"9px 16px",display:"flex",alignItems:"center",gap:"10px"}}>
    <span style={{color:"#929EBA",fontSize:"11px",fontWeight:"700",minWidth:"16px",textAlign:"right"}}>4</span>
    <span style={{background:"#EAE4F5",color:"#670DE5",padding:"2px 8px",borderRadius:"4px",fontSize:"11px",fontWeight:"700",whiteSpace:"nowrap"}}>Trails</span>
    <span style={{color:"#670DE5",fontWeight:"700"}}>→</span>
    <span style={{background:"#EAE4F5",color:"#670DE5",padding:"2px 8px",borderRadius:"4px",fontSize:"11px",fontWeight:"700",whiteSpace:"nowrap"}}>Smart wallet</span>
    <span style={{fontSize:"13px",color:"#141635"}}>USDC lands at the wallet address</span>
  </div>

  <div style={{padding:"9px 16px",display:"flex",alignItems:"center",gap:"10px"}}>
    <span style={{color:"#929EBA",fontSize:"11px",fontWeight:"700",minWidth:"16px",textAlign:"right"}}>5</span>
    <span style={{background:"#EEF0F9",color:"#48526F",padding:"2px 8px",borderRadius:"4px",fontSize:"11px",fontWeight:"600",whiteSpace:"nowrap"}}>Operator</span>
    <span style={{color:"#670DE5",fontWeight:"700"}}>→</span>
    <span style={{background:"#EEF0F9",color:"#48526F",padding:"2px 8px",borderRadius:"4px",fontSize:"11px",fontWeight:"600",whiteSpace:"nowrap"}}>CLI</span>
    <span style={{fontFamily:"'Geist Mono',ui-monospace,monospace",fontSize:"12px",color:"#141635"}}>polygon-agent balances → confirms credit</span>
  </div>
</div>

The Trails widget is the same surface end customers use elsewhere in the Polygon stack. It handles KYC if required and supports off-ramp in the reverse direction.

***

## Commands

### balances

```bash theme={null}
polygon-agent balances --wallet main --chain polygon
polygon-agent balances --chains polygon,base,arbitrum
```

| Flag       | Default | Purpose                                                    |
| ---------- | ------- | ---------------------------------------------------------- |
| `--wallet` | `main`  | Wallet name                                                |
| `--chain`  | none    | Single chain (defaults to wallet's chain)                  |
| `--chains` | none    | Comma-separated chain list, up to 20. Overrides `--chain`. |

When `--chains` lists two or more chains, output is multi-chain JSON keyed by chain. Single-chain output is a markdown table.

### fund

```bash theme={null}
polygon-agent fund --wallet main --chain polygon
```

| Flag       | Default | Purpose             |
| ---------- | ------- | ------------------- |
| `--wallet` | `main`  | Wallet name to fund |
| `--chain`  | none    | Chain to fund on    |

Returns the Trails widget URL as a clickable link. Hand the URL to a finance approver who completes the funding step in the browser. The recipient address is always the wallet's onchain address; the CLI never accepts a manual destination here.

<Warning title="Never construct funding URLs manually">
  Always run `polygon-agent fund` to get the URL. Constructing one manually risks sending funds to the wrong address.
</Warning>

***

## Worked example

```bash theme={null}
# Get the funding URL
polygon-agent fund --wallet treasury --chain polygon
# → https://wallet.polygon.technology/fund?wallet=0xABC...&chain=polygon

# Confirm receipt after the finance team completes the on-ramp
polygon-agent balances --wallet treasury --chain polygon
# → 100.00 USDC, 0.5 POL

# Check across multiple chains
polygon-agent balances --wallet treasury --chains polygon,base,arbitrum
```

***

## Implementation

<CardGroup cols={2}>
  <Card title="Setup and wallets" icon="key" href="/payment-services/agentic-payments/cli/setup-and-wallets">
    Create the wallet before funding it.
  </Card>

  <Card title="Trails" icon="route" href="/trails/index">
    The underlying funding surface.
  </Card>

  <Card title="Transfers" icon="paper-plane" href="/payment-services/agentic-payments/cli/transfers">
    Move funds out of the wallet once they arrive.
  </Card>
</CardGroup>
