# TransferAgentModule\_V5

## TransferAgentModule\_V5

This contract is an on-chain **transfer agent** for a tokenized money market fund (like FOBXX). It handles:

### Core Operations

#### 1. **Dividend Distribution**

```
dividendShares = (balance × rate) / price
```

* Positive rate → mint shares (yield)
* Negative rate → burn shares (rare negative yield)

#### 2. **Transaction Settlement**

Processes pending buy/sell orders:

* **Purchases** (AIP, cash) → mint shares: `shares = (cashAmount × scaleFactor) / NAV`
* **Liquidations** → burn shares, return cash value
* **Transfers** → move shares between accounts

#### 3. **End of Day** (combined operation)

Dividends + settlements in one call—typical daily batch.

***

### Example: FOBXX Daily Operations

**Morning:** Investors submit orders (stored in TransactionalModule)

**4PM NAV published:** $1.0002/share, daily rate = 0.00014 (5.1% APY)

**Admin calls `endOfDay`:**

```
accounts: [0xAlice, 0xBob, 0xCarol]
txIds: [pending orders to skip if needed]
date: 1736380800  // today
rate: 140000000000000  // 0.014% scaled
price: 1000200000000000000  // $1.0002 scaled
```

**For Alice (holds 10,000 shares, pending $5,000 purchase):**

1. Dividend: `10000 × rate / price` → \~1.4 shares minted
2. Settlement: `$5000 / $1.0002` → \~4,999 shares minted

***

### Admin Controls

| Function               | Purpose                             |
| ---------------------- | ----------------------------------- |
| `adjustBalance`        | Fix errors manually                 |
| `recoverAccount`       | Transfer entire balance (lost keys) |
| `recoverAsset`         | Partial recovery                    |
| `settleCXTransactions` | Cross-chain transfers               |

All functions require admin role and emit detailed events for audit trail.


---

# 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.xft.finance/bitnet/use-cases/drs/transferagentmodule_v5.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.
