import { AppId, AssetId, InstrumentSlotId, UnixTimestamp, UserAddress, Instrument } from "../interfaces"; import { ContractAmount } from "../tools/instrumentAmount"; import { IPackedInfo, IPackedInfoAny } from "../utils/encoding"; export type ContractRatio = bigint; export type ContractRate = bigint; export type CoreUserEntry = { cash: ContractAmount; principal: ContractAmount; index: ContractRate; }; export type CoreUserState = Map; export type LiquidationFactors = { cashLiquidationFactor: ContractRatio; poolLiquidationFactor: ContractRatio; }; export type GlobalConstants = { initTimestamp: UnixTimestamp; pricecasterId: AppId; wormholeTokenBridgeId: AppId; cashLiquidationFactor: ContractRatio; poolLiquidationFactor: ContractRatio; withdrawBufferAddress: UserAddress; signatureValidatorAddress: UserAddress; quantAddress: UserAddress; operatorAddress: UserAddress; feeTargetAddress: UserAddress; }; export type RiskFactors = { haircut: ContractRatio; margin: ContractRatio; }; export type RelativeTimestamp = number; export type PoolRates = { optimalUtilization: ContractRatio; minRate: ContractRate; optRate: ContractRate; maxRate: ContractRate; }; export type HasBorrowAndLendIndex = { borrowIndex: ContractRate; lendIndex: ContractRate; }; export type InstrumentPoolData = HasBorrowAndLendIndex & { lastUpdateTime: RelativeTimestamp; poolRates: PoolRates; borrowed: ContractAmount; liquidity: ContractAmount; }; export type InstrumentPool = { initial: RiskFactors; maintenance: RiskFactors; poolData: InstrumentPoolData; }; export type ServerInstrument = { slotId: InstrumentSlotId; instrument: Instrument; pool: InstrumentPool; }; export type CoreGlobalState = { constants: GlobalConstants; instruments: ServerInstrument[]; }; export declare const CONTRACT_ASSET_ID_FORMAT: IPackedInfoAny; export declare const CONTRACT_AMOUNT_FORMAT: IPackedInfoAny; export declare const CONTRACT_RELATIVE_TIMESTAMP_FORMAT: IPackedInfoAny; export declare const CONTRACT_RATIO_FORMAT: IPackedInfoAny; export declare const CONTRACT_RATE_FORMAT: IPackedInfoAny; export declare const userInstrumentFormat: IPackedInfo; export declare const liquidationFactorsFormat: IPackedInfo; export declare const riskFactorsFormat: IPackedInfo; export declare const poolRatesFormat: IPackedInfo; export declare const poolDataFormat: IPackedInfo; export declare const instrumentInfoFormat: IPackedInfo; export declare const instrumentFormat: IPackedInfo; export type InstrumentOnchain = { assetId: AssetId; info: InstrumentPool; }; export type InstrumentInfoFetcher = (assetId: AssetId) => Promise; export declare const DEFAULT_INSTRUMENT_INFO_FETCHER: InstrumentInfoFetcher; export declare function parseCoreInstruments(data: Uint8Array, instrumentCount: number, instrumentInfoFetcher?: InstrumentInfoFetcher): Promise; export declare function parseCoreUserState(data: Uint8Array): Promise; //# sourceMappingURL=CoreState.d.ts.map