/** GMX V2 GM/GLV pool-token read types. */
import type { VaultClassificationFields } from '../classification';
/**
 * Which GMX product a listing represents.
 * - `gm`  — a single GMX V2 market pool token (one index asset, backed by a
 *           long + short token pair).
 * - `glv` — a GMX Liquidity Vault token: an auto-rebalancing meta-vault that
 *           aggregates several GM markets sharing the same long/short pair.
 */
export type GmxVaultKind = 'gm' | 'glv';
/**
 * Vault-level public data for a single GMX GM or GLV pool token, normalised
 * from the gmxinfra REST API (`/apy`, `/markets`, `/glvs`, `/tokens`).
 *
 * GM/GLV tokens are 18-decimal ERC-20s representing a share of a perp-DEX
 * liquidity pool. LPs earn trading + borrow fees but absorb trader PnL, so
 * NAV fluctuates and can draw down — hence always `volatile`. They are not
 * ERC-4626 and have no monotonic share/asset ratio, so (like HyperCore) they
 * are surfaced as a listing only, not folded into the generic vault lookup.
 */
export interface GmxVault extends VaultClassificationFields {
    /** GM market token / GLV token address, lowercased. */
    address: string;
    /** Display name from the API (e.g. `ETH/USD [WETH-USDC]`, `GLV [WBTC.b-USDC]`). */
    name: string;
    /** GM market vs GLV vault. */
    kind: GmxVaultKind;
    /** Share-token symbol — synthesised (`GM` / `GLV`); the API has no symbol. */
    symbol: string;
    /** Share decimals. GM and GLV tokens are 18-decimal on GMX V2. */
    decimals: number;
    /** Long-leg token address, lowercased. */
    longToken: string;
    /** Short-leg token address (the quote leg, typically USDC), lowercased. */
    shortToken: string;
    /** Index (priced) token address, lowercased. GM only — absent for GLV. */
    indexToken?: string;
    /** Long-leg token symbol, when resolvable from the `/tokens` map. */
    longSymbol?: string;
    /** Short-leg token symbol, when resolvable from the `/tokens` map. */
    shortSymbol?: string;
    /** Total APY as a fraction (e.g. `0.16` = 16%) for the requested period. */
    apy: number;
    /** Base (fee) APY as a fraction. */
    baseApy: number;
    /** Bonus APR (incentives) as a fraction. */
    bonusApr: number;
    /** Always volatile (perp-DEX liquidity provision). */
    yieldProfile: 'volatile';
    /** `stable` only when both legs are stablecoins; otherwise `volatile`. */
    denomination: 'stable' | 'volatile';
    /** USD price of one GM/GLV token, from `Reader.getMarketTokenPrice` /
     *  `GlvReader.getGlvTokenPrice` (fed by `/prices/tickers`). Absent when
     *  multicall pricing was unavailable (no `multicallRetry`, missing
     *  oracle price, or a failed read). */
    priceUsd?: number;
    /** Total pool value (TVL) in USD, from the same call. Absent under the
     *  same conditions as {@link priceUsd}. */
    tvlUsd?: number;
    /**
     * Withdrawal-side liquidity in USD — the most a holder of the entire vault
     * could withdraw right now: pool value minus the part reserved to back open
     * trader positions, capped at {@link tvlUsd}. For GLV this is an
     * approximation (the constituent markets' blended liquidity ratio applied to
     * the GLV's value). Absent when the reserve reads were unavailable. */
    liquidityUsd?: number;
    /**
     * Remaining deposit capacity in USD — how much more liquidity the pool can
     * accept before GMX rejects the deposit. Per leg it's the unused room under
     * the absolute token cap (`MAX_POOL_AMOUNT`) and the USD cap
     * (`MAX_POOL_USD_FOR_DEPOSIT`), whichever binds first, summed across legs.
     * For GLV this also folds in the per-market GM-balance cap the GLV may hold
     * (`min(market room, GLV room)` across constituents) — an approximation
     * that ignores deposit price-impact. Absent when the cap reads were
     * unavailable or no cap is configured. */
    depositCapacityUsd?: number;
}
/** Vault-level listing keyed by lowercased address. */
export type GmxVaults = {
    [address: string]: GmxVault;
};
export interface GmxVaultsFetchOptions {
    /** APY averaging window passed to the API (default `90d`). */
    period?: string;
    /** Override the gmxinfra API base for the chain (testing). */
    apiUrl?: string;
}
/**
 * Per-chain minimum execution fees (wei) for the four GMX V2 GM/GLV
 * request types — what to pass as `executionFee` on the matching calldata
 * builder. Computed as `(baseGasLimit + opGasLimit * multiplier / 1e30) *
 * gasPrice`, mirroring the GMX SDK; GLV ops add `glvPerMarketGasLimit ×`
 * the chain's largest GLV market count. Gas price is volatile, so treat
 * these as fresh-at-fetch estimates (GMX refunds any overpayment).
 */
export interface GmxExecutionFees {
    chainId: string;
    /** Gas price (wei) used for the estimate. */
    gasPriceWei: string;
    deposit: string;
    withdrawal: string;
    glvDeposit: string;
    glvWithdrawal: string;
}
/** A user's GM/GLV token balance (raw ERC-20 units, 18-dec). */
export interface GmxUserBalance {
    /** GM market token or GLV token address, lowercased. */
    token: string;
    kind: GmxVaultKind;
    /** Raw integer balance string. */
    balance: string;
}
/**
 * A pending (keeper-unexecuted) GM/GLV deposit request — the "ticket"
 * that mints GM/GLV once a keeper executes it. Cancellable until then via
 * the calldata-sdk `buildGmxCancel`.
 */
export interface GmxPendingDeposit {
    /** DataStore request key (GM) — undefined for GLV deposits, which the
     *  GlvReader returns without exposing the key. */
    key?: string;
    kind: GmxVaultKind;
    account: string;
    receiver: string;
    /** GM market the request routes through. */
    market: string;
    /** GLV token (GLV deposits only). */
    glv?: string;
    initialLongToken: string;
    initialShortToken: string;
    initialLongTokenAmount: string;
    initialShortTokenAmount: string;
    /** Min GM out (GM) / min GLV out (GLV), raw. */
    minOut: string;
    executionFee: string;
    /** Request creation time (unix seconds, as a string). */
    updatedAtTime: string;
}
/** A pending GM/GLV withdrawal request (burn GM/GLV → long+short legs). */
export interface GmxPendingWithdrawal {
    key?: string;
    kind: GmxVaultKind;
    account: string;
    receiver: string;
    market: string;
    glv?: string;
    /** GM/GLV token amount being redeemed, raw. */
    tokenAmount: string;
    minLongTokenAmount: string;
    minShortTokenAmount: string;
    executionFee: string;
    updatedAtTime: string;
}
/** Combined GMX position view for one account on one chain. */
export interface GmxUserPositions {
    chainId: string;
    account: string;
    /** Present only when the caller supplied tokens to balance-check. */
    balances: GmxUserBalance[];
    pendingDeposits: GmxPendingDeposit[];
    pendingWithdrawals: GmxPendingWithdrawal[];
}
export interface GmxUserPositionsOptions {
    /** GM/GLV tokens to read `balanceOf` for (e.g. from the listing). When
     *  omitted, `balances` is empty and only pending tickets are read. */
    tokens?: {
        address: string;
        kind: GmxVaultKind;
    }[];
    /** Max pending requests to enumerate per list (default 50). */
    cap?: number;
}
//# sourceMappingURL=types.d.ts.map