# Margin and Fee

### Margin Requirements

#### Initial Margin

To ensure commitment and cover potential fees, both parties must provide initial margin:

* **Margin Amount**: 2% of the loan amount converted to USDC value
* **Purpose**: Guarantees trade execution commitment and covers platform fees
* **Timing**: Required when placing orders in the marketplace

#### Margin Calculation

```
Initial Margin = Loan Amount × 2% (converted to USDC)
```

### Transaction Fee Calculation

When orders are successfully matched in Indication Mode, both parties are required to pay platform fees calculated using the following formula:

```
Transaction Fee = matchedAmount × matchedInterestRate × feeRate × days / 365
```

#### Fee Parameters

* **`matchedAmount`**: The final matched loan amount in the transaction
* **`matchedInterestRate`**: The agreed annual interest rate (expressed as decimal, e.g., 0.03 for 3%)
* **`feeRate`**: Platform fee rate that differs by role
* **`days`**: Number of days from transaction date to maturity date

#### Fee Rates by Role

| Role         | Fee Rate | Description                       |
| ------------ | -------- | --------------------------------- |
| **Lender**   | 0.5%     | Applied to lending transactions   |
| **Borrower** | 3%       | Applied to borrowing transactions |

### Integrated Margin and Fee Examples

#### Example 1: Short-term Loan with Margin Flow

**Initial Setup:**

* Matched Amount: $100,000 USD
* Interest Rate: 5% per annum
* Duration: 30 days

**Step 1 - Initial Margin Requirements:**

* Lender Initial Margin: $100,000 × 2% = $2,000 USDC
* Borrower Initial Margin: $100,000 × 2% = $2,000 USDC

**Step 2 - Fee Calculations:**

* Lender Fee: $100,000 × 0.05 × 0.005 × 30 / 365 = $2.05 USDC
* Borrower Fee: $100,000 × 0.05 × 0.03 × 30 / 365 = $12.33 USDC

**Step 3 - Margin Refunds (after fee transfer completion):**

* Lender Refund: $2,000 - $2.05 = $1,997.95 USDC
* Borrower Refund: $2,000 - $12.33 = $1,987.67 USDC

#### Example 2: Long-term Loan with Margin Flow

**Initial Setup:**

* Matched Amount: $500,000 USD
* Interest Rate: 8% per annum
* Duration: 180 days

**Step 1 - Initial Margin Requirements:**

* Lender Initial Margin: $500,000 × 2% = $10,000 USDC
* Borrower Initial Margin: $500,000 × 2% = $10,000 USDC

**Step 2 - Fee Calculations:**

* Lender Fee: $500,000 × 0.08 × 0.005 × 180 / 365 = $98.63 USDC
* Borrower Fee: $500,000 × 0.08 × 0.03  × 180 / 365 = $591.78 USDC

**Step 3 - Margin Refunds (after fee transfer completion):**

* Lender Refund: $10,000 - $98.63 = $9,901.37 USDC
* Borrower Refund: $10,000 - $591.78 = $9,408.22 USDC

### Fee Payment Process

#### Step-by-Step Process

1. **Order Matching**: When orders are successfully matched between counterparties
2. **Fee Calculation**: Platform automatically calculates fees based on matched terms
3. **Fee Transfer Requirement**: Users must complete fee transfer transaction to TSI
4. **Margin Refund**: Any unused portion of the margin is returned to the user's wallet **only after successful fee transfer completion**
5. **Fee Confirmation**: Users receive confirmation of fee payment and remaining balance

#### Fee Status Tracking

Users can monitor fee payment status through:

* **Real-time Updates**: Immediate notification of fee calculations and deductions
* **Transfers Section**: Complete history of margin deposits and fee payments
* **Transaction Details**: Detailed breakdown of all fee components
* **Refund Status**: Tracking of margin refunds and processing times


---

# 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://tsi-docs.tkmatrix.com/indication-mode-overview/margin-and-fee.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.
