> For the complete documentation index, see [llms.txt](https://docs.idle.finance/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.idle.finance/developers/best-yield/methods/mintidletoken.md).

# mintIdleToken

This method is used to deposit money into the Idle protocol. When you call `mintIdleToken` we will transfer the amount of underlying supplied to IdleToken contract and then mint interest-bearing tokens with that amount.&#x20;

Interest-bearing tokens of each user are pooled together inside the IdleToken contract and you will then receive Idle LP tokens which represent your share of Idle pools.

**Users should call `approve` on the underlying asset used (eg. DAI) to allow IdleToken contract to spend `_amount` of tokens before calling this method.**

{% hint style="info" %}
Please note that after the first mint all subsequent ones will also send governance tokens (e.g. IDLE) to `msg.sender` (if `msg.sender` had other previously minted idleTokens in the account).
{% endhint %}

### Function

```solidity
function mintIdleToken(
    uint256 _amount, 
    bool _skipWholeRebalance, 
    address _referral
) external returns (uint256 mintedTokens);
```

### **Parameters**

<table><thead><tr><th width="277">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><code>_amount</code></td><td>The amount of underlying token to be lent</td></tr><tr><td><code>_skipWholeRebalance</code></td><td>Boolean flag. Not used anymore so can receive either true or false</td></tr><tr><td><code>_referral</code></td><td>Address for an eventual future referral program</td></tr></tbody></table>

### **Return values**

<table><thead><tr><th width="282">Value</th><th>Description</th></tr></thead><tbody><tr><td><code>mintedTokens</code></td><td>The amount of Idle LP tokens minted</td></tr></tbody></table>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.idle.finance/developers/best-yield/methods/mintidletoken.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
