# Collateralize

## Depositing WMON as Collateral

When depositing into the WMONCToken as collateral, you're also providing liquidity for lending if lending is enabled on the specific cToken.

First, check the user's balance and ensure they have enough MON:

```javascript
const WMON = new ethers.Contract(ADDRESSES.WMON, ERC20_ABI, provider);
const balance = await WMON.balanceOf(userAddress);
const depositAmount = ethers.utils.parseEther("10"); // 10 WMON tokens

if (balance.lt(depositAmount)) {
  throw new Error("Insufficient WMON token balance");
}
```

Then approve and make the deposit by calling `deposit()` in the cToken contract, or `depositAsCollateral()` to both deposit and post as collateral all in one transaction.

Function arguments when:

calling `deposit()`:

<table><thead><tr><th width="125">Type</th><th width="110">Name</th><th>Description</th></tr></thead><tbody><tr><td>uint256</td><td>assets</td><td>The amount of underlying assets to deposit.</td></tr><tr><td>address</td><td>receiver</td><td>The account that should receive the pToken shares.</td></tr></tbody></table>

calling `depositAsCollateral()`:

<table><thead><tr><th width="119">Type</th><th width="140">Name</th><th>Description</th></tr></thead><tbody><tr><td>uint256</td><td>assets</td><td>The amount of underlying assets to deposit.</td></tr><tr><td>uint256</td><td>receiver</td><td>The account that should receive the pToken shares.</td></tr></tbody></table>

```javascript
// Approve the cToken to spend WMON
await WMON.approve(ADDRESSES.WMON_CTOKEN, depositAmount);

// Get the cToken contract
const cToken = new ethers.Contract(
  ADDRESSES.WMON_CTOKEN,
  CTOKEN_ABI,
  signer
);

// Deposit as collateral or regular deposit
if (asCollateral) {
  await cToken.depositAsCollateral(depositAmount);
} else {
  await cToken.deposit(depositAmount, userAddress);
}
```

Alternatively, if your app requires users depositing for another address, you can use `depositAsCollateralFor()`. See our [Plugin Integration](/app/developer-docs/quick-start-guides/plugin-integration.md) quickstart guide for more information.


---

# 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.curvance.com/app/developer-docs/quick-start-guides/loans-and-collateral/collateralize.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.
