@galacticcouncil/sdk-next 0.30.3 → 0.31.0
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.
|
@@ -48,4 +48,16 @@ export declare class HsmPool extends StableSwap {
|
|
|
48
48
|
spotPriceOutGivenIn(poolPair: PoolPair): bigint;
|
|
49
49
|
private getCollateralPeg;
|
|
50
50
|
private isDefaultPeg;
|
|
51
|
+
/**
|
|
52
|
+
* Normalize spot to runtime decimals.
|
|
53
|
+
*
|
|
54
|
+
* - if `decimalsIn === decimalsOut`: spot already 18dp
|
|
55
|
+
* - if `decimalsIn > decimalsOut`: spot in 18 - (decimalsIn - decimalsOut)
|
|
56
|
+
* - if `decimalsIn < decimalsOut`: spot in 18 + (decimalsOut - decimalsIn)
|
|
57
|
+
*
|
|
58
|
+
* @param spotRaw - raw spot
|
|
59
|
+
* @param decimalsIn - asset in decimals
|
|
60
|
+
* @param decimalsOut - asset out decimals
|
|
61
|
+
*/
|
|
62
|
+
private normalizeSpotPrice;
|
|
51
63
|
}
|
|
@@ -47,7 +47,7 @@ export declare class StableSwap implements Pool {
|
|
|
47
47
|
private getReserves;
|
|
48
48
|
private getAssets;
|
|
49
49
|
/**
|
|
50
|
-
* Normalize
|
|
50
|
+
* Normalize spot to runtime decimals.
|
|
51
51
|
*
|
|
52
52
|
* - if `neither arg is share`: spot already 18dp
|
|
53
53
|
* - if `argIn is share`: spot in decimalsIn
|
|
@@ -21,7 +21,7 @@ export declare class XykPool implements Pool {
|
|
|
21
21
|
spotPriceOutGivenIn(poolPair: PoolPair): bigint;
|
|
22
22
|
calculateTradeFee(amount: bigint, fees: XykPoolFees): bigint;
|
|
23
23
|
/**
|
|
24
|
-
* Normalize
|
|
24
|
+
* Normalize spot to runtime decimals.
|
|
25
25
|
*
|
|
26
26
|
* - if `decimalsIn === decimalsOut`: spot already 18dp
|
|
27
27
|
* - if `decimalsIn > decimalsOut`: spot in 18 - (decimalsIn - decimalsOut)
|
|
@@ -56,6 +56,16 @@ export declare class TradeScheduler {
|
|
|
56
56
|
* @returns optimal number of trades to execute the order
|
|
57
57
|
*/
|
|
58
58
|
protected getOptimalTradeCount(priceImpact: number): number;
|
|
59
|
+
/**
|
|
60
|
+
* Build an open budget DCA (Dollar Cost Averaging) order.
|
|
61
|
+
*
|
|
62
|
+
* @param assetIn - storage key of assetIn
|
|
63
|
+
* @param assetOut - storage key of assetOut
|
|
64
|
+
* @param amountIn - per-trade amount
|
|
65
|
+
* @param periodMs - interval between trades in ms
|
|
66
|
+
* @returns - dca trade order with amountIn = 0 (open budget)
|
|
67
|
+
*/
|
|
68
|
+
getOpenBudgetDcaOrder(assetIn: number, assetOut: number, amountIn: string, periodMs: number): Promise<TradeDcaOrder>;
|
|
59
69
|
/**
|
|
60
70
|
* Build a TWAP (Time-Weighted Average Price) sell order
|
|
61
71
|
*
|