evx-sdk
Version:
The Evx SDK is a developer toolkit designed to simplify interaction with the Evx decentralized liquidity protocol. It provides an abstraction layer over the smart contracts, allowing developers to easily build applications, integrate liquidity pools, fetc
43 lines (42 loc) • 1.64 kB
TypeScript
/**
* @notice Converts a percentage value to basis points (BPS).
* @dev 1 BPS = 0.01%, 100 BPS = 1%, 10000 BPS = 100%
* @param percentage The percentage value (e.g., 0.3 for 0.3%).
* @return The basis points as a BigInt.
*/
export declare function percentageToBasisPoints(percentage: number): bigint;
/**
* @notice Converts basis points (BPS) to a percentage value.
* @dev 1 BPS = 0.01%, 100 BPS = 1%, 10000 BPS = 100%
* @param basisPoints The basis points value.
* @return The percentage as a number.
*/
export declare function basisPointsToPercentage(basisPoints: bigint): number;
/**
* @notice Converts a percentage value to Nebular fee format.
* @dev Nebular uses 1 unit = 0.0001%
* @param percentage The percentage value (e.g., 0.3 for 0.3%).
* @return The fee value as a BigInt.
*/
export declare function percentageToFee(percentage: number): bigint;
/**
* @notice Converts Nebular fee format to a percentage value.
* @dev Nebular uses 1 unit = 0.0001%
* @param fee The fee value from Nebular.
* @return The percentage as a number.
*/
export declare function feeToPercentage(fee: bigint): number;
/**
* @notice Converts basis points to Nebular fee format.
* @dev 1 BPS = 0.01% = 100 Nebular units
* @param basisPoints The basis points value.
* @return The Nebular fee value as a BigInt.
*/
export declare function basisPointsToFee(basisPoints: bigint): bigint;
/**
* @notice Converts Nebular fee format to basis points.
* @dev 1 Nebular unit = 0.0001% = 0.01 BPS
* @param fee The Nebular fee value.
* @return The basis points as a BigInt.
*/
export declare function feeToBasisPoints(fee: bigint): bigint;