Skip to main content

1. Architecture Overview

See How SuperEarn Works and Core components.

2. Deployed Contract Addresses

Kaia Contracts

Ethereum Contracts

Integrator note: Treat addresses as constants in production, but keep them configurable for upgrades if needed.

3. Core Interfaces

This subsection lists only the parts of each interface that integrators typically need. Full ABIs are available from the protocol’s published JSON artifacts (ISuperEarnRouter, ICooldownVault, IVault) and standard OpenZeppelin ABIs.

3.1 ISuperEarnRouter (SuperEarnRouter)

Purpose Single entrypoint for deposits and redeems. Handles the full flow between USDT, CooldownVault, and Super Vault. All user/integrator writes must go through this router; CooldownVault deposits/redeems are restricted to protocol contracts. Claims are permissionless but typically executed by keepers. Key events
Key read function
Returns the registry contract used to resolve / validate vaults. Deposit functions
  • amount – USDT amount (6 decimals).
  • minSharesOut – minimal acceptable SuperVault shares (slippage protection).
  • receiver – address that receives SuperVault shares (optional overload).
Redeem / preview functions
  • previewRedeem returns the expected underlying after cooldown, given current share price.
  • previewWithdraw returns the Super Vault shares required for a target asset amount.
  • redeem burns SuperVault shares and creates a CooldownVault redeem request; the ID is returned as requestId and also emitted in Redeemed.
Vault discovery
Returns the governance‑approved SuperVault for a given underlying token (e.g. USDT). Returns address(0) if no endorsed vault exists. Claim preview
Lets integrators check whether a cooldown request has matured and the maximum claimable amount given current CooldownVault liquidity. Note: isClaimable reflects only time-based cooldown expiry, whereas the actual claim is liquidity-gated — a fully funded request can be claimed before expiry, and a request can still wait after expiry if liquidity is insufficient. Treat the cooldown as the upper bound on normal repayment time, and confirm real claimability by simulating claim. Claims are normally executed by keepers. Notable custom errors (may appear in revert messages)
  • error InsufficientShares(uint256 shortfall); – actual yShares < minSharesOut.
  • error InsufficientAssets(uint256 shortfall); – redeem would return less than minAssetsOut.
  • error InvalidReceiver(); – zero receiver or other invalid receiver condition.
  • error InvalidPrice(); – sanity check on share price failed.
  • error Unauthorized(); – caller blocked when remoteVault gating is enabled.

3.2 ICooldownVault

Purpose A vault with cooldown‑based withdrawals and governance‑controlled risk parameters. It is the asset of the SuperVault and the place where redeem requests are tracked. Core structs
other core (standard; not repeated here)
  • asset(), totalAssets() (shares and assets are 1:1 inside CooldownVault)
  • deposit, mint, withdraw, redeem (restricted to whitelisted protocol contracts)
  • previewDeposit, previewMint, previewWithdraw, previewRedeem (all 1:1)
Integrators usually rely on these via view calls and Super Vault pricing, not for direct user flows (those go through the router); do not call deposit / redeem directly. Claims are permissionless but are typically batched by protocol keepers. Cooldown & redeem‑queue helpers
These functions let you:
  • Inspect cooldown status for a specific requestId.
  • Enumerate unclaimed requests for monitoring or backfill.
  • Track current liquidity via assetBalance() / idleBalance().
Claiming cooled‑down redemptions Implementation provides a claim(requestId, maxLossBps) function (name may vary slightly) that:
  • Transfers underlying assets to the receiver (anyone can call as long as maxLossBps is within the configured threshold, otherwise only the receiver).
  • Applies a maxLossBps bound (basis points of tolerated loss vs expected assets).
  • Emits a Claimed event on success.

3.3 IVault (SuperVault / kSuperVault)

Purpose Vault that wraps the CooldownVault shares. Users hold SuperVault shares as their EarnUSDT position. Selected view functions
Integrator usage:
  • Portfolio display: use balanceOf(user) on the Super Vault and multiply by pricePerShare() (scaled by 10 ** decimals()) to convert shares to underlying USDT notionals.
  • Price checks: totalAssets(), totalSupply(), and pricePerShare() to compute share value.

3.4 Strategies (IStrategyCooldownAware, StrategyERC7540, etc.)

Strategy interfaces define how CooldownVault interacts with external vaults (predeposit, redeem, claim, supply caps). They emit their own events (Preminted, PredepositDebtRepaid, AdjustPosition, …). Integrators do not need to call strategies directly. They are relevant only if you’re running protocol‑level analytics or risk monitoring.

4. Events to Monitor

Events are the primary way to track user‑level and system‑level changes from off‑chain services, indexers, and alerting systems.

4.1 SuperEarnRouter (ISuperEarnRouter)

From seprojectrouter-events.md:
Recommended usage:
  • Track deposits: listen to Deposited and index by sender/receiver.
  • Track redemption requests:
    • Redeemed.requestId → later join with CooldownVault’s redeem queue and Claimed events.
    • yShares / underlyingAmount for expected notional.

4.2 CooldownVault (ICooldownVault)

From cooldownvault-events.md: Core user‑facing events:
Governance / system events (for monitoring only):
Recommended usage:
  • User‑level tracking:
    • RedeemRequested + Claimed to build a full view of pending and completed withdrawals per user.
  • Risk / governance monitoring:
    • CooldownPeriodUpdated, MaxLossThresholdUpdated, and Emergency‑style events to detect parameter changes.
Standard ERC‑20 events emitted by CooldownVault:
These are useful if you want to reconstruct all share‑level movements at the CooldownVault layer.

4.3 SuperVault (IVault)

From vault-events.md: Vault‑level operations:
Strategy & governance events (aggregated behavior of all underlying strategies):
For most integrators:
  • User PnL / position tracking can be done directly from SuperVault share balances and price per share; you rarely need to decode strategy events.
  • Advanced analytics may ingest these strategy events to understand how the vault is allocating capital and generating yield.

5. ABI & Integration Checklist

For an EarnUSDT integrator, the minimum on‑chain surface you typically need is:
  1. ABIs
    • ISuperEarnRouter
    • IVault (SuperVault / kSuperVault)
    • ICooldownVault
    • Standard IERC20 / IERC20Permit where needed for USDT and share approvals
  2. Write functions you actually call
    • SuperEarnRouter.deposit(...) / depositWithPermit(...)
    • SuperEarnRouter.redeem(...)
    • (Claims on CooldownVault are permissionless but typically run by protocol keepers to bundle redemptions.)
  3. View functions you rely on
    • SuperEarnRouter.previewRedeem(...), previewDeposit(...)
    • SuperEarnRouter.endorsedVault(USDT)
    • IVault.balanceOf(user), IVault.pricePerShare()
    • ICooldownVault.redeemRequests(requestId) and getUnclaimedRedeemRequestIds(...) (for cooldown state)
  4. Events you index
    • SuperEarnRouter.Deposited / Redeemed
    • CooldownVault.RedeemRequested / Claimed / InstantRedemption
    • IVault.Deposit / Withdraw (optional, for deeper tracing)