import { Fixed18 } from './fixed-18'; interface Pool { other: Fixed18; base: Fixed18; } /** * @name calcSwapTargetAmount * @description calculate how many target token can be received * Equation: received = (1 - slippage) * (1 - fee) * (targetPool - (supplyPool * targetPool) / (supplyPool + supply)) * @param {number} supply - supply token amount in swap-target process * @param {number} supplyPool - token amount in the supply pool (base tokens pool) * @param {number} targetPool - token amount in the target pool (other token pool) * @param {Fixed18} feeRate - swap fee rate * @param {Fixed18} [slippage=0] - swap slippage * @returns {number} return target token amount which can be received */ export declare function calcSwapTargetAmount(supply: number, supplyPool: number, targetPool: number, feeRate: Fixed18, slippage?: Fixed18): number; /** * @name calcSwapSupplyAmount * @description calculate how many supply token need * Equation: received = (1 - slippage) * targetPool * supplyPool / (targetPool - target / (1 - feeRate)) - supplyPool * @param {number} target - target token amount in swap-supply process * @param {number} supplyPool - token amount in the supply pool (base tokens pool) * @param {number} targetPool - token amount in the target pool (other token pool) * @param {Fixed18} feeRate - swap fee rate * @param {Fixed18} [slippage=0] - swap slippage * @returns {number} return target token amount which can be received */ export declare function calcSwapSupplyAmount(target: number, supplyPool: number, targetPool: number, feeRate: Fixed18, slippage?: Fixed18): number; /** * @name calaTargetInOtherToBase * @description calculate how many base tokens will be received in other-to-base process * @param {Fixed18} supply - supply token amount * @param {Fixed18} pool.other - token amount in the other pool * @param {Fixed18} pool.base - token amount in the base pool * @param {Fixed18} feeRate - swap fee rate * @param {Fixed18} [slippage=0] - swap slippage * @returns {Fixed} return amount of received base tokens in other-to-base process */ export declare function calcTargetInOtherToBase(supply: Fixed18, pool: Pool, feeRate: Fixed18, slippage?: Fixed18): Fixed18; /** * @name calaSupplyInOtherToBase * @description calculate how many other tokens need in other-to-base process * @param {Fixed18} supply - supply token amount * @param {Fixed18} pool.other - token amount in the other pool * @param {Fixed18} pool.base - token amount in the base pool * @param {Fixed18} feeRate - swap fee rate * @param {Fixed18} [slippage=0] - swap slippage * @returns {Fixed} return amount of required base tokens in other-to-base process */ export declare function calcSupplyInOtherToBase(target: Fixed18, pool: Pool, feeRate: Fixed18, slippage?: Fixed18): Fixed18; /** * @name calaTargetInBaseToOther * @description calculate how many other tokens will be received in base-to-other process * @param {Fixed18} supply - supply token amount * @param {Fixed18} pool.other - token amount in the other pool * @param {Fixed18} pool.base - token amount in the base pool * @param {Fixed18} feeRate - swap fee rate * @param {Fixed18} [slippage=0] - swap slippage * @returns {Fixed} return amount of received other tokens in base-to-other process */ export declare function calcTargetInBaseToOther(supply: Fixed18, pool: Pool, feeRate: Fixed18, slippage?: Fixed18): Fixed18; /** * @name calaSupplyInBaseToOther * @description calculate how many base tokens need in other-to-base process * @param {Fixed18} target - target token amount * @param {Fixed18} pool.other - token amount in the other pool * @param {Fixed18} pool.base - token amount in the base pool * @param {Fixed18} feeRate - swap fee rate * @param {Fixed18} [slippage=0] - swap slippage * @returns {Fixed} return amount of required base tokens in base-to-other process */ export declare function calcSupplyInBaseToOther(target: Fixed18, pool: Pool, feeRate: Fixed18, slippage?: Fixed18): Fixed18; /** * @name calaTargetInOtherToOther * @description calculate how many other tokens will be received in other-to-other process * @param {Fixed18} supply - supply token amount * @param {Fixed18} pool.other - token amount in the other pool * @param {Fixed18} pool.base - token amount in the base pool * @param {Fixed18} feeRate - swap fee rate * @param {Fixed18} [slippage=0] - swap slippage * @returns {Fixed} return amount of received other tokens in base-to-other process */ export declare function calcTargetInOtherToOther(supply: Fixed18, supplyPool: Pool, targetPool: Pool, feeRate: Fixed18, slippage?: Fixed18): Fixed18; /** * @name calaSupplyInOtherToOther * @description calculate how many other tokens need in other-to-other process * @param {Fixed18} target - supply token amount * @param {Fixed18} pool.other - token amount in the other pool * @param {Fixed18} pool.base - token amount in the base pool * @param {Fixed18} feeRate - swap fee rate * @param {Fixed18} [slippage=0] - swap slippage * @returns {Fixed} return amount of received other tokens in base-to-other process */ export declare function calcSupplyInOtherToOther(target: Fixed18, supplyPool: Pool, targetPool: Pool, feeRate: Fixed18, slippage?: Fixed18): Fixed18; export {};