@galacticcouncil/sdk-next 0.25.0-pr243-080d186 → 0.25.0-pr243-f0c85f0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -42,5 +42,16 @@ export declare class OmniPool implements Pool {
|
|
|
42
42
|
spotPriceLrnaInGivenOut(poolPair: OmniPoolPair): bigint;
|
|
43
43
|
spotPriceOutGivenIn(poolPair: OmniPoolPair): bigint;
|
|
44
44
|
spotPriceOutGivenLrnaIn(poolPair: OmniPoolPair): bigint;
|
|
45
|
-
|
|
45
|
+
/**
|
|
46
|
+
* Normalize OmniMath spot to runtime decimals.
|
|
47
|
+
*
|
|
48
|
+
* - if `decimalsIn === decimalsOut`: spot already 18dp
|
|
49
|
+
* - if `decimalsIn > decimalsOut`: spot in 18 - (decimalsIn - decimalsOut)
|
|
50
|
+
* - if `decimalsIn < decimalsOut`: spot in 18 + (decimalsOut - decimalsIn)
|
|
51
|
+
*
|
|
52
|
+
* @param spotRaw - raw spot
|
|
53
|
+
* @param decimalsIn - asset in decimals
|
|
54
|
+
* @param decimalsOut - asset out decimals
|
|
55
|
+
*/
|
|
56
|
+
private normalizeSpot;
|
|
46
57
|
}
|
|
@@ -46,4 +46,18 @@ export declare class StableSwap implements Pool {
|
|
|
46
46
|
private getPegs;
|
|
47
47
|
private getReserves;
|
|
48
48
|
private getAssets;
|
|
49
|
+
/**
|
|
50
|
+
* Normalize StableMath spot to runtime decimals.
|
|
51
|
+
*
|
|
52
|
+
* - if `neither arg is share`: spot already 18dp
|
|
53
|
+
* - if `argIn is share`: spot in decimalsIn
|
|
54
|
+
* - if `argOut is share`: spot in 18 + (decimalsOut - decimalsIn)
|
|
55
|
+
*
|
|
56
|
+
* @param spotRaw - raw spot
|
|
57
|
+
* @param isInShare - whether the first arg is share
|
|
58
|
+
* @param isOutShare - whether the second arg is share
|
|
59
|
+
* @param decimalsIn - asset in decimals
|
|
60
|
+
* @param decimalsOut - asset out decimals
|
|
61
|
+
*/
|
|
62
|
+
private normalizeSpot;
|
|
49
63
|
}
|
|
@@ -20,5 +20,16 @@ export declare class XykPool implements Pool {
|
|
|
20
20
|
spotPriceInGivenOut(poolPair: PoolPair): bigint;
|
|
21
21
|
spotPriceOutGivenIn(poolPair: PoolPair): bigint;
|
|
22
22
|
calculateTradeFee(amount: bigint, fees: XykPoolFees): bigint;
|
|
23
|
-
|
|
23
|
+
/**
|
|
24
|
+
* Normalize XykMath spot to runtime decimals.
|
|
25
|
+
*
|
|
26
|
+
* - if `decimalsIn === decimalsOut`: spot already 18dp
|
|
27
|
+
* - if `decimalsIn > decimalsOut`: spot in 18 - (decimalsIn - decimalsOut)
|
|
28
|
+
* - if `decimalsIn < decimalsOut`: spot in 18 + (decimalsOut - decimalsIn)
|
|
29
|
+
*
|
|
30
|
+
* @param spotRaw - raw spot
|
|
31
|
+
* @param decimalsIn - asset in decimals
|
|
32
|
+
* @param decimalsOut - asset out decimals
|
|
33
|
+
*/
|
|
34
|
+
private normalizeSpot;
|
|
24
35
|
}
|