# Subvault Technical Docs

### Contract Overview

**Contract Name**: `Subvault`\
**Symbol**: `STS`\
**Token Type**: ERC20 (non-transferable)\
**Primary Asset**: USDC (ERC20-compatible stablecoin)\
**Stake Token**: STS (Subvault Token Share)\
**Security Modules**: Pausable, ReentrancyGuard, Ownable, Chainalysis Oracle

### 🗃 Data Structures

```solidity
solidityCopyEditstruct StakeRecord {
    uint256 stsShares;      // Amount of STS minted during stake
    uint256 durationDays;   // Lock period (0, 90, 180)
    uint256 lockEndTime;    // Epoch time after which stake can be redeemed
    bool active;            // Active status
}
```

User stakes are stored in:

```solidity
solidityCopyEditmapping(address => StakeRecord[]) public userStakeRecords;
```

### 🧠 Business Logic Flow

#### Staking

1. User approves and calls `stake(amount, duration)`
2. STS minted and stake recorded
3. USDC transferred in

#### Unstaking

1. Lock expires → user calls `unstake(index)`
2. STS burned → USDC redeemed

#### Acquisition

1. Admin calls `withdrawForAcquisition(to, amount)`
2. Vault USDC decreases → STS dilution occurs

### 📦 Deployment Details

* **Compiler**: Solidity 0.8.17 (locked)
* **Libraries**: OpenZeppelin ERC20, SafeERC20, Pausable, ReentrancyGuard, Ownable
* **Decimals**: STS follows 18 decimals; USDC assumed to use 6
* **Chainalysis Oracle**: Must be deployed and compatible with `SanctionsList` interface


---

# 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://subunit.gitbook.io/subunit-docs/subvault/subvault-technical-docs.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.
