@drift-labs/sdk 2.100.0-beta.7 → 2.100.0-beta.9
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.
- package/VERSION +1 -1
- package/lib/browser/constants/spotMarkets.js +10 -0
- package/lib/browser/math/oracles.js +1 -1
- package/lib/node/constants/spotMarkets.js +10 -0
- package/lib/node/math/oracles.js +1 -1
- package/package.json +1 -1
- package/src/constants/spotMarkets.ts +11 -0
- package/src/math/oracles.ts +1 -1
package/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
2.100.0-beta.
|
|
1
|
+
2.100.0-beta.9
|
|
@@ -355,6 +355,16 @@ exports.MainnetSpotMarkets = [
|
|
|
355
355
|
precisionExp: numericConstants_1.SIX,
|
|
356
356
|
pythFeedId: '0x62742a997d01f7524f791fdb2dd43aaf0e567d765ebf8fd0406a994239e874d4',
|
|
357
357
|
},
|
|
358
|
+
{
|
|
359
|
+
symbol: 'cbBTC',
|
|
360
|
+
marketIndex: 27,
|
|
361
|
+
oracle: new web3_js_1.PublicKey('486kr3pmFPfTsS4aZgcsQ7kS4i9rjMsYYZup6HQNSTT4'),
|
|
362
|
+
oracleSource: __1.OracleSource.PYTH_PULL,
|
|
363
|
+
mint: new web3_js_1.PublicKey('cbbtcf3aa214zXHbiAZQwf4122FBYbraNdFqgw4iMij'),
|
|
364
|
+
precision: new __1.BN(10).pow(numericConstants_1.EIGHT),
|
|
365
|
+
precisionExp: numericConstants_1.EIGHT,
|
|
366
|
+
pythFeedId: '0xe62df6c8b4a85fe1a67db44dc12de5db330f7ac66b72dc658afedf0f4a415b43',
|
|
367
|
+
},
|
|
358
368
|
];
|
|
359
369
|
exports.SpotMarkets = {
|
|
360
370
|
devnet: exports.DevnetSpotMarkets,
|
|
@@ -10,7 +10,7 @@ function oraclePriceBands(market, oraclePriceData) {
|
|
|
10
10
|
const offset = oraclePriceData.price
|
|
11
11
|
.mul(new index_1.BN(maxPercentDiff))
|
|
12
12
|
.div(numericConstants_1.MARGIN_PRECISION);
|
|
13
|
-
(0, assert_1.assert)(offset.
|
|
13
|
+
(0, assert_1.assert)(offset.gte(numericConstants_1.ZERO));
|
|
14
14
|
return [oraclePriceData.price.sub(offset), oraclePriceData.price.add(offset)];
|
|
15
15
|
}
|
|
16
16
|
exports.oraclePriceBands = oraclePriceBands;
|
|
@@ -355,6 +355,16 @@ exports.MainnetSpotMarkets = [
|
|
|
355
355
|
precisionExp: numericConstants_1.SIX,
|
|
356
356
|
pythFeedId: '0x62742a997d01f7524f791fdb2dd43aaf0e567d765ebf8fd0406a994239e874d4',
|
|
357
357
|
},
|
|
358
|
+
{
|
|
359
|
+
symbol: 'cbBTC',
|
|
360
|
+
marketIndex: 27,
|
|
361
|
+
oracle: new web3_js_1.PublicKey('486kr3pmFPfTsS4aZgcsQ7kS4i9rjMsYYZup6HQNSTT4'),
|
|
362
|
+
oracleSource: __1.OracleSource.PYTH_PULL,
|
|
363
|
+
mint: new web3_js_1.PublicKey('cbbtcf3aa214zXHbiAZQwf4122FBYbraNdFqgw4iMij'),
|
|
364
|
+
precision: new __1.BN(10).pow(numericConstants_1.EIGHT),
|
|
365
|
+
precisionExp: numericConstants_1.EIGHT,
|
|
366
|
+
pythFeedId: '0xe62df6c8b4a85fe1a67db44dc12de5db330f7ac66b72dc658afedf0f4a415b43',
|
|
367
|
+
},
|
|
358
368
|
];
|
|
359
369
|
exports.SpotMarkets = {
|
|
360
370
|
devnet: exports.DevnetSpotMarkets,
|
package/lib/node/math/oracles.js
CHANGED
|
@@ -10,7 +10,7 @@ function oraclePriceBands(market, oraclePriceData) {
|
|
|
10
10
|
const offset = oraclePriceData.price
|
|
11
11
|
.mul(new index_1.BN(maxPercentDiff))
|
|
12
12
|
.div(numericConstants_1.MARGIN_PRECISION);
|
|
13
|
-
(0, assert_1.assert)(offset.
|
|
13
|
+
(0, assert_1.assert)(offset.gte(numericConstants_1.ZERO));
|
|
14
14
|
return [oraclePriceData.price.sub(offset), oraclePriceData.price.add(offset)];
|
|
15
15
|
}
|
|
16
16
|
exports.oraclePriceBands = oraclePriceBands;
|
package/package.json
CHANGED
|
@@ -439,6 +439,17 @@ export const MainnetSpotMarkets: SpotMarketConfig[] = [
|
|
|
439
439
|
pythFeedId:
|
|
440
440
|
'0x62742a997d01f7524f791fdb2dd43aaf0e567d765ebf8fd0406a994239e874d4',
|
|
441
441
|
},
|
|
442
|
+
{
|
|
443
|
+
symbol: 'cbBTC',
|
|
444
|
+
marketIndex: 27,
|
|
445
|
+
oracle: new PublicKey('486kr3pmFPfTsS4aZgcsQ7kS4i9rjMsYYZup6HQNSTT4'),
|
|
446
|
+
oracleSource: OracleSource.PYTH_PULL,
|
|
447
|
+
mint: new PublicKey('cbbtcf3aa214zXHbiAZQwf4122FBYbraNdFqgw4iMij'),
|
|
448
|
+
precision: new BN(10).pow(EIGHT),
|
|
449
|
+
precisionExp: EIGHT,
|
|
450
|
+
pythFeedId:
|
|
451
|
+
'0xe62df6c8b4a85fe1a67db44dc12de5db330f7ac66b72dc658afedf0f4a415b43',
|
|
452
|
+
},
|
|
442
453
|
];
|
|
443
454
|
|
|
444
455
|
export const SpotMarkets: { [key in DriftEnv]: SpotMarketConfig[] } = {
|
package/src/math/oracles.ts
CHANGED