Lista DAO 백서

Lista DAO

원문

bitpro가 원문에서 글자만 모은 내용이에요. 표·그림·수식은 빠지거나 깨질 수 있어요. 전체 53쪽 중 29쪽

nding-api/market) for what each maps to. *** ## Signature-gated endpoints A small number of endpoints return address-specific data (the emission / reward **merkle proofs**) and require the caller to prove control of the address. These endpoints take three additional query parameters: | Parameter | Type | Required | Description | | ----------- | ------ | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `address` | string | Yes | The address the data is being requested for. | | `signature` | string | Yes | A wallet signature over `message`. | | `message` | string | Yes | The signed message. Must be **exactly two lines**: an ISO-8601 UTC timestamp (`YYYY-MM-DDTHH:MM:SSZ`, optional `.SSS` milliseconds, literal `Z` only), then the literal line `Thank you for your support of listaDAO.` The timestamp must be no older than **7 days**. A message that does not match returns envelope code `1005` over HTTP 400. | | `type` | string | No | `safe` to validate as an ERC-1271 contract wallet (e.g. Safe); omitted/other validates as a standard EOA signature. | How verification works: * **EOA (default):** the signer is recovered from `signature` over `message` and must equal `address` (case-insensitive). * **`type=safe`:** the signature is validated against the address as an ERC-1271 contract wallet. * An **invalid signature** returns code `1005`; a **message older than 7 days** returns code `401`. This is a standard wallet-signature challenge — **no server-side secret, API key, or token is involved.** The signature-gated endpoints are documented in [Positions, Liquidation & Emission](/for-developer/services/lending-api/position-liquidation-emission#4-emission-rewards--merkle-proofs). *** ## Caching and freshness Most list and detail endpoints are served from a **server-side cache**. Two consequences for integrators: * **Values reflect the last sync, not live chain state.** List and detail responses (liquidity, rates, totals, prices, APYs) are as of the most recent indexer sync and can lag the chain. Treat them as display/decision data, not as a substitute for reading the chain at transaction time. * **For values you will sign a transaction against, read on-chain.** Build transactions from immutable market parameters — use `GET /api/moolah/allMarkets` (raw on-chain `MarketParams`-equivalent fields: `loanToken`, `collateralToken`, `oracle`, `irm`, `lltv`) and read live totals/prices directly from the Moolah contract. See [Market API](/for-developer/services/lending-api/market) and the [Lista Lending Smart Contract](/for-developer/lista-lending/smart-contract) reference. USD and asset amounts are returned as fixed-point **decimal strings** unless an endpoint notes otherwise; fields whose name ends in `Wei` carry the raw on-chain integer. Parse amounts with a big-number library rather than native floats. *** ## See also * [Vault](/for-developer/services/lending-api/vault) — vault listing and detail endpoints. * [Integration Patterns](/for-developer/lista-lending/integration-patterns) — end-to-end integration flows. # Overall A single protocol-wide summary of Lista Lending (Moolah): aggregate deposits, borrows, and collateral, the best vault APY, the lowest market borrow rate, and the top loan/collateral tokens by size. All paths are under **Base URL** `/api/moolah`. The response is a pre-computed snapshot served from a server-side cache and refreshed periodically by a background job, so values reflect the last sync rather than live on-chain state. Use the `updateAt` timestamp to judge freshness. Most USD amounts are returned as fixed-point decimal strings (18 decimal places) to avoid floating-point loss — but not all: the field tables below mark the ones typed `number`. Check the type per field rather than assuming strings throughout. *** ## GET /api/moolah/overall Returns the protocol snapshot. This endpoint takes **no query parameters**. ### Response | Field | Type | Description | | ------------------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `totalBorrowed` | string | Total borrowed across all markets, in USD (fixed-point, 18 decimals). | | `totalCollateral` | string | Total collateral posted across all markets, in USD (fixed-point, 18 decimals). | | `totalDeposits` | string | Total assets deposited across all vaults, in USD (fixed-point, 18 decimals). | | `maxVaultApy` | string | Highest **combined** APY (base plus emission) among vaults holding assets (fixed-point, 18 decimals; e.g. `0.05` = 5%). | | `minBorrowRate` | string | Lowest **net** borrow rate (borrow rate minus borrow-emission APY) among markets with non-zero borrows. Can be **negative** when emissions exceed the borrow rate (fixed-point, 18 decimals). | | `loanTokens` | array | Top loan/deposit tokens by deposited USD, sorted descending (up to 10). See below. | | `collateralTokens` | array | Top collateral tokens by available liquidity in USD, sorted descending (up to 10). See below. | | `details` | object | Per-chain breakdown of the same aggregates, keyed by chain (`bsc`, `ethereum`). | | `activeMarketCount` | number | Number of active markets. | | `lpTokens` | array | StableSwap LP tokens accepted as collateral — `tokenSymbol`, `tokenAddress`, `tokenIcon`, `tvlInUSD`. | | `smartLending` | object | Smart Lending sub-totals. | | `bStock` | object | Tokenized-equity (bStock) sub-totals. A **breakout** of markets that are already counted in the aggregates above, not a separate bucket. See below. | | `updateAt` | number | Unix timestamp (seconds) of the snapshot. | Items in both arrays carry `tokenAddress` (lowercase), `tokenSymbol` and `tokenIcon`, plus one USD figure typed **`number`, not a string**: `amountInUSD` (deposited) on `loanTokens`, `liquidityInUSD` (available loan-side liquidity in markets using that collateral) on `collateralTokens`. ### `bStock` object bStock markets are **included** in `totalBorrowed`, `totalCollateral` and the `collateralTokens` list; this object tallies the same markets again so they can be shown on their own. **Do not add `bStock.totalBorrowed` / `bStock.totalCollateral` to the protocol-wide totals** — you would double-count. `totalDeposits` is a vault-level aggregate and has no bStock counterpart. The shape is stable, and present even before the snapshot is populated. | Field | Type | Description | | ---------------------------------------------------- | ------ | ---------------------------------------------------------------------------------------------------------- | | `totalCollateral`, `totalBorrowed`, `totalAvailable` | string | bStock collateral posted, borrowed against it, and available liquidity — all USD, fixed-point 18 decimals. | | `marketCount`, `collateralTokenCount` | number | bStock markets, and distinct bStock collateral tokens. | | `loanTokens`, `topCollateralTokens` | array | Loan tokens available against bStock collateral, and the top bStock collaterals. | When the snapshot has not yet been populated, the endpoint returns a zeroed object: all amount/rate fields as `"0"`, `loanTokens` and `collateralTokens` as empty arrays, `updateAt` as `0`, and `bStock` present with its counts at `0`, its amounts at `"0"` and its arrays empty. ### Example ```bash curl https://<api-host>/api/moolah/overall ``` ```json { "totalBorrowed": "12345678.900000000000000000", "totalCollateral": "23456789.000000000000000000", "totalDeposits": "34567890.100000000000000000", "maxVaultApy": "0.084000000000000000", "minBorrowRate": "0.021000000000000000", "loanTokens": [ { "tokenAddress": "0x...", "tokenSymbol": "USD1", "tokenIcon": "https://...", "amountInUSD": 20000000.0 } ], "collateralTokens": [ { "tokenSymbol": "BTCB", "tokenAddress": "0x...", "tokenIcon": "https://...", "liquidityInUSD": 8000000.0 } ], "updateAt": 1730000000 } ``` > Values above are illustrative. Token addresses are returned by the API; do not hard-code them. *** ## Related * [Vault API](/for-developer/services/lending-api/vault) — per-vault list, detail, APY/deposit history, allocation. * [Market API](/for-developer/services/lending-api/market) — per-market data, borrow rates, search. * [Position, Liquidation, Emission](/for-developer/services/lending-api/position-liquidation-emission) — user-level data. # Vault A vault is an aggregate contract where suppliers deposit a single loan asset; a curator allocates that liquidity across multiple lending [markets](/for-developer/services/lending-api/market). The Vault API exposes the vault list, per-vault detail, historical deposit/APY snapshots, and the per-market allocation breakdown. All paths are under **Base URL** `/api/moolah`. > **Chain selector.** Endpoints that span chains take a **string** `chain` parameter — `bsc`, `bscTest`, or `ethereum` — **not** a numeric chain ID. `/vault/list` accepts a comma-separated list (e.g. `chain=bsc,ethereum`); when omitted it defaults to the live network. Detail and history endpoints resolve the chain from the vault `address` and take no `chain` parameter. > **List conventions.** Paginated list endpoints sort with the pair `sort` (a field key from the whitelist below) + `order` (`asc` | `desc`, default `desc`). `pageSize` defaults to `10` and is capped at `50`; `page` is 1-based. An unrecognized `sort` falls back to the endpoint default. *** ## 1. Vault list ### GET /api/moolah/vault/list Paginated list of vaults with filtering and sorting. #### Query parameters | Parameter | Type | Required | Description | | ---------- | --------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `chain` | string | No | `bsc` \| `bscTest` \| `ethereum`. Comma-separated for multiple (e.g. `bsc,ethereum`). Defaults to the live network. | | `page` | number | No | 1-based page number. Default `1`. | | `pageSize` | number | No | Items per page. Default `10`, max `50` (values above 50 are clamped). | | `assets` | string\[] | No | Filter by deposit-asset **symbol**. Must arrive as an array: repeat the key (`assets=USD1&assets=WBNB`), or use the bracket form for one value (`assets[]=USD1`). A single bare `assets=USD1` is unsupported — the query builder throws, so a cold cache returns HTTP `500`; a warm cache (see [Conventions](/for-developer/services/lending-api/conventions)) can mask this by returning a stale cached response instead. | | `curators` | string\[] | No | Filter by curator **name** (e.g. `Lista DAO`), matched exactly — an address matches nothing. **Send it repeated** (`?curators=A&curators=B`): a single un-repeated value arrives as a string and the query builder fails on it — unsupported, returning HTTP `500` on a cold cache (a warm cache can mask this instead). | | `keyword` | string | No | Free-text search over vault name/keywords. Max 50 chars; ignored if empty. | | `sort` | string | No | Sort field key — one of `deposits`, `apy`, `utilization`. Unknown values fall back to `deposits`. | | `order` | string | No | `asc` or `desc`. Default `desc`. | | `zone` | number | No | Zone (segment) filter. Default `0`. | > Results are grouped by a Lista-assigned display order before the requested `sort` / `order` is applied. #### Response | Field | Type | Description | | ------- | ------ | --------------------------------------- | | `total` | number | Total matching vaults (for pagination). | | `list` | array | Vault summary objects. | **Item in `list`:** | Field | Type | Description | | ----------------------------------------------------------------------------- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `address` | string | Vault contract address (**lower-cased**). | | `emissionEnabled` | number | `1` when reward emissions are active for this vault, `0` when not. Serialized as an integer, not a JSON boolean. | | `emissionDetail` | object | Reward breakdown keyed by token symbol — `{ [symbol]: { apy, total, icon } }`, or `{}` when there is none. Note `/vault/allocation` returns `emissionDetail` as an **array**, not an object keyed by symbol. | | `displayDecimal` | number | Decimals to use when displaying amounts. Serialized as a JSON number. | | `utilization` | string | Fraction of deposits currently lent out, clamped to `[0, 1]` (18-decimal string). | | `collaterals` | array | Collateral assets reachable through this vault's markets (`{ id, name, icon, loanSymbol, allocation }`). | | `apy`, `emissionApy`, `deposits`, `depositsUsd`, `zone`, `chain` | string / number | Headline figures, self-describing. `chain` is `bsc` \| `ethereum` \| `bscTest`. | | `asset`, `assetSymbol`, `name`, `icon`, `assetIcon`, `curator`, `curatorIcon` | string | Deposit-asset address/symbol plus display copy and assets. | *** ## 2. Vault detail ### GET /api/moolah/vault/info Full details for a single vault, including its curator metadata and the collateral markets it allocates to. #### Query parameters | Parameter | Type | Required | Description | | --------- | ------ | -------- | -------------------------------------------------------------------- | | `address` | string | Yes | Vault contract address. The chain is resolved from the vault record. | #### Response | Field | Type | Description | | --------------------------------------------------------------------------------------------------------------------- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `emissionEnabled` | number | `1` when reward emissions are active, `0` when not. Serialized as an integer, not a JSON boolean. | | `emissionDetail` | object | Reward breakdown keyed by token symbol — `{ [symbol]: { apy, total, icon } }`, or `{}` when there is none. | | `assetPrice` | string | USD price of the deposit asset, **8-decimal string**. | | `displayDecimal` | number | Decimals to use when displaying amounts. Serialized as a JSON number. | | `liquidity` | string | Idle (un-allocated) liquidity in the vault. | | `address`, `asset`, `assetSymbol`, `deposits`, `apy`, `emissionApy` | string | Vault and deposit-asset identity plus headline figures. | | `name`, `icon`, `assetIcon`, `description`, `descriptionZh`, `curator`, `curatorIcon`, `curatorDesc`, `curatorDescZh` | string | Display copy and assets; the `*Zh` fields are the Chinese variants. | | `utilization` | string | Fraction of deposits currently lent out (**18-decimal string**). Unlike `/vault/list`'s `utilization`, this one is not clamped to `[0, 1]` server-side — treat a value outside that range as a signal to re-check the vault, not a parsing error. | | `collaterals` | array | Markets the vault supplies to — each `{ id, collateral, name, icon }` where `id` is the market ID and `collateral` the collateral token address. | | `curatorX`, `curatorUrl`, `styleType` | string / number | Curator X handle and website, and a UI style hint (defaults to `1`). | | `createAt`, `zone`, `chain`, `status` | string / number | Creation timestamp, zone, chain, and the vault status code. | > An unknown `address` returns an empty object `{}`. *** ## 3. Vault deposit / APY history ### GET /api/moolah/vault/deposit/history ### GET /api/moolah/vault/apy/history Daily snapshots of a vault's total deposits and APY over a time range. Both endpoints share the same handler and return the same shape; `/vault/apy/history` is an alias of `/vault/deposit/history`. #### Query parameters | Parameter | Type | Required | Description | | ----------- | ------ | -------- | -------------------------------------------------------------- | | `address` | string | Yes | Vault contract address. | | `startTime` | number | No\* | Range start, UNIX timestamp in **seconds** (UTC day boundary). | | `endTime` | number | No\* | Range end, UNIX timestamp in **seconds** (UTC day boundary). | > \* Syntactically optional, but the two behave differently when omitted, and neither raises an error. Omitting `startTime` (or both) returns an **empty array**. Omitting `endTime` returns the **entire history from `startTime` onward** — the bound is compared as a string, and the placeholder it degrades to sorts above every real date. Pass both explicitly. #### Response Array of daily snapshot objects, ordered ascending by date: | Field | Type | Description | | ---------------- | ------ | ------------------------------------------------- | | `chartTime` | number | Start-of-day UNIX timestamp (seconds). | | `apy` | string | Base supply APY for that day. | | `emissionApy` | string | Reward/emission APY for that day. | | `totalAssets` | string | Total assets in the vault that day (token units). | | `totalAssetsUsd` | string | Total assets valued in USD that day. | *** ## 4. Vault allocation ### GET /api/moolah/vault/allocation > The response also includes a synthetic **"Idle Market"** row representing un-allocated liquidity. It ignores the `keyword` and `zone` filters, and `collateralSymbol`, `collateralIcon`, `icon`, `liquidity`, `utilization` and `smartCollateralConfig` are all `null` on it. A strictly-typed client will fail to parse the response unless those fields are modelled as nullable. Paginated breakdown of how a vault's liquidity is allocated across its lending markets. #### Query parameters | Parameter | Type | Required | Description | | ---------- | ------ | -------- | ---------------------------------------------------------------------------------------------------------------------------- | | `address` | string | Yes | Vault contract address. | | `page` | number | No | 1-based page number. Default `1`. | | `pageSize` | number | No | Items per page. Default `10`, max `50`. | | `sort` | string | No | Sort field key — one of `allocation`, `totalSupply`, `liquidity`, `utilization`, `cap`, `borrowRate`. Default `totalSupply`. | | `order` | string | No | `asc` or `desc`. Default `desc`. | | `keyword` | string | No | Free-text search over the allocated market's collateral name/keywords. | | `zone` | string | No | Comma-separated zone (segment) filter applied to the underlying markets. | > Rows are pre-ordered by an internal market `priority` first, then by the requested `sort`/`order`. An unknown vault `address` returns `{ total: 0, list: [] }`. #### Response | Field | Type | Description | | ------- | ------ | ----------------------------------------- | | `total` | number | Total allocated markets (for pagination). | | `list` | array | Allocation rows. | **Item in `list`:** | Field | Type | Description | | ---------------------------------------- | ------ | -------------------------------------------------------------------------------------------------------- | | `id` | string | Market identifier the liquidity is allocated to. | | `name`, `collateralSymbol`, `loanSymbol` | string | Market display name and both token symbols. | | `icon`, `collateralIcon`, `loanIcon` | string | Display assets. | | `allocation` | string | Amount of vault liquidity al
프로젝트로 돌아가기