import { ChartBundle, ChartRange, ProtocolChartMetric } from "../../model/charts.js"; import { ChainScopedFilter } from "../../model/filters.js"; import { AnalyticsPositionFilterOptions, AnalyticsPositionListOptions, AnalyticsPositionPage } from "../../model/analytics.js"; import { DataResponse } from "../../model/response.js"; //#region src/offchain/analytics/types.d.ts /** Protocol-wide position reads served by the backend. */ export interface IOffchainAnalyticsPositions { /** * Complete dropdown choices across current positions on this client's * chains, narrowed by `filter`. The backend collects these before pagination * and independently of position filters or sorting. * * ```ts * const { data } = await sdk.analytics.positions.filterOptions({ * chainIds: [1], * }); * // data: { pools, creditManagers, assets, curators } * ``` */ filterOptions(filter?: ChainScopedFilter): Promise>; /** * Every current position in the protocol, with its owning borrower, after * applying the requested filter, ordering and pagination. **/ list(options?: AnalyticsPositionListOptions): Promise>; } /** Backend-only protocol analytics, grouped by subject. */ export interface IOffchainAnalytics { readonly positions: IOffchainAnalyticsPositions; /** * Charts of the protocol as a whole: one series per metric named, onto the * one grid that lets them be compared at an index. * * The series sums the chains the read covers, which are the client's own * narrowed by `filter` — so a client built for one chain charts that chain, * not the protocol. **/ getCharts(metrics: Metrics, range: ChartRange, filter?: ChainScopedFilter): Promise>>; } //#endregion