> For the complete documentation index, see [llms.txt](https://docs.kpk.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.kpk.io/funds/infrastructure/architecture/onchain-accounting/balance-adapters/ethena-cooldown.md). Agents can also search and read this documentation through its [MCP server](https://docs.kpk.io/~gitbook/mcp).

# Ethena Cooldown

A plain adapter that reports the USDe owed to an account that is in the sUSDe unstaking cooldown.

A plain adapter that reports the **USDe owed to an account that is in the sUSDe unstaking cooldown**. When a holder calls `cooldownShares` or `cooldownAssets` on Ethena's `StakedUSDeV2`, the sUSDe is burned and the USDe is moved to a silo, recorded against the holder until `cooldownEnd` passes and they `unstake`.

* **Type:** Plain adapter
* **protocolSubId:** `keccak256("ethena-cooldown")`
* **Source:** `EthenaCooldownBalanceAdapter.sol`

## Positions returned

A **single** leg per account, non-zero only while an unstake is in flight. sUSDe keeps one cooldown record per account, so `isLocked` toggles on one leg rather than splitting into two:

| Leg              | PositionKind | isDebt  | isLocked | Description                                                                       |
| ---------------- | ------------ | ------- | -------- | --------------------------------------------------------------------------------- |
| Pending cooldown | `Supplied`   | `false` | toggles  | Full pending USDe; `isLocked=false` once claimable, `isLocked=true` while cooling |

The pending USDe is carried in `balanceAsset`, with `positionInstanceId = bytes32(0)`. The position is dropped if USDe is not registered in NAVCalculator, if the pending amount is zero, or if filtered out by `assetFilter`.

## Balance calculation

<figure><picture><source srcset="https://1699303810-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUsQM4bzcmOPSgkWddkeN%2Fuploads%2Fcxvjhgk8NDxcZAODFuzA%2Fadapter-ethena-cooldown_D.png?alt=media&amp;token=1cd06545-dfa9-49f7-be79-d8dfc45e8744" media="(prefers-color-scheme: dark)"><img src="https://1699303810-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUsQM4bzcmOPSgkWddkeN%2Fuploads%2FOu715ETlH8K1qT0mPD9A%2Fadapter-ethena-cooldown.png?alt=media&amp;token=b0e59b64-714d-4870-89c4-3866a5d62a75" alt="Flowchart of the Ethena Cooldown balance adapter: read calls derive position legs into PositionBalance entries."></picture><figcaption><p>Ethena Cooldown adapter: how the underlying balances reported to the NAV Calculator are derived.</p></figcaption></figure>

There is one cooldown slot per account (a new cooldown adds to it), so no enumeration is needed:

```
(cooldownEnd, underlyingAmount) = StakedUSDeV2.cooldowns(account)
amount   = underlyingAmount      // full pending USDe; zeroed by the protocol on `unstake`
isLocked = not (block.timestamp >= cooldownEnd or StakedUSDeV2.cooldownDuration() == 0)
```

A closed or never-opened cooldown reads as 0. The leg has `isLocked=false` iff `block.timestamp >= cooldownEnd` **or** `cooldownDuration() == 0` (cooldown disabled); otherwise `isLocked=true`. The adapter reads `cooldowns` first and returns before scanning the registered-asset list when nothing is pending.

## Identity

* **positionId:** `abi.encode(sUSDe)` (static; the Ethena `StakedUSDeV2` address)
* **positionKind:** `Supplied`
* **positionInstanceId:** `bytes32(0)` (one cooldown per account, no per-item handle)
* **Labels:** `positionLabels(positionId)` returns `["Unstaking Cooldown", "sUSDe"]`, shown only on the verbose reads; full breadcrumb `["Ethena", "Unstaking Cooldown", "sUSDe"]`.

The adapter emits one leg under this positionId. The reconciliation key is `keccak256(abi.encode(chainId, protocolSubId, positionId, balanceAsset.asset, positionKind))`; `isLocked` is not part of it, so the key stays stable as the flag toggles `true` to `false`.

## Constructor

```solidity
constructor(address stakedUSDe_, address underlyingToken_, address navCalculator_)
```

| Parameter          | Description                                                                                             |
| ------------------ | ------------------------------------------------------------------------------------------------------- |
| `stakedUSDe_`      | Ethena `StakedUSDeV2` (sUSDe) contract, which holds the per-account cooldown record. Must be a contract |
| `underlyingToken_` | Asset positions are denominated in: USDe (what the cooldown pays on `unstake`)                          |
| `navCalculator_`   | NAVCalculator address, used for asset-registry filtering. Must be a contract                            |

## Registration

Registered as a plain adapter with `addBalanceAdapters([adapter])` and removed with `removeBalanceAdapters([adapter])`.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.kpk.io/funds/infrastructure/architecture/onchain-accounting/balance-adapters/ethena-cooldown.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
