import Decimal from 'decimal.js'; import { Address } from '@solana/kit'; import type { ReserveAllocationOverview } from '../classes/vault_types'; export type ReserveAllocationForCompute = { /** Target allocation weight; unitless relative weight. */ targetWeight: Decimal; /** Token allocation cap after converting raw vault-token lamports to token units. */ tokenAllocationCapTokens: Decimal; /** Current cToken allocation, kept as raw ctoken lamports from vault state. */ ctokenAllocationLamports: Decimal; /** Optional finite ctoken cap converted into underlying liquidity token units. */ ctokenAllocationCapLiquidityTokens?: Decimal; }; export interface VaultAllocationResult { /** Target unallocated amount in token units, not lamports. */ targetUnallocatedAmount: Decimal; /** Target amount per reserve in token units, not lamports. */ targetReservesAllocation: Map; } export declare function isCtokenAllocationCapUncapped(ctokenAllocationCap: Decimal.Value | undefined): boolean; /** Converts a finite ctoken allocation cap from ctoken lamports into underlying liquidity lamports. */ export declare function ctokenAllocationCapLamportsToLiquidityLamports(ctokenAllocationCapLamports: Decimal.Value | undefined, collateralExchangeRate: Decimal.Value): Decimal | undefined; /** * Returns the min of token cap and converted ctoken cap. * Both inputs must already be expressed in the same underlying liquidity unit: * either vault-token lamports or token units. */ export declare function getEffectiveLiquidityAllocationCap(tokenAllocationCapLiquidity: Decimal.Value, ctokenAllocationCapLiquidity?: Decimal.Value): Decimal; export declare function toReserveAllocationForCompute(allocation: ReserveAllocationOverview, vaultTokenDecimals: number, collateralExchangeRate?: Decimal.Value): ReserveAllocationForCompute; /** * Computes the allocation of vault funds across reserves based on weights and caps. * @param vaultAUMInvestableInReserves - Total AUM of the vault, in tokens, that can be invested in reserves. * @param vaultUnallocatedWeight - Weight for unallocated funds * @param vaultUnallocatedCap - Maximum amount that can remain unallocated. `0` means uncapped — on-chain `VaultState::refresh_target_allocations` maps `unallocated_tokens_cap == 0` to `u64::MAX` for backwards compatibility * @param initialVaultAllocations - Map of reserve addresses to their allocation configurations * @param vaultTokenDecimals - The number of decimals of the vault token, needed to avoid dust transfers. * @returns Object containing target unallocated amount and target allocations per reserve, in tokens */ export declare function computeReservesAllocation(vaultAUMInvestableInReserves: Decimal, vaultUnallocatedWeight: Decimal, vaultUnallocatedCap: Decimal, initialVaultAllocations: Map, vaultTokenDecimals: number): VaultAllocationResult; //# sourceMappingURL=vaultAllocation.d.ts.map