@bancor/carbon-sdk
Version:
The SDK is a READ-ONLY tool, intended to facilitate working with Carbon contracts. It's a convenient wrapper around our matching algorithm, allowing programs and users get a ready to use transaction data that will allow them to manage strategies and fulfi
32 lines • 1.92 kB
TypeScript
import { BigNumber, Decimal } from './numerics';
import { DecodedOrder, EncodedOrder } from '../common/types';
export declare const encodeRate: (value: Decimal) => BigNumber;
export declare const decodeRate: (value: Decimal) => import("decimal.js").Decimal;
export declare const encodeFloat: (value: BigNumber) => BigNumber;
export declare const decodeFloat: (value: BigNumber) => BigNumber;
export declare const encodeOrders: ([order0, order1]: [DecodedOrder, DecodedOrder]) => [EncodedOrder, EncodedOrder];
export declare const isOrderEncodable: (order: DecodedOrder) => boolean;
/**
* Checks if the rates are equal after scaling them
* @param {string} x - the first rate
* @param {string} y - the second rate
* @returns {boolean} - true if the rates are equal after scaling, false otherwise
*/
export declare const areScaledRatesEqual: (x: string, y: string) => boolean;
export declare const encodeOrder: (order: DecodedOrder, z?: BigNumber) => EncodedOrder;
export declare const decodeOrder: (order: EncodedOrder) => DecodedOrder;
/**
* Use the capacity of the other order along with the prices of this order,
* in order to calculate the capacity that this order needs to have in order for its
* marginal price to be set according to the given input - and provide the
* liquidity that should be used to achieve that.
*/
export declare const calculateRequiredLiquidity: (knownOrder: DecodedOrder, vagueOrder: DecodedOrder) => string;
/**
* Use the capacity of the other order along with the prices of this order,
* in order to calculate the capacity that this order needs to have in order for its
* marginal price to be set according to the given input - and provide the
* liquidity that should be used to achieve that. This function assumes that the other order has 0 liquidity.
*/
export declare const calculateCorrelatedZ: (order: DecodedOrder) => BigNumber;
//# sourceMappingURL=encoders.d.ts.map