@drift-labs/sdk 2.67.0-beta.6 → 2.68.0-beta.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.
package/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
2.
|
|
1
|
+
2.68.0-beta.0
|
package/lib/idl/drift.json
CHANGED
|
@@ -19,7 +19,7 @@ class SwitchboardClient {
|
|
|
19
19
|
getOraclePriceDataFromBuffer(buffer) {
|
|
20
20
|
const aggregatorAccountData = this.coder.decodeUnchecked('AggregatorAccountData', buffer);
|
|
21
21
|
const price = convertSwitchboardDecimal(aggregatorAccountData.latestConfirmedRound.result);
|
|
22
|
-
const confidence = convertSwitchboardDecimal(aggregatorAccountData.latestConfirmedRound.stdDeviation);
|
|
22
|
+
const confidence = anchor_1.BN.max(convertSwitchboardDecimal(aggregatorAccountData.latestConfirmedRound.stdDeviation), price.divn(1000));
|
|
23
23
|
const hasSufficientNumberOfDataPoints = aggregatorAccountData.latestConfirmedRound.numSuccess >=
|
|
24
24
|
aggregatorAccountData.minOracleResults;
|
|
25
25
|
const slot = aggregatorAccountData.latestConfirmedRound.roundOpenSlot;
|
package/package.json
CHANGED
package/src/idl/drift.json
CHANGED
|
@@ -45,8 +45,11 @@ export class SwitchboardClient implements OracleClient {
|
|
|
45
45
|
aggregatorAccountData.latestConfirmedRound.result
|
|
46
46
|
);
|
|
47
47
|
|
|
48
|
-
const confidence =
|
|
49
|
-
|
|
48
|
+
const confidence = BN.max(
|
|
49
|
+
convertSwitchboardDecimal(
|
|
50
|
+
aggregatorAccountData.latestConfirmedRound.stdDeviation
|
|
51
|
+
),
|
|
52
|
+
price.divn(1000)
|
|
50
53
|
);
|
|
51
54
|
|
|
52
55
|
const hasSufficientNumberOfDataPoints =
|