# How it works

### The Staking Process

1. **Stake SOMI**: Deposit your SOMI tokens into Lair's staking contract
2. **Receive stSOMI**: Get stSOMI tokens based on the current exchange rate
3. **Earn Rewards**: Your stSOMI automatically accumulates value through staking rewards
4. **Use in DeFi**: Utilize stSOMI in lending, DEXs, and other DeFi protocols
5. **Unstake Anytime**: Convert stSOMI back to SOMI instantly when needed

{% @mermaid/diagram content="flowchart LR
A\[Deposit SOMI] --> B(Mint stSOMI @ current rate)
B --> C\[Use stSOMI in DeFi]
subgraph Rewards Loop
D\[Validator Rewards Accrue] --> E\[Protocol Claims]
E --> H\[Exchange Rate Updates Upward]
end
C --> D" %}

### Exchange Rate Mechanism

The stSOMI:SOMI exchange rate starts at 1:1 and increases over time as staking rewards accumulate:

* **Initial Rate**: 1 stSOMI = 1 SOMI
* **After Rewards**: 1 stSOMI > 1 SOMI (includes accumulated rewards)
* **Compound Effect**: Rate increases continuously through auto-compounding

### Token model

* **Input:** Users deposit `SOMI`.
* **Output:** Protocol mints `stSOMI` at the **current exchange rate**.
* **Compounding:** Rewards are claimed from validators and re‑staked. This increases the **SOMI-per-stSOMI** exchange rate.

### Instant mint & redeem

Somnia’s architecture allows **instant staking & instant unstaking** for Lair’s contracts, so users get **immediate stSOMI on stake** and **immediate SOMI on redeem** (minus any applicable fees).
