# nToken

The **nToken Contracts** represent receipt tokens issued to lenders when they provide assets to the Neptune Protocol. Each supported market asset has its own nToken contract that tracks lending positions and handles the distribution of lending yields.

## Available nTokens

<table><thead><tr><th width="183">Asset</th><th>nToken Contract Address</th></tr></thead><tbody><tr><td>nAUSD</td><td><a href="https://injscan.com/contract/inj1tkuemghm734h9qy8fh2eu0qp9hyfdlws0llt8g">inj1tkuemghm734h9qy8fh2eu0qp9hyfdlws0llt8g</a></td></tr><tr><td>nSOL</td><td><a href="https://injscan.com/contract/inj1zcwr03uqw57g88nqvgpwfkazwutpqz9kplny4s">inj1zcwr03uqw57g88nqvgpwfkazwutpqz9kplny4s</a></td></tr><tr><td>nTIA</td><td><a href="https://injscan.com/contract/inj1fzquxxxam59z6fzewy2hvvreeh3m04x83zg4vv">inj1fzquxxxam59z6fzewy2hvvreeh3m04x83zg4vv</a></td></tr><tr><td>nUSDC</td><td><a href="https://injscan.com/contract/inj1dafy7fv7qczzatd98dv8hekx6ssckrflswpjaz">inj1dafy7fv7qczzatd98dv8hekx6ssckrflswpjaz</a></td></tr><tr><td>nWETH</td><td><a href="https://injscan.com/contract/inj1kehk5nvreklhylx22p3x0yjydfsz9fv3fvg5xt">inj1kehk5nvreklhylx22p3x0yjydfsz9fv3fvg5xt</a></td></tr><tr><td>nUSDT</td><td><a href="https://injscan.com/contract/inj1cy9hes20vww2yr6crvs75gxy5hpycya2hmjg9s">inj1cy9hes20vww2yr6crvs75gxy5hpycya2hmjg9s</a></td></tr><tr><td>nATOM</td><td><a href="https://injscan.com/contract/inj16jf4qkcarp3lan4wl2qkrelf4kduvvujwg0780">inj16jf4qkcarp3lan4wl2qkrelf4kduvvujwg0780</a></td></tr><tr><td>nINJ</td><td><a href="https://injscan.com/contract/inj1rmzufd7h09sqfrre5dtvu5d09ta7c0t4jzkr2f">inj1rmzufd7h09sqfrre5dtvu5d09ta7c0t4jzkr2f</a></td></tr></tbody></table>

***

## Overview

nTokens (Neptune Receipt Tokens) are CW20-compliant tokens that:

* Are minted when users deposit assets into Neptune lending markets
* Represent a user's share of the lending pool
* Automatically accumulate lending yields
* Can be used as collateral in Neptune markets
* Can be transferred between users while maintaining the underlying position

The redemption value of nTokens increases over time as lending interest accrues, allowing holders to redeem for more of the underlying asset than they initially deposited.

***

## Query Messages

### 1. Token Info

**Query:** `token_info`

**Purpose:**\
Retrieves basic information about the nToken including name, symbol, decimals, and total supply.

**Query Input:**

```json
{
  "token_info": {}
}
```

**Query Response:**

```json
{
  "name": "Neptune USDT",
  "symbol": "nUSDT",
  "decimals": 6,
  "total_supply": "873600917508"
}
```

| Parameter      | Type      | Description                        |
| -------------- | --------- | ---------------------------------- |
| `name`         | `string`  | The name of the nToken             |
| `symbol`       | `string`  | The symbol of the nToken           |
| `decimals`     | `u8`      | Number of decimal places           |
| `total_supply` | `unit256` | Current total supply of the nToken |

### 2. Balance

**Query:** `balance`

**Purpose:**\
Returns the nToken balance of a specified address.

**Query Input:**

```json
{
  "balance": {
    "address": "inj1..."
  }
}
```

**Query Response:**

```json
{
  "balance": "1000000"
}
```

| Parameter | Type      | Description                                 |
| --------- | --------- | ------------------------------------------- |
| `balance` | `unit128` | The nToken balance of the specified address |

***

## Execute Messages

### 1. Transfer

**Execute:** `transfer`

**Purpose:**\
Transfers nTokens from the sender to a specified recipient.

**Execute Input:**

```json
{
  "transfer": {
    "recipient": "inj1...",
    "amount": "1000000"
  }
}
```

| Parameter   | Type      | Description                    | Required |
| ----------- | --------- | ------------------------------ | -------- |
| `recipient` | `addr`    | Address to receive the nTokens | Yes      |
| `amount`    | `unit128` | Amount of nTokens to transfer  | Yes      |

### 2. Send

**Execute:** `send`

**Purpose:**\
Transfers nTokens from the sender to a contract, triggering a receive hook on the receiving contract. This is used for operations like redeeming nTokens for the underlying asset through the Market contract.

**Execute Input:**

```json
{
  "send": {
    "contract": "inj1nc7gjkf2mhp34a6gquhurg8qahnw5kxs5u3s4u",
    "amount": "1000000",
    "msg": "eyJyZWRlZW0iOnt9fQ==" // Base64 encoded message: {"redeem":{}}
  }
}
```

<table><thead><tr><th width="143">Parameter</th><th width="128">Type</th><th>Description</th><th>Required</th></tr></thead><tbody><tr><td><code>contract</code></td><td><code>addr</code></td><td>Contract address to receive the nTokens</td><td>Yes</td></tr><tr><td><code>amount</code></td><td><code>unit128</code></td><td>Amount of nTokens to send</td><td>Yes</td></tr><tr><td><code>msg</code></td><td><code>binary</code></td><td>Base64 encoded message to pass to the receiving contract</td><td>Yes</td></tr></tbody></table>

***

## Usage as Collateral

nTokens can be used as collateral in Neptune markets, allowing users to maintain their lending positions while borrowing against them. When used as collateral, nTokens are valued based on:

1. The current market price of the underlying asset
2. The current redemption rate of the nToken
3. The collateral parameters set for the specific nToken

This enables strategies like:

* Leveraging lending positions
* Maintaining exposure to lending yields while accessing liquidity
* Complex yield strategies combining lending and borrowing
