import { BigNumber } from 'bignumber.js';
import { PoolStatePreview, PoolStatePreviewInputs } from '../types';
/**
 * Calculates the effective multiplier returns for the longs. This amount varies depending on the skew between the long and short balances.
 * Gain and loss refer to whether the pool is receiving tokens from the other pool or transferring tokens to the opposite pool.
 * If there is more balance in the long pool than the short pools, you would expect the short pool to have
 *  `effectiveLongGain > leverage`.
 * Both sides of the pool will always have an effectiveLoss lower limit at leverage, ie you can never have `effectiveLoss < leverage`.
 * @param longBalance quote balance of the long pool in quote units (eg USD)
 * @param shortBalance quote balance of the short pool in quote units (eg USD)
 * @param leverage pool leverage
 * @returns the effective winning returns to the long pool on next rebalance
 */
export declare const calcEffectiveLongGain: (shortBalance: BigNumber, longBalance: BigNumber, leverage: BigNumber) => BigNumber;
/**
 * Calculates the effective gains multiplier for the shorts. This amount varies depending on the skew between the long and short balances.
 * Gain and loss refer to whether the pool is receiving tokens from the other pool or transferring tokens to the opposite pool.
 * If there is more balance in the long pool than the short pools, you would expect the short pool to have
 *  `effectiveLongGain > leverage`.
 * The pools effective losses will always have a lower limit at leverage, ie you can never have `effectiveLoss < leverage`.
 * @param longBalance quote balance of the long pool in USD
 * @param shortBalance quote balance of the short pool in USD
 * @param leverage pool leverage
 * @returns the effective gains to the short pool on next rebalance
 */
export declare const calcEffectiveShortGain: (shortBalance: BigNumber, longBalance: BigNumber, leverage: BigNumber) => BigNumber;
/**
 * Calculates the compounding gains
 * @param apr annual percentage rate as a decimal
 *  eg 1 is a 100% apr
 * @returns annual percentage yield coumpounded weekly
 */
export declare const calcAPY: (apr: BigNumber) => BigNumber;
/**
 * Calculates the percentage the losing pool must transfer to the winning pool on next upKeep.
 * JS implementation of https://github.com/tracer-protocol/perpetual-pools-contracts/blob/pools-v2/contracts/libraries/PoolSwapLibrary.sol#L348-L362
 * @param oldPrice old market price
 * @param newPrice new market price
 * @param leverage pool leverage
 * @returns the percentage the losing pool must transfer
 *  2 / (1 + e^(-2 * leverage * (1 - (oldPrice / newPrice)))) - 1
 */
export declare const calcPercentageLossTransfer: (oldPrice: BigNumber, newPrice: BigNumber, leverage: BigNumber) => BigNumber;
/**
 * Calculates the notional value of tokens
 * @param tokenPrice current price of tokens
 * @param numTokens number of tokens
 * @returns notional value of the tokens
 */
export declare const calcNotionalValue: (tokenPrice: BigNumber, numTokens: BigNumber) => BigNumber;
/**
 * Calculates the ratio of the old price to the new price
 * @param oldPrice old market price
 * @param newPrice new market price
 */
export declare const calcRatio: (oldPrice: BigNumber, newPrice: BigNumber) => BigNumber;
export declare const calcSkew: (shortBalance: BigNumber, longBalance: BigNumber) => BigNumber;
export declare const calcRebalanceRate: (shortBalance: BigNumber, longBalance: BigNumber) => BigNumber;
/**
 * Calcualtes the direction of the price movement
 * @param newPrice new market price
 * @param oldPrice old market price
 * @return DOWN (2) if oldPrice > newPrice, NO_CHANGE (3) if newPrice = oldPrice, or UP (1) if newPrice > oldPrice
 */
export declare const calcDirection: (oldPrice: BigNumber, newPrice: BigNumber) => BigNumber;
/**
 * Calculate the pool tokens price
 * Since totalQuoteValue will generally be in USD the returned amount
 *  will also be in USD
 */
export declare const calcTokenPrice: (totalQuoteValue: BigNumber, tokenSupply: BigNumber) => BigNumber;
/**
 * Calculates how much value will be transferred between the pools
 *
 * @param oldPrice old market price
 * @param newPrice new market price
 * @param leverage pool leverage
 * @param longBalance quote balance of the long pool in USD
 * @param shortBalance quote balance of the short pool in USD
 *
 * returns an object containing longValueTransfer and shortValueTransfer
 */
export declare const calcNextValueTransfer: (oldPrice: BigNumber, newPrice: BigNumber, leverage: BigNumber, longBalance: BigNumber, shortBalance: BigNumber) => {
    longValueTransfer: BigNumber;
    shortValueTransfer: BigNumber;
};
/**
 * Calculates the Balancer LP token price given a list of tokens included in the pool
 * @param tokens list of tokens included in the balancer pool
 * @returns 0 if no tokens are given, if the tokens have no USDC value or if the stakingToken supply is 0
 * 	otherwise returns the price of the LP token.
 */
export declare const calcBptTokenPrice: (usdTokenSupply: BigNumber, tokens?: {
    reserves: BigNumber;
    usdPrice: BigNumber;
}[]) => BigNumber;
/**
 * Calculates the trade price between two Balancer tokens.
 * This price is dependent on the reserves deposited on each side
 *  within the Balancer pool, as well as the weighting of each.
 * @param sellingToken weight and balance of token that is being sold
 * @param buyingToken weight and balance of token that is being bought
 * @param swapFee percentage swap fee in decimals
 * @returns
 */
export declare const calcBptTokenSpotPrice: (sellingToken: {
    weight: BigNumber;
    balance: BigNumber;
}, buyingToken: {
    weight: BigNumber;
    balance: BigNumber;
}, swapFee: BigNumber) => BigNumber;
/**
 * Calculate the expected execution given a commit timestamp, the frontRunningInterval, updateInterval and lastUpdate.
 *  This is just an estimate as there is a slight delay between possibleExecution and finalExecutionTimestamp
 *  See https://github.com/tracer-protocol/pools-js/blob/updated-calc/src/utils/calculations.ts#L280-L332
 *      for a long clearer sudo codish written version
 */
export declare const getExpectedExecutionTimestamp: (frontRunningInterval: number, updateInterval: number, lastUpdate: number, commitCreated: number) => number;
/**
 * calculates the expected state of the pool after applying the given pending commits to the given pool state
 * @param object containing current pool state
 * @returns the expected state of the pool
 */
export declare const calcPoolStatePreview: (previewInputs: PoolStatePreviewInputs) => PoolStatePreview;
