# LiquidityGauge

When an LP token is whitelisted on `LendingLedger`, a `LiquidityGauge` wrapper is automatically created. This simple wrapper calls `sync_ledger` in the `_afterTokenTransfer` hook to ensure eligible LP positions are continuously tracked by the protocol.

### Depositing <a href="#claiming" id="claiming"></a>

To deposit LP tokens into a wrapper, call the `depositUnderlying(uint256 _amount)` method. The wrapper must be approved to spend the underlying token.

**ethers.js**

```
await LiquidityGauge.depositUnderlying(10000000000000000000) // Deposit 10 LP tokens
```

**foundry**

```
cast send --ledger 0x... "depositUnderlying(uint256)" 10000000000000000000
```

### Withdrawing <a href="#claiming" id="claiming"></a>

To withdraw LP tokens from a wrapper, call the `withdrawUnderlying(uint256 _amount)` method.

**ethers.js**

```
await LiquidityGauge.withdrawUnderlying(10000000000000000000) // Withdraw 10 LP tokens
```

**foundry**

```
cast send --ledger 0x... "withdrawUnderlying(uint256)" 10000000000000000000
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.canto.io/technical-reference/liquidity-coordinator/liquiditygauge.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
