API & SDK
What exists
We publish no API, no SDK, no subgraph and no price feed. Read the vault contract directly with viem, ethers or your existing ERC-4626 tooling.
Lagoon publishes a TypeScript SDK (sdk-v0) and a vault-computation-cli at
github.com/hopperlabsxyz, which may save you
writing the accounting.
If you need something that does not exist, ask at contact@etesiar.com. It is a question of demand, not policy.
The async flow
Redemption mirrors this with requestRedeem, then settleRedeem, then redeem
or withdraw, with the cooldown applying before the request can be settled.
Calls
Requesting
| Call | Notes |
|---|---|
requestDeposit(uint256 assets, address controller, address owner) | Pulls assets to the silo. Requires prior ERC-20 approval. |
requestRedeem(uint256 shares, address controller, address owner) | Shares are escrowed, not yet burned. |
Checking state
| Call | Notes |
|---|---|
pendingDepositRequest(uint256 requestId, address controller) | Assets awaiting settlement |
claimableDepositRequest(uint256 requestId, address controller) | Settled, awaiting claim |
pendingRedeemRequest(...) / claimableRedeemRequest(...) | Redemption equivalents |
Claiming
| Call | Notes |
|---|---|
deposit(uint256 assets, address receiver) | Claims settled shares |
redeem(uint256 shares, address receiver, address owner) | Claims settled assets |
Reading
| Call | Notes |
|---|---|
totalAssets() | Asset decimals, 6 for USDC |
totalSupply() | Share decimals, 18 |
asset() | The underlying token |
feeRates() | (managementRate, performanceRate) in bps |
safe() | The address holding working capital |
Gotchas
Decimals. Shares are 18 decimals, USDC is 6. Share price is
totalAssets * 1e18 / totalSupply, interpreted in asset decimals. Getting this
wrong by a factor of 10^12 is the most common integration bug on these vaults.
convertToShares and convertToAssets are indicative. They use the last
settled totalAssets. Between settlements they do not reflect the live portfolio.
previewDeposit may revert. ERC-7540 vaults are permitted to revert on the
ERC-4626 preview functions, because a synchronous preview would be a lie. Handle
it.
No fresh price between settlements. A proposed NAV never auto-applies, so polling for one outside a settlement will not find it.
Requests are per controller. The controller and owner parameters let a
contract request on a user's behalf. Read the ERC-7540 spec on operator approval
before assuming your address can claim.
ABI
Take it from
github.com/hopperlabsxyz/lagoon-v0
(src/v0.6.0/ for Multistrat), from
Lagoon's documentation, or from a verified contract
on the explorer.
Machine-readable documentation
| File | Contents |
|---|---|
/llms.txt | Curated index, per the llmstxt.org convention |
/llms-full.txt | Every page concatenated in sidebar order |
/md/<page>.md | Any page as raw markdown |