@naviprotocol/lending 2.2.0 → 2.2.1-preview.20261113.4089b35

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/dist/index.js CHANGED
@@ -1,104 +1,105 @@
1
1
  import { UserPositions as r, getCoins as o, getHealthFactor as a, getHealthFactorPTB as i, getLendingPositions as n, getLendingState as s, getSimulatedHealthFactor as l, getSimulatedHealthFactorPTB as d, getTransactions as g, mergeCoinsPTB as c, verifyHealthFactorPTB as P } from "./account.js";
2
2
  import { Address as f, FlashLoanAssetConfig as C, IncentiveAPYInfo as T, IncentivePoolInfo as B, IncentivePoolInfoByPhase as m, OracleInfo as h, ReserveDataInfo as A, UserStateInfo as I } from "./bcs.js";
3
- import { DEFAULT_CACHE_TIME as v, getConfig as F } from "./config.js";
4
- import { filterPriceFeeds as L, getPriceFeeds as M, getPythStalePriceFeedId as S, getPythStalePriceFeedIdV2 as y, updateOraclePriceBeforeUserOperationPTB as E, updateOraclePricesPTB as U, updatePythPriceFeeds as w } from "./oracle.js";
5
- import { flashloanPTB as R, getAllFlashLoanAssets as O, getFlashLoanAsset as k, repayFlashLoanPTB as H } from "./flashloan.js";
6
- import { liquidatePTB as D } from "./liquidate.js";
7
- import { PoolOperator as G, borrowCoinPTB as q, depositCoinPTB as z, getBorrowFee as K, getFees as Q, getPool as V, getPools as Y, getStats as j, repayCoinPTB as J, withdrawCoinPTB as W } from "./pool.js";
8
- import { claimLendingRewardsPTB as Z, getUserAvailableLendingRewards as $, getUserClaimedRewardHistory as ee, getUserTotalClaimedReward as te, summaryLendingRewards as re } from "./reward.js";
9
- import { devInspectTransaction as ae, normalizeCoinType as ie, parsePoolUID as ne, parseTxValue as se, withCache as le, withSingleton as de } from "./utils.js";
10
- import { createAccountCapPTB as ce, getAccountCapOwnerPTB as Pe } from "./account-cap.js";
11
- import { createEModeCapPTB as fe, emodeIdentityId as Ce, enterEModePTB as Te, exitEModePTB as Be, getUserEModeCaps as me } from "./emode.js";
12
- import { DEFAULT_MARKET_IDENTITY as Ae, MARKETS as Ie, Market as ue, getMarket as ve, getMarketConfig as Fe, getMarketConfigs as xe, getMarkets as Le, loadMarketConfigs as Me, registerMarketConfigs as Se } from "./market.js";
13
- import { NaviMissingGraphQLClientError as Ee, PUBLIC_MAINNET_GRPC_URL as Ue, createNaviLegacyJsonRpcClient as we, createNaviSuiClient as Ne, createNaviSuiClientBundle as Re, getAddressBalance as Oe, getCoinObjectOnlyBalance as ke, listAddressBalances as He, normalizeAddressBalance as _e, requireNaviGraphQLClient as De } from "./sui.js";
14
- import { SuiPriceServiceConnection as Ge, SuiPythClient as qe } from "./pyth.js";
15
- import { buildNaviOpenApiUrl as Ke, configureNaviSdk as Qe, mergeServiceHeaders as Ve, resolveNaviOpenApiEndpoint as Ye } from "./services.js";
3
+ import { DEFAULT_CACHE_TIME as u, getConfig as v } from "./config.js";
4
+ import { filterPriceFeeds as L, getPriceFeeds as M, getPythStalePriceFeedId as S, getPythStalePriceFeedIdV2 as y, isRatioPriceFeed as E, updateOraclePriceBeforeUserOperationPTB as U, updateOraclePricesPTB as w, updatePythPriceFeeds as R } from "./oracle.js";
5
+ import { flashloanPTB as O, getAllFlashLoanAssets as k, getFlashLoanAsset as H, repayFlashLoanPTB as _ } from "./flashloan.js";
6
+ import { liquidatePTB as b } from "./liquidate.js";
7
+ import { PoolOperator as q, borrowCoinPTB as z, depositCoinPTB as K, getBorrowFee as Q, getFees as V, getPool as Y, getPools as j, getStats as J, repayCoinPTB as W, withdrawCoinPTB as X } from "./pool.js";
8
+ import { claimLendingRewardsPTB as $, getUserAvailableLendingRewards as ee, getUserClaimedRewardHistory as te, getUserTotalClaimedReward as re, summaryLendingRewards as oe } from "./reward.js";
9
+ import { devInspectTransaction as ie, normalizeCoinType as ne, parsePoolUID as se, parseTxValue as le, withCache as de, withSingleton as ge } from "./utils.js";
10
+ import { createAccountCapPTB as Pe, getAccountCapOwnerPTB as pe } from "./account-cap.js";
11
+ import { createEModeCapPTB as Ce, emodeIdentityId as Te, enterEModePTB as Be, exitEModePTB as me, getUserEModeCaps as he } from "./emode.js";
12
+ import { DEFAULT_MARKET_IDENTITY as Ie, MARKETS as Fe, Market as ue, getMarket as ve, getMarketConfig as xe, getMarketConfigs as Le, getMarkets as Me, loadMarketConfigs as Se, registerMarketConfigs as ye } from "./market.js";
13
+ import { NaviMissingGraphQLClientError as Ue, PUBLIC_MAINNET_GRPC_URL as we, createNaviLegacyJsonRpcClient as Re, createNaviSuiClient as Ne, createNaviSuiClientBundle as Oe, getAddressBalance as ke, getCoinObjectOnlyBalance as He, listAddressBalances as _e, normalizeAddressBalance as De, requireNaviGraphQLClient as be } from "./sui.js";
14
+ import { SuiPriceServiceConnection as qe, SuiPythClient as ze } from "./pyth.js";
15
+ import { buildNaviOpenApiUrl as Qe, configureNaviSdk as Ve, mergeServiceHeaders as Ye, resolveNaviOpenApiEndpoint as je } from "./services.js";
16
16
  export {
17
17
  f as Address,
18
- v as DEFAULT_CACHE_TIME,
19
- Ae as DEFAULT_MARKET_IDENTITY,
18
+ u as DEFAULT_CACHE_TIME,
19
+ Ie as DEFAULT_MARKET_IDENTITY,
20
20
  C as FlashLoanAssetConfig,
21
21
  T as IncentiveAPYInfo,
22
22
  B as IncentivePoolInfo,
23
23
  m as IncentivePoolInfoByPhase,
24
- Ie as MARKETS,
24
+ Fe as MARKETS,
25
25
  ue as Market,
26
- Ee as NaviMissingGraphQLClientError,
26
+ Ue as NaviMissingGraphQLClientError,
27
27
  h as OracleInfo,
28
- Ue as PUBLIC_MAINNET_GRPC_URL,
29
- G as PoolOperator,
28
+ we as PUBLIC_MAINNET_GRPC_URL,
29
+ q as PoolOperator,
30
30
  A as ReserveDataInfo,
31
- Ge as SuiPriceServiceConnection,
32
- qe as SuiPythClient,
31
+ qe as SuiPriceServiceConnection,
32
+ ze as SuiPythClient,
33
33
  r as UserPositions,
34
34
  I as UserStateInfo,
35
- q as borrowCoinPTB,
36
- Ke as buildNaviOpenApiUrl,
37
- Z as claimLendingRewardsPTB,
38
- Qe as configureNaviSdk,
39
- ce as createAccountCapPTB,
40
- fe as createEModeCapPTB,
41
- we as createNaviLegacyJsonRpcClient,
35
+ z as borrowCoinPTB,
36
+ Qe as buildNaviOpenApiUrl,
37
+ $ as claimLendingRewardsPTB,
38
+ Ve as configureNaviSdk,
39
+ Pe as createAccountCapPTB,
40
+ Ce as createEModeCapPTB,
41
+ Re as createNaviLegacyJsonRpcClient,
42
42
  Ne as createNaviSuiClient,
43
- Re as createNaviSuiClientBundle,
44
- z as depositCoinPTB,
45
- ae as devInspectTransaction,
46
- Ce as emodeIdentityId,
47
- Te as enterEModePTB,
48
- Be as exitEModePTB,
43
+ Oe as createNaviSuiClientBundle,
44
+ K as depositCoinPTB,
45
+ ie as devInspectTransaction,
46
+ Te as emodeIdentityId,
47
+ Be as enterEModePTB,
48
+ me as exitEModePTB,
49
49
  L as filterPriceFeeds,
50
- R as flashloanPTB,
51
- Pe as getAccountCapOwnerPTB,
52
- Oe as getAddressBalance,
53
- O as getAllFlashLoanAssets,
54
- K as getBorrowFee,
55
- ke as getCoinObjectOnlyBalance,
50
+ O as flashloanPTB,
51
+ pe as getAccountCapOwnerPTB,
52
+ ke as getAddressBalance,
53
+ k as getAllFlashLoanAssets,
54
+ Q as getBorrowFee,
55
+ He as getCoinObjectOnlyBalance,
56
56
  o as getCoins,
57
- F as getConfig,
58
- Q as getFees,
59
- k as getFlashLoanAsset,
57
+ v as getConfig,
58
+ V as getFees,
59
+ H as getFlashLoanAsset,
60
60
  a as getHealthFactor,
61
61
  i as getHealthFactorPTB,
62
62
  n as getLendingPositions,
63
63
  s as getLendingState,
64
64
  ve as getMarket,
65
- Fe as getMarketConfig,
66
- xe as getMarketConfigs,
67
- Le as getMarkets,
68
- V as getPool,
69
- Y as getPools,
65
+ xe as getMarketConfig,
66
+ Le as getMarketConfigs,
67
+ Me as getMarkets,
68
+ Y as getPool,
69
+ j as getPools,
70
70
  M as getPriceFeeds,
71
71
  S as getPythStalePriceFeedId,
72
72
  y as getPythStalePriceFeedIdV2,
73
73
  l as getSimulatedHealthFactor,
74
74
  d as getSimulatedHealthFactorPTB,
75
- j as getStats,
75
+ J as getStats,
76
76
  g as getTransactions,
77
- $ as getUserAvailableLendingRewards,
78
- ee as getUserClaimedRewardHistory,
79
- me as getUserEModeCaps,
80
- te as getUserTotalClaimedReward,
81
- D as liquidatePTB,
82
- He as listAddressBalances,
83
- Me as loadMarketConfigs,
77
+ ee as getUserAvailableLendingRewards,
78
+ te as getUserClaimedRewardHistory,
79
+ he as getUserEModeCaps,
80
+ re as getUserTotalClaimedReward,
81
+ E as isRatioPriceFeed,
82
+ b as liquidatePTB,
83
+ _e as listAddressBalances,
84
+ Se as loadMarketConfigs,
84
85
  c as mergeCoinsPTB,
85
- Ve as mergeServiceHeaders,
86
- _e as normalizeAddressBalance,
87
- ie as normalizeCoinType,
88
- ne as parsePoolUID,
89
- se as parseTxValue,
90
- Se as registerMarketConfigs,
91
- J as repayCoinPTB,
92
- H as repayFlashLoanPTB,
93
- De as requireNaviGraphQLClient,
94
- Ye as resolveNaviOpenApiEndpoint,
95
- re as summaryLendingRewards,
96
- E as updateOraclePriceBeforeUserOperationPTB,
97
- U as updateOraclePricesPTB,
98
- w as updatePythPriceFeeds,
86
+ Ye as mergeServiceHeaders,
87
+ De as normalizeAddressBalance,
88
+ ne as normalizeCoinType,
89
+ se as parsePoolUID,
90
+ le as parseTxValue,
91
+ ye as registerMarketConfigs,
92
+ W as repayCoinPTB,
93
+ _ as repayFlashLoanPTB,
94
+ be as requireNaviGraphQLClient,
95
+ je as resolveNaviOpenApiEndpoint,
96
+ oe as summaryLendingRewards,
97
+ U as updateOraclePriceBeforeUserOperationPTB,
98
+ w as updateOraclePricesPTB,
99
+ R as updatePythPriceFeeds,
99
100
  P as verifyHealthFactorPTB,
100
- le as withCache,
101
- de as withSingleton,
102
- W as withdrawCoinPTB
101
+ de as withCache,
102
+ ge as withSingleton,
103
+ X as withdrawCoinPTB
103
104
  };
104
105
  //# sourceMappingURL=index.js.map
package/dist/oracle.d.ts CHANGED
@@ -65,12 +65,22 @@ export declare function updateOraclePricesPTB(tx: Transaction, priceFeeds: Oracl
65
65
  * @returns Array of oracle price feed configurations
66
66
  */
67
67
  export declare function getPriceFeeds(options?: Partial<EnvOption & ServiceOption>): Promise<OraclePriceFeed[]>;
68
+ /**
69
+ * Whether a price feed is a composite ratio feed (it carries `ratioOracleId`) rather than an
70
+ * asset's own price feed. Use it to pick the asset's own feed when looking one up by oracle id or
71
+ * coin type: a composite asset has two entries under its oracle id.
72
+ */
73
+ export declare function isRatioPriceFeed(feed: Pick<OraclePriceFeed, 'ratioOracleId'>): boolean;
68
74
  /**
69
75
  * Filter price feeds based on lending state and pools
70
76
  *
71
77
  * This function filters price feeds to only include those that are relevant
72
78
  * to the current lending state or available pools.
73
79
  *
80
+ * A composite asset (e.g. vSUI priced at SUI/USD x VSUI/SUI.RR) lists its ratio feed under the
81
+ * asset's own oracle id, so the ratio feed is kept whenever the asset is: the contract reads the
82
+ * asset's price as valid only while both feeds are fresh.
83
+ *
74
84
  * @param feeds - Array of price feeds to filter
75
85
  * @param filters - Filter criteria including lending state and pools
76
86
  * @returns Filtered array of price feeds
@@ -1 +1 @@
1
- {"version":3,"file":"oracle.d.ts","sourceRoot":"","sources":["../src/oracle.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EACV,eAAe,EACf,SAAS,EACT,eAAe,EACf,IAAI,EACJ,eAAe,EACf,YAAY,EACZ,eAAe,EACf,aAAa,EACb,yBAAyB,EAC1B,MAAM,SAAS,CAAA;AAEhB,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AAItD,KAAK,QAAQ,GAAG;IACd,WAAW,EAAE,MAAM,CAAA;IACnB,eAAe,EAAE,MAAM,CAAA;IACvB,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB,CAAA;AAED,MAAM,MAAM,aAAa,GAAG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AAe,EAAE,CAAA;CACrC,GACA,eAAe,EAAE,CA0CnB;AAED,wBAAsB,uCAAuC,CAC3D,EAAE,EAAE,WAAW,EACf,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,IAAI,EAAE,EACb,OAAO,CAAC,EAAE,OAAO,CACf,SAAS,GACP,eAAe,GACf,YAAY,GAAG;IACb,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,WAAW,CAAC,EAAE,yBAAyB,CAAA;CACxC,CACJ,wBAqDF"}
package/dist/oracle.js CHANGED
@@ -1,48 +1,48 @@
1
- import { getConfig as p, DEFAULT_CACHE_TIME as l } from "./config.js";
1
+ import { getConfig as l, DEFAULT_CACHE_TIME as p } from "./config.js";
2
2
  import { SuiPythClient as F, SuiPriceServiceConnection as j } from "./pyth.js";
3
- import { suiClient as b, multiGetSuiObjects as T } from "./utils.js";
4
- import { getLendingPositions as O } from "./account.js";
5
- const h = /* @__PURE__ */ new Map(), y = (i) => {
6
- const c = i ?? "https://hermes.pyth.network";
3
+ import { suiClient as b, multiGetSuiObjects as O } from "./utils.js";
4
+ import { getLendingPositions as T } from "./account.js";
5
+ const h = /* @__PURE__ */ new Map(), y = (t) => {
6
+ const c = t ?? "https://hermes.pyth.network";
7
7
  let e = h.get(c);
8
8
  return e || (e = new j(c, { timeout: 1e4 }), h.set(c, e)), e;
9
9
  };
10
- async function A(i, c) {
10
+ async function A(t, c) {
11
11
  try {
12
- const e = [], o = await p({ ...c, cacheTime: l }), t = await y(
12
+ const e = [], o = await l({ ...c, cacheTime: p }), i = await y(
13
13
  o.oracle.hermesEndpoint
14
- ).getLatestPriceFeeds(i);
15
- if (!t) return e;
16
- const n = Math.floor((/* @__PURE__ */ new Date()).valueOf() / 1e3);
17
- for (const r of t) {
18
- const a = r.getPriceUnchecked();
19
- if (a.publishTime > n) {
14
+ ).getLatestPriceFeeds(t);
15
+ if (!i) return e;
16
+ const r = Math.floor((/* @__PURE__ */ new Date()).valueOf() / 1e3);
17
+ for (const n of i) {
18
+ const a = n.getPriceUnchecked();
19
+ if (a.publishTime > r) {
20
20
  console.warn(
21
- `pyth price feed is invalid, id: ${r.id}, publish time: ${a.publishTime}, current timestamp: ${n}`
21
+ `pyth price feed is invalid, id: ${n.id}, publish time: ${a.publishTime}, current timestamp: ${r}`
22
22
  );
23
23
  continue;
24
24
  }
25
- n - r.getPriceUnchecked().publishTime > 30 && (console.info(
26
- `stale price feed, id: ${r.id}, publish time: ${a.publishTime}, current timestamp: ${n}`
27
- ), e.push(r.id));
25
+ r - n.getPriceUnchecked().publishTime > 30 && (console.info(
26
+ `stale price feed, id: ${n.id}, publish time: ${a.publishTime}, current timestamp: ${r}`
27
+ ), e.push(n.id));
28
28
  }
29
29
  return e;
30
30
  } catch (e) {
31
31
  throw new Error(`failed to get pyth stale price feed id, msg: ${e.message}`);
32
32
  }
33
33
  }
34
- async function $(i, c) {
35
- const e = [], o = c?.client ?? b, t = i.map((r) => r.priceInfoObject), n = await T(o, {
36
- ids: Array.from(new Set(t)),
34
+ async function $(t, c) {
35
+ const e = [], o = c?.client ?? b, i = t.map((n) => n.priceInfoObject), r = await O(o, {
36
+ ids: Array.from(new Set(i)),
37
37
  options: { showContent: !0 }
38
38
  });
39
- for (const r of n) {
40
- const a = r.data;
39
+ for (const n of r) {
40
+ const a = n.data;
41
41
  if (!a || !a.content || a.content.dataType !== "moveObject") {
42
42
  console.warn(`fetched object ${a?.objectId} datatype should be moveObject`);
43
43
  continue;
44
44
  }
45
- const d = i.find((w) => w.priceInfoObject == a.objectId);
45
+ const d = t.find((w) => w.priceInfoObject == a.objectId);
46
46
  if (!d) {
47
47
  console.warn(`unable to find pyth info from array, priceInfoObject: ${a.objectId}`);
48
48
  continue;
@@ -52,146 +52,149 @@ async function $(i, c) {
52
52
  console.warn(`unexpected pyth price struct, priceInfoObject: ${a.objectId}`);
53
53
  continue;
54
54
  }
55
- const { magnitude: f, negative: g } = u, P = s.conf, I = s.timestamp;
55
+ const { magnitude: f, negative: P } = u, g = s.conf, I = s.timestamp;
56
56
  e.push({
57
57
  priceFeedId: d.priceFeedId,
58
58
  priceInfoObject: d.priceInfoObject,
59
- price: g ? "-" + f : f,
60
- conf: P,
59
+ price: P ? "-" + f : f,
60
+ conf: g,
61
61
  publishTime: Number(I),
62
62
  expiration: d.expiration
63
63
  });
64
64
  }
65
65
  return e;
66
66
  }
67
- async function v(i, c) {
67
+ async function v(t, c) {
68
68
  try {
69
- const e = [], o = await $(i, c);
69
+ const e = [], o = await $(t, c);
70
70
  if (!o) return e;
71
- const t = Math.floor((/* @__PURE__ */ new Date()).valueOf() / 1e3);
72
- for (const n of o) {
73
- if (n.publishTime > t) {
71
+ const i = Math.floor((/* @__PURE__ */ new Date()).valueOf() / 1e3);
72
+ for (const r of o) {
73
+ if (r.publishTime > i) {
74
74
  console.warn(
75
- `pyth price feed is invalid, id: ${n.priceFeedId}, publish time: ${n.publishTime}, current timestamp: ${t}`
75
+ `pyth price feed is invalid, id: ${r.priceFeedId}, publish time: ${r.publishTime}, current timestamp: ${i}`
76
76
  );
77
77
  continue;
78
78
  }
79
- const r = n.expiration || 60;
80
- t - n.publishTime > r && (console.info(
81
- `stale price feed, id: ${n.priceFeedId}, publish time: ${n.publishTime}, current timestamp: ${t}`
82
- ), e.push(n.priceFeedId));
79
+ const n = r.expiration || 60;
80
+ i - r.publishTime > n && (console.info(
81
+ `stale price feed, id: ${r.priceFeedId}, publish time: ${r.publishTime}, current timestamp: ${i}`
82
+ ), e.push(r.priceFeedId));
83
83
  }
84
84
  return e;
85
85
  } catch (e) {
86
86
  throw new Error(`failed to get pyth stale price feed id, msg: ${e.message}`);
87
87
  }
88
88
  }
89
- async function C(i, c, e) {
90
- const o = e?.client ?? b, t = await p({
89
+ async function C(t, c, e) {
90
+ const o = e?.client ?? b, i = await l({
91
91
  ...e,
92
- cacheTime: l
92
+ cacheTime: p
93
93
  });
94
94
  try {
95
- const n = await y(
96
- t.oracle.hermesEndpoint
95
+ const r = await y(
96
+ i.oracle.hermesEndpoint
97
97
  ).getPriceFeedsUpdateData(c);
98
98
  return await new F(
99
99
  o,
100
- t.oracle.pythStateId,
101
- t.oracle.wormholeStateId
102
- ).updatePriceFeeds(i, n, c, {
100
+ i.oracle.pythStateId,
101
+ i.oracle.wormholeStateId
102
+ ).updatePriceFeeds(t, r, c, {
103
103
  feeCoin: e?.pythFeeCoin
104
104
  });
105
- } catch (n) {
106
- throw new Error(`failed to update pyth price feeds, msg: ${n.message}`);
105
+ } catch (r) {
106
+ throw new Error(`failed to update pyth price feeds, msg: ${r.message}`);
107
107
  }
108
108
  }
109
- async function m(i, c, e) {
110
- const o = await p({
109
+ async function m(t, c, e) {
110
+ const o = await l({
111
111
  ...e,
112
- cacheTime: l
112
+ cacheTime: p
113
113
  });
114
114
  if (e?.updatePythPriceFeeds) {
115
- const t = c.filter((r) => !!r.pythPriceFeedId && !!r.pythPriceInfoObject).map((r) => ({
116
- priceFeedId: r.pythPriceFeedId,
117
- priceInfoObject: r.pythPriceInfoObject,
115
+ const i = c.filter((n) => !!n.pythPriceFeedId && !!n.pythPriceInfoObject).map((n) => ({
116
+ priceFeedId: n.pythPriceFeedId,
117
+ priceInfoObject: n.pythPriceInfoObject,
118
118
  expiration: 30
119
- })), n = await v(t, e);
120
- n.length > 0 && await C(i, n, e);
119
+ })), r = await v(i, e);
120
+ r.length > 0 && await C(t, r, e);
121
121
  }
122
- for (const t of c)
123
- i.moveCall({
122
+ for (const i of c)
123
+ t.moveCall({
124
124
  target: `${o.oracle.packageId}::oracle_pro::${o.oracle.updateFunction ?? "update_single_price_v2"}`,
125
125
  arguments: [
126
- i.object("0x6"),
126
+ t.object("0x6"),
127
127
  // Clock object
128
- i.object(o.oracle.oracleConfig),
128
+ t.object(o.oracle.oracleConfig),
129
129
  // Oracle configuration
130
- i.object(o.oracle.priceOracle),
130
+ t.object(o.oracle.priceOracle),
131
131
  // Price oracle contract
132
- i.object(o.oracle.supraOracleHolder),
132
+ t.object(o.oracle.supraOracleHolder),
133
133
  // Supra oracle holder
134
- i.object(t.pythPriceInfoObject),
134
+ t.object(i.pythPriceInfoObject),
135
135
  // Pyth price info object
136
- i.object(o.oracle.switchboardAggregator),
137
- i.pure.address(t.feedId)
136
+ t.object(o.oracle.switchboardAggregator),
137
+ t.pure.address(i.feedId)
138
138
  // Price feed ID
139
139
  ]
140
140
  });
141
- return i;
141
+ return t;
142
142
  }
143
- async function S(i) {
144
- return (await p({
145
- ...i,
146
- cacheTime: l
143
+ async function S(t) {
144
+ return (await l({
145
+ ...t,
146
+ cacheTime: p
147
147
  })).oracle.feeds;
148
148
  }
149
- function E(i, c) {
150
- return i.filter((e) => !!(c?.lendingState && c.lendingState.find((t) => e.oracleId === t.pool.oracleId) || c?.lendingPositions && c.lendingPositions.find((t) => {
149
+ function M(t) {
150
+ return t.ratioOracleId !== void 0 && t.ratioOracleId !== null;
151
+ }
152
+ function E(t, c) {
153
+ return t.filter((e) => !!(c?.lendingState && c.lendingState.find((i) => e.oracleId === i.pool.oracleId) || c?.lendingPositions && c.lendingPositions.find((i) => {
151
154
  if (![
152
155
  "navi-lending-supply",
153
156
  "navi-lending-borrow",
154
157
  "navi-lending-emode-supply",
155
158
  "navi-lending-emode-borrow"
156
- ].includes(t.type))
159
+ ].includes(i.type))
157
160
  return !1;
158
- const r = t[t.type]?.pool;
159
- return e.oracleId === r?.oracleId;
160
- }) || c?.pools && c.pools.find((t) => e.oracleId === t.oracleId)));
161
+ const n = i[i.type]?.pool;
162
+ return e.oracleId === n?.oracleId;
163
+ }) || c?.pools && c.pools.find((i) => e.oracleId === i.oracleId)));
161
164
  }
162
- async function M(i, c, e, o) {
163
- let t;
165
+ async function B(t, c, e, o) {
166
+ let i;
164
167
  try {
165
- const n = await S({
168
+ const r = await S({
166
169
  ...o
167
- }), r = [];
170
+ }), n = [];
168
171
  e.forEach((s) => {
169
- r.includes(s.market) || r.push(s.market);
172
+ n.includes(s.market) || n.push(s.market);
170
173
  });
171
- const a = await O(c, {
174
+ const a = await T(c, {
172
175
  ...o,
173
- markets: r
176
+ markets: n
174
177
  });
175
- return t = E(n, {
178
+ return i = E(r, {
176
179
  lendingPositions: a,
177
180
  pools: e
178
- }), await m(i, t, {
181
+ }), await m(t, i, {
179
182
  updatePythPriceFeeds: !0,
180
183
  ...o
181
184
  });
182
- } catch (n) {
185
+ } catch (r) {
183
186
  if (o?.throws)
184
- throw n;
185
- if (console.error(n), t)
187
+ throw r;
188
+ if (console.error(r), i)
186
189
  try {
187
- return await m(i, t, {
190
+ return await m(t, i, {
188
191
  ...o,
189
192
  updatePythPriceFeeds: !1
190
193
  });
191
- } catch (r) {
192
- console.error(r);
194
+ } catch (n) {
195
+ console.error(n);
193
196
  }
194
- return i;
197
+ return t;
195
198
  }
196
199
  }
197
200
  export {
@@ -199,7 +202,8 @@ export {
199
202
  S as getPriceFeeds,
200
203
  A as getPythStalePriceFeedId,
201
204
  v as getPythStalePriceFeedIdV2,
202
- M as updateOraclePriceBeforeUserOperationPTB,
205
+ M as isRatioPriceFeed,
206
+ B as updateOraclePriceBeforeUserOperationPTB,
203
207
  m as updateOraclePricesPTB,
204
208
  C as updatePythPriceFeeds
205
209
  };
@@ -1 +1 @@
1
- {"version":3,"file":"oracle.js","sources":["../src/oracle.ts"],"sourcesContent":["/**\n * Oracle Price Feed Management for Lending Protocol\n *\n * This module provides oracle price feed functionality for the lending protocol.\n * It integrates with Pyth Network for real-time price data and manages price updates\n * for various assets used in lending operations.\n */\n\nimport { getConfig, DEFAULT_CACHE_TIME } from './config'\nimport type {\n OraclePriceFeed,\n EnvOption,\n UserLendingInfo,\n Pool,\n SuiClientOption,\n MarketOption,\n LendingPosition,\n ServiceOption,\n TransactionObjectArgument\n} from './types'\nimport { SuiPriceServiceConnection, SuiPythClient } from './pyth'\nimport { Transaction } from '@mysten/sui/transactions'\nimport { multiGetSuiObjects, suiClient } from './utils'\nimport { getLendingPositions } from './account'\n\ntype PythInfo = {\n priceFeedId: string\n priceInfoObject: string\n expiration?: number\n}\n\nexport type PythPriceInfo = {\n priceFeedId: string\n priceInfoObject: string\n price: string\n conf: string\n publishTime: number\n expiration?: number\n}\n\n/**\n * Pyth Network connection for price feed data\n * Connects to the Hermes endpoint for real-time price updates\n */\nconst pythConnections = new Map<string, SuiPriceServiceConnection>()\nconst getPythConnection = (endpoint?: string) => {\n const url = endpoint ?? 'https://hermes.pyth.network'\n let conn = pythConnections.get(url)\n if (!conn) {\n conn = new SuiPriceServiceConnection(url, { timeout: 10000 })\n pythConnections.set(url, conn)\n }\n return conn\n}\n\n/**\n * Get stale price feed IDs from Pyth Network\n *\n * Identifies price feeds that have not been updated recently (more than 30 seconds old).\n * This helps ensure that only fresh price data is used for lending operations.\n *\n * @param priceIds - Array of Pyth price feed IDs to check\n * @returns Array of stale price feed IDs that need updating\n * @throws Error if failed to fetch price feed data\n */\nexport async function getPythStalePriceFeedId(\n priceIds: string[],\n options?: Partial<EnvOption & MarketOption>\n): Promise<string[]> {\n try {\n const returnData: string[] = []\n const config = await getConfig({ ...options, cacheTime: DEFAULT_CACHE_TIME })\n const latestPriceFeeds = await getPythConnection(\n config.oracle.hermesEndpoint\n ).getLatestPriceFeeds(priceIds)\n if (!latestPriceFeeds) return returnData\n\n const currentTimestamp = Math.floor(new Date().valueOf() / 1000)\n for (const priceFeed of latestPriceFeeds) {\n const uncheckedPrice = priceFeed.getPriceUnchecked()\n if (uncheckedPrice.publishTime > currentTimestamp) {\n console.warn(\n `pyth price feed is invalid, id: ${priceFeed.id}, publish time: ${uncheckedPrice.publishTime}, current timestamp: ${currentTimestamp}`\n )\n continue\n }\n\n // From pyth state is 60, but setting it to 30 makes more sense.\n if (currentTimestamp - priceFeed.getPriceUnchecked().publishTime > 30) {\n console.info(\n `stale price feed, id: ${priceFeed.id}, publish time: ${uncheckedPrice.publishTime}, current timestamp: ${currentTimestamp}`\n )\n returnData.push(priceFeed.id)\n }\n }\n return returnData\n } catch (error) {\n throw new Error(`failed to get pyth stale price feed id, msg: ${(error as Error).message}`)\n }\n}\n\nasync function getOnChainPriceInfo(\n pythInfos: PythInfo[],\n options?: Partial<SuiClientOption>\n): Promise<PythPriceInfo[]> {\n // Whole-read failures (endpoint/RPC errors) propagate to the caller:\n // swallowing them here would silently skip the Pyth staleness update and let\n // transactions build against stale on-chain prices. Only per-feed anomalies\n // are skipped below.\n const priceInfos: PythPriceInfo[] = []\n const client = options?.client ?? suiClient\n\n const priceInfoObjectIds = pythInfos.map((k) => k.priceInfoObject)\n const priceInfoObjects = await multiGetSuiObjects(client, {\n ids: Array.from(new Set(priceInfoObjectIds)),\n options: { showContent: true }\n })\n for (const obj of priceInfoObjects) {\n const data = obj.data\n if (!data || !data.content || data.content.dataType !== 'moveObject') {\n console.warn(`fetched object ${data?.objectId} datatype should be moveObject`)\n continue\n }\n\n const pythInfo = pythInfos.find((v) => v.priceInfoObject == data.objectId)\n if (!pythInfo) {\n console.warn(`unable to find pyth info from array, priceInfoObject: ${data.objectId}`)\n continue\n }\n\n // The Sui v2 client returns nested Move structs directly, without the\n // per-level `.fields` wrapper the legacy JSON-RPC object shape carried.\n // Read the flattened shape and skip (not throw) on an unexpected object so\n // a single malformed feed can't abort the whole batch and silently leave\n // every on-chain price un-refreshed.\n // @ts-ignore\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n const priceStruct = data.content.fields?.price_info?.price_feed?.price\n const priceValue = priceStruct?.price\n if (!priceValue) {\n console.warn(`unexpected pyth price struct, priceInfoObject: ${data.objectId}`)\n continue\n }\n const { magnitude, negative } = priceValue\n const conf = priceStruct.conf\n const timestamp = priceStruct.timestamp\n\n priceInfos.push({\n priceFeedId: pythInfo.priceFeedId,\n priceInfoObject: pythInfo.priceInfoObject,\n price: negative ? '-' + magnitude : magnitude,\n conf,\n publishTime: Number(timestamp),\n expiration: pythInfo.expiration\n })\n }\n return priceInfos\n}\n\nexport async function getPythStalePriceFeedIdV2(\n pythInfos: PythInfo[],\n options?: Partial<SuiClientOption>\n): Promise<string[]> {\n try {\n const returnData: string[] = []\n const latestPriceFeeds = await getOnChainPriceInfo(pythInfos, options)\n if (!latestPriceFeeds) return returnData\n\n const currentTimestamp = Math.floor(new Date().valueOf() / 1000)\n\n for (const priceFeed of latestPriceFeeds) {\n if (priceFeed.publishTime > currentTimestamp) {\n console.warn(\n `pyth price feed is invalid, id: ${priceFeed.priceFeedId}, publish time: ${priceFeed.publishTime}, current timestamp: ${currentTimestamp}`\n )\n continue\n }\n\n const maxTime = priceFeed.expiration || 60\n // 3s is the margin of error for the price feed.\n if (currentTimestamp - priceFeed.publishTime > maxTime) {\n console.info(\n `stale price feed, id: ${priceFeed.priceFeedId}, publish time: ${priceFeed.publishTime}, current timestamp: ${currentTimestamp}`\n )\n returnData.push(priceFeed.priceFeedId)\n }\n }\n return returnData\n } catch (error) {\n throw new Error(`failed to get pyth stale price feed id, msg: ${(error as Error).message}`)\n }\n}\n\n/**\n * Update Pyth price feeds in a transaction\n *\n * Fetches the latest price update data from Pyth Network and adds the update\n * operations to the transaction block.\n *\n * @param tx - The transaction block to add price feed updates to\n * @param priceFeedIds - Array of Pyth price feed IDs to update\n * @param options - Optional client and environment configuration\n * @returns Promise that resolves when price feeds are updated\n * @throws Error if failed to update price feeds\n */\nexport async function updatePythPriceFeeds(\n tx: Transaction,\n priceFeedIds: string[],\n options?: Partial<\n SuiClientOption &\n EnvOption &\n MarketOption & {\n pythFeeCoin?: TransactionObjectArgument\n }\n >\n) {\n const client = options?.client ?? suiClient\n const config = await getConfig({\n ...options,\n cacheTime: DEFAULT_CACHE_TIME\n })\n try {\n const priceUpdateData = await getPythConnection(\n config.oracle.hermesEndpoint\n ).getPriceFeedsUpdateData(priceFeedIds)\n const suiPythClient = new SuiPythClient(\n client as any,\n config.oracle.pythStateId,\n config.oracle.wormholeStateId\n )\n\n return await suiPythClient.updatePriceFeeds(tx as any, priceUpdateData, priceFeedIds, {\n feeCoin: options?.pythFeeCoin\n })\n } catch (error) {\n throw new Error(`failed to update pyth price feeds, msg: ${(error as Error).message}`)\n }\n}\n\n/**\n * Update oracle prices in the PTB (Programmable Transaction Block)\n *\n * This function updates price feeds for the lending protocol. It can optionally\n * update Pyth price feeds first if they are stale, then updates individual\n * price feeds in the oracle contract.\n *\n * @param tx - The transaction block to add price update operations to\n * @param priceFeeds - Array of oracle price feeds to update\n * @param options - Optional configuration including whether to update Pyth feeds\n * @returns The updated transaction block\n */\nexport async function updateOraclePricesPTB(\n tx: Transaction,\n priceFeeds: OraclePriceFeed[],\n options?: Partial<\n EnvOption &\n SuiClientOption &\n ServiceOption &\n MarketOption & {\n updatePythPriceFeeds?: boolean\n /** Optional user-owned SUI coin used for Pyth update fees. Defaults to `tx.gas`. */\n pythFeeCoin?: TransactionObjectArgument\n }\n >\n): Promise<Transaction> {\n const config = await getConfig({\n ...options,\n cacheTime: DEFAULT_CACHE_TIME\n })\n\n // Optionally update Pyth price feeds if they are stale\n if (options?.updatePythPriceFeeds) {\n const pythInfos = priceFeeds\n .filter((feed) => !!feed.pythPriceFeedId && !!feed.pythPriceInfoObject)\n .map((feed) => ({\n priceFeedId: feed.pythPriceFeedId,\n priceInfoObject: feed.pythPriceInfoObject,\n expiration: 30\n }))\n\n // Do not silently swallow Pyth stale-price update failures: the previous\n // catch kept building the tx with possibly stale on-chain prices and masked\n // real endpoint/RPC errors. Throw so callers are aware (avoids\n // lending/liquidation based on stale prices).\n const stalePriceFeedIds = await getPythStalePriceFeedIdV2(pythInfos, options)\n if (stalePriceFeedIds.length > 0) {\n await updatePythPriceFeeds(tx, stalePriceFeedIds, options)\n }\n }\n\n // Update individual price feeds in the oracle contract\n for (const priceFeed of priceFeeds) {\n tx.moveCall({\n target: `${config.oracle.packageId}::oracle_pro::${config.oracle.updateFunction ?? 'update_single_price_v2'}`,\n arguments: [\n tx.object('0x6'), // Clock object\n tx.object(config.oracle.oracleConfig), // Oracle configuration\n tx.object(config.oracle.priceOracle), // Price oracle contract\n tx.object(config.oracle.supraOracleHolder), // Supra oracle holder\n tx.object(priceFeed.pythPriceInfoObject), // Pyth price info object\n tx.object(config.oracle.switchboardAggregator),\n tx.pure.address(priceFeed.feedId) // Price feed ID\n ]\n })\n }\n return tx\n}\n\n/**\n * Get all available price feeds from the configuration\n *\n * @param options - Optional environment configuration\n * @returns Array of oracle price feed configurations\n */\nexport async function getPriceFeeds(\n options?: Partial<EnvOption & ServiceOption>\n): Promise<OraclePriceFeed[]> {\n const config = await getConfig({\n ...options,\n cacheTime: DEFAULT_CACHE_TIME\n })\n return config.oracle.feeds\n}\n\n/**\n * Filter price feeds based on lending state and pools\n *\n * This function filters price feeds to only include those that are relevant\n * to the current lending state or available pools.\n *\n * @param feeds - Array of price feeds to filter\n * @param filters - Filter criteria including lending state and pools\n * @returns Filtered array of price feeds\n */\nexport function filterPriceFeeds(\n feeds: OraclePriceFeed[],\n filters: {\n lendingState?: UserLendingInfo[]\n pools?: Pool[]\n lendingPositions?: LendingPosition[]\n }\n): OraclePriceFeed[] {\n return feeds.filter((feed) => {\n // Filter by lending state (user's current positions)\n if (filters?.lendingState) {\n const inState = filters.lendingState.find((state) => {\n return feed.oracleId === state.pool.oracleId\n })\n if (inState) {\n return true\n }\n }\n\n if (filters?.lendingPositions) {\n const inPosition = filters.lendingPositions.find((position) => {\n const availableTypes = [\n 'navi-lending-supply',\n 'navi-lending-borrow',\n 'navi-lending-emode-supply',\n 'navi-lending-emode-borrow'\n ]\n if (!availableTypes.includes(position.type)) {\n return false\n }\n const pool = position[position.type]?.pool\n return feed.oracleId === pool?.oracleId\n })\n if (inPosition) {\n return true\n }\n }\n\n // Filter by available pools\n if (filters?.pools) {\n const inPool = filters.pools.find((pool) => {\n return feed.oracleId === pool.oracleId\n })\n if (inPool) {\n return true\n }\n }\n return false\n })\n}\n\nexport async function updateOraclePriceBeforeUserOperationPTB(\n tx: Transaction,\n address: string,\n pools: Pool[],\n options?: Partial<\n EnvOption &\n SuiClientOption &\n MarketOption & {\n throws?: boolean\n pythFeeCoin?: TransactionObjectArgument\n }\n >\n) {\n let relevantFeeds: OraclePriceFeed[] | undefined\n try {\n const allPriceFeeds = await getPriceFeeds({\n ...options\n })\n\n const markets = [] as string[]\n\n pools.forEach((pool) => {\n if (!markets.includes(pool.market)) {\n markets.push(pool.market)\n }\n })\n\n const lendingPositions = await getLendingPositions(address, {\n ...options,\n markets\n })\n\n relevantFeeds = filterPriceFeeds(allPriceFeeds, {\n lendingPositions,\n pools\n })\n\n const updatedTx = await updateOraclePricesPTB(tx, relevantFeeds, {\n updatePythPriceFeeds: true,\n ...options\n })\n return updatedTx\n } catch (e) {\n if (options?.throws) {\n throw e\n }\n console.error(e)\n // Degraded path: a Pyth refresh failure happens before any moveCall is\n // appended, so the tx is still clean. Retry the oracle update without the\n // Pyth feed refresh (matches the pre-v2 behavior where Pyth failures were\n // swallowed but update_single_price calls were still appended) instead of\n // dropping the oracle update entirely.\n if (relevantFeeds) {\n try {\n return await updateOraclePricesPTB(tx, relevantFeeds, {\n ...options,\n updatePythPriceFeeds: false\n })\n } catch (fallbackError) {\n console.error(fallbackError)\n }\n }\n return tx\n }\n}\n"],"names":["pythConnections","getPythConnection","endpoint","url","conn","SuiPriceServiceConnection","getPythStalePriceFeedId","priceIds","options","returnData","config","getConfig","DEFAULT_CACHE_TIME","latestPriceFeeds","currentTimestamp","priceFeed","uncheckedPrice","error","getOnChainPriceInfo","pythInfos","priceInfos","client","suiClient","priceInfoObjectIds","k","priceInfoObjects","multiGetSuiObjects","obj","data","pythInfo","v","priceStruct","priceValue","magnitude","negative","conf","timestamp","getPythStalePriceFeedIdV2","maxTime","updatePythPriceFeeds","tx","priceFeedIds","priceUpdateData","SuiPythClient","updateOraclePricesPTB","priceFeeds","feed","stalePriceFeedIds","getPriceFeeds","filterPriceFeeds","feeds","filters","state","position","pool","updateOraclePriceBeforeUserOperationPTB","address","pools","relevantFeeds","allPriceFeeds","markets","lendingPositions","getLendingPositions","e","fallbackError"],"mappings":";;;;AA4CA,MAAMA,wBAAsB,IAAA,GACtBC,IAAoB,CAACC,MAAsB;AAC/C,QAA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AAG;AACtC,WAAOP,EAAK,aAAaQ,GAAM;AAAA,EACjC,CAAC,KAOCH,GAAS,SACIA,EAAQ,MAAM,KAAK,CAACG,MAC1BR,EAAK,aAAaQ,EAAK,QAC/B,EAMJ;AACH;AAEA,eAAsBC,EACpBf,GACAgB,GACAC,GACAjD,GAQA;AACA,MAAIkD;AACJ,MAAI;AACF,UAAMC,IAAgB,MAAMX,EAAc;AAAA,MACxC,GAAGxC;AAAA,IAAA,CACJ,GAEKoD,IAAU,CAAA;AAEhB,IAAAH,EAAM,QAAQ,CAACH,MAAS;AACtB,MAAKM,EAAQ,SAASN,EAAK,MAAM,KAC/BM,EAAQ,KAAKN,EAAK,MAAM;AAAA,IAE5B,CAAC;AAED,UAAMO,IAAmB,MAAMC,EAAoBN,GAAS;AAAA,MAC1D,GAAGhD;AAAA,MACH,SAAAoD;AAAA,IAAA,CACD;AAED,WAAAF,IAAgBT,EAAiBU,GAAe;AAAA,MAC9C,kBAAAE;AAAA,MACA,OAAAJ;AAAA,IAAA,CACD,GAEiB,MAAMb,EAAsBJ,GAAIkB,GAAe;AAAA,MAC/D,sBAAsB;AAAA,MACtB,GAAGlD;AAAA,IAAA,CACJ;AAAA,EAEH,SAASuD,GAAG;AACV,QAAIvD,GAAS;AACX,YAAMuD;AAQR,QANA,QAAQ,MAAMA,CAAC,GAMXL;AACF,UAAI;AACF,eAAO,MAAMd,EAAsBJ,GAAIkB,GAAe;AAAA,UACpD,GAAGlD;AAAA,UACH,sBAAsB;AAAA,QAAA,CACvB;AAAA,MACH,SAASwD,GAAe;AACtB,gBAAQ,MAAMA,CAAa;AAAA,MAC7B;AAEF,WAAOxB;AAAA,EACT;AACF;"}
1
+ {"version":3,"file":"oracle.js","sources":["../src/oracle.ts"],"sourcesContent":["/**\n * Oracle Price Feed Management for Lending Protocol\n *\n * This module provides oracle price feed functionality for the lending protocol.\n * It integrates with Pyth Network for real-time price data and manages price updates\n * for various assets used in lending operations.\n */\n\nimport { getConfig, DEFAULT_CACHE_TIME } from './config'\nimport type {\n OraclePriceFeed,\n EnvOption,\n UserLendingInfo,\n Pool,\n SuiClientOption,\n MarketOption,\n LendingPosition,\n ServiceOption,\n TransactionObjectArgument\n} from './types'\nimport { SuiPriceServiceConnection, SuiPythClient } from './pyth'\nimport { Transaction } from '@mysten/sui/transactions'\nimport { multiGetSuiObjects, suiClient } from './utils'\nimport { getLendingPositions } from './account'\n\ntype PythInfo = {\n priceFeedId: string\n priceInfoObject: string\n expiration?: number\n}\n\nexport type PythPriceInfo = {\n priceFeedId: string\n priceInfoObject: string\n price: string\n conf: string\n publishTime: number\n expiration?: number\n}\n\n/**\n * Pyth Network connection for price feed data\n * Connects to the Hermes endpoint for real-time price updates\n */\nconst pythConnections = new Map<string, SuiPriceServiceConnection>()\nconst getPythConnection = (endpoint?: string) => {\n const url = endpoint ?? 'https://hermes.pyth.network'\n let conn = pythConnections.get(url)\n if (!conn) {\n conn = new SuiPriceServiceConnection(url, { timeout: 10000 })\n pythConnections.set(url, conn)\n }\n return conn\n}\n\n/**\n * Get stale price feed IDs from Pyth Network\n *\n * Identifies price feeds that have not been updated recently (more than 30 seconds old).\n * This helps ensure that only fresh price data is used for lending operations.\n *\n * @param priceIds - Array of Pyth price feed IDs to check\n * @returns Array of stale price feed IDs that need updating\n * @throws Error if failed to fetch price feed data\n */\nexport async function getPythStalePriceFeedId(\n priceIds: string[],\n options?: Partial<EnvOption & MarketOption>\n): Promise<string[]> {\n try {\n const returnData: string[] = []\n const config = await getConfig({ ...options, cacheTime: DEFAULT_CACHE_TIME })\n const latestPriceFeeds = await getPythConnection(\n config.oracle.hermesEndpoint\n ).getLatestPriceFeeds(priceIds)\n if (!latestPriceFeeds) return returnData\n\n const currentTimestamp = Math.floor(new Date().valueOf() / 1000)\n for (const priceFeed of latestPriceFeeds) {\n const uncheckedPrice = priceFeed.getPriceUnchecked()\n if (uncheckedPrice.publishTime > currentTimestamp) {\n console.warn(\n `pyth price feed is invalid, id: ${priceFeed.id}, publish time: ${uncheckedPrice.publishTime}, current timestamp: ${currentTimestamp}`\n )\n continue\n }\n\n // From pyth state is 60, but setting it to 30 makes more sense.\n if (currentTimestamp - priceFeed.getPriceUnchecked().publishTime > 30) {\n console.info(\n `stale price feed, id: ${priceFeed.id}, publish time: ${uncheckedPrice.publishTime}, current timestamp: ${currentTimestamp}`\n )\n returnData.push(priceFeed.id)\n }\n }\n return returnData\n } catch (error) {\n throw new Error(`failed to get pyth stale price feed id, msg: ${(error as Error).message}`)\n }\n}\n\nasync function getOnChainPriceInfo(\n pythInfos: PythInfo[],\n options?: Partial<SuiClientOption>\n): Promise<PythPriceInfo[]> {\n // Whole-read failures (endpoint/RPC errors) propagate to the caller:\n // swallowing them here would silently skip the Pyth staleness update and let\n // transactions build against stale on-chain prices. Only per-feed anomalies\n // are skipped below.\n const priceInfos: PythPriceInfo[] = []\n const client = options?.client ?? suiClient\n\n const priceInfoObjectIds = pythInfos.map((k) => k.priceInfoObject)\n const priceInfoObjects = await multiGetSuiObjects(client, {\n ids: Array.from(new Set(priceInfoObjectIds)),\n options: { showContent: true }\n })\n for (const obj of priceInfoObjects) {\n const data = obj.data\n if (!data || !data.content || data.content.dataType !== 'moveObject') {\n console.warn(`fetched object ${data?.objectId} datatype should be moveObject`)\n continue\n }\n\n const pythInfo = pythInfos.find((v) => v.priceInfoObject == data.objectId)\n if (!pythInfo) {\n console.warn(`unable to find pyth info from array, priceInfoObject: ${data.objectId}`)\n continue\n }\n\n // The Sui v2 client returns nested Move structs directly, without the\n // per-level `.fields` wrapper the legacy JSON-RPC object shape carried.\n // Read the flattened shape and skip (not throw) on an unexpected object so\n // a single malformed feed can't abort the whole batch and silently leave\n // every on-chain price un-refreshed.\n // @ts-ignore\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n const priceStruct = data.content.fields?.price_info?.price_feed?.price\n const priceValue = priceStruct?.price\n if (!priceValue) {\n console.warn(`unexpected pyth price struct, priceInfoObject: ${data.objectId}`)\n continue\n }\n const { magnitude, negative } = priceValue\n const conf = priceStruct.conf\n const timestamp = priceStruct.timestamp\n\n priceInfos.push({\n priceFeedId: pythInfo.priceFeedId,\n priceInfoObject: pythInfo.priceInfoObject,\n price: negative ? '-' + magnitude : magnitude,\n conf,\n publishTime: Number(timestamp),\n expiration: pythInfo.expiration\n })\n }\n return priceInfos\n}\n\nexport async function getPythStalePriceFeedIdV2(\n pythInfos: PythInfo[],\n options?: Partial<SuiClientOption>\n): Promise<string[]> {\n try {\n const returnData: string[] = []\n const latestPriceFeeds = await getOnChainPriceInfo(pythInfos, options)\n if (!latestPriceFeeds) return returnData\n\n const currentTimestamp = Math.floor(new Date().valueOf() / 1000)\n\n for (const priceFeed of latestPriceFeeds) {\n if (priceFeed.publishTime > currentTimestamp) {\n console.warn(\n `pyth price feed is invalid, id: ${priceFeed.priceFeedId}, publish time: ${priceFeed.publishTime}, current timestamp: ${currentTimestamp}`\n )\n continue\n }\n\n const maxTime = priceFeed.expiration || 60\n // 3s is the margin of error for the price feed.\n if (currentTimestamp - priceFeed.publishTime > maxTime) {\n console.info(\n `stale price feed, id: ${priceFeed.priceFeedId}, publish time: ${priceFeed.publishTime}, current timestamp: ${currentTimestamp}`\n )\n returnData.push(priceFeed.priceFeedId)\n }\n }\n return returnData\n } catch (error) {\n throw new Error(`failed to get pyth stale price feed id, msg: ${(error as Error).message}`)\n }\n}\n\n/**\n * Update Pyth price feeds in a transaction\n *\n * Fetches the latest price update data from Pyth Network and adds the update\n * operations to the transaction block.\n *\n * @param tx - The transaction block to add price feed updates to\n * @param priceFeedIds - Array of Pyth price feed IDs to update\n * @param options - Optional client and environment configuration\n * @returns Promise that resolves when price feeds are updated\n * @throws Error if failed to update price feeds\n */\nexport async function updatePythPriceFeeds(\n tx: Transaction,\n priceFeedIds: string[],\n options?: Partial<\n SuiClientOption &\n EnvOption &\n MarketOption & {\n pythFeeCoin?: TransactionObjectArgument\n }\n >\n) {\n const client = options?.client ?? suiClient\n const config = await getConfig({\n ...options,\n cacheTime: DEFAULT_CACHE_TIME\n })\n try {\n const priceUpdateData = await getPythConnection(\n config.oracle.hermesEndpoint\n ).getPriceFeedsUpdateData(priceFeedIds)\n const suiPythClient = new SuiPythClient(\n client as any,\n config.oracle.pythStateId,\n config.oracle.wormholeStateId\n )\n\n return await suiPythClient.updatePriceFeeds(tx as any, priceUpdateData, priceFeedIds, {\n feeCoin: options?.pythFeeCoin\n })\n } catch (error) {\n throw new Error(`failed to update pyth price feeds, msg: ${(error as Error).message}`)\n }\n}\n\n/**\n * Update oracle prices in the PTB (Programmable Transaction Block)\n *\n * This function updates price feeds for the lending protocol. It can optionally\n * update Pyth price feeds first if they are stale, then updates individual\n * price feeds in the oracle contract.\n *\n * @param tx - The transaction block to add price update operations to\n * @param priceFeeds - Array of oracle price feeds to update\n * @param options - Optional configuration including whether to update Pyth feeds\n * @returns The updated transaction block\n */\nexport async function updateOraclePricesPTB(\n tx: Transaction,\n priceFeeds: OraclePriceFeed[],\n options?: Partial<\n EnvOption &\n SuiClientOption &\n ServiceOption &\n MarketOption & {\n updatePythPriceFeeds?: boolean\n /** Optional user-owned SUI coin used for Pyth update fees. Defaults to `tx.gas`. */\n pythFeeCoin?: TransactionObjectArgument\n }\n >\n): Promise<Transaction> {\n const config = await getConfig({\n ...options,\n cacheTime: DEFAULT_CACHE_TIME\n })\n\n // Optionally update Pyth price feeds if they are stale\n if (options?.updatePythPriceFeeds) {\n const pythInfos = priceFeeds\n .filter((feed) => !!feed.pythPriceFeedId && !!feed.pythPriceInfoObject)\n .map((feed) => ({\n priceFeedId: feed.pythPriceFeedId,\n priceInfoObject: feed.pythPriceInfoObject,\n expiration: 30\n }))\n\n // Do not silently swallow Pyth stale-price update failures: the previous\n // catch kept building the tx with possibly stale on-chain prices and masked\n // real endpoint/RPC errors. Throw so callers are aware (avoids\n // lending/liquidation based on stale prices).\n const stalePriceFeedIds = await getPythStalePriceFeedIdV2(pythInfos, options)\n if (stalePriceFeedIds.length > 0) {\n await updatePythPriceFeeds(tx, stalePriceFeedIds, options)\n }\n }\n\n // Update individual price feeds in the oracle contract\n for (const priceFeed of priceFeeds) {\n tx.moveCall({\n target: `${config.oracle.packageId}::oracle_pro::${config.oracle.updateFunction ?? 'update_single_price_v2'}`,\n arguments: [\n tx.object('0x6'), // Clock object\n tx.object(config.oracle.oracleConfig), // Oracle configuration\n tx.object(config.oracle.priceOracle), // Price oracle contract\n tx.object(config.oracle.supraOracleHolder), // Supra oracle holder\n tx.object(priceFeed.pythPriceInfoObject), // Pyth price info object\n tx.object(config.oracle.switchboardAggregator),\n tx.pure.address(priceFeed.feedId) // Price feed ID\n ]\n })\n }\n return tx\n}\n\n/**\n * Get all available price feeds from the configuration\n *\n * @param options - Optional environment configuration\n * @returns Array of oracle price feed configurations\n */\nexport async function getPriceFeeds(\n options?: Partial<EnvOption & ServiceOption>\n): Promise<OraclePriceFeed[]> {\n const config = await getConfig({\n ...options,\n cacheTime: DEFAULT_CACHE_TIME\n })\n return config.oracle.feeds\n}\n\n/**\n * Whether a price feed is a composite ratio feed (it carries `ratioOracleId`) rather than an\n * asset's own price feed. Use it to pick the asset's own feed when looking one up by oracle id or\n * coin type: a composite asset has two entries under its oracle id.\n */\nexport function isRatioPriceFeed(feed: Pick<OraclePriceFeed, 'ratioOracleId'>): boolean {\n return feed.ratioOracleId !== undefined && feed.ratioOracleId !== null\n}\n\n/**\n * Filter price feeds based on lending state and pools\n *\n * This function filters price feeds to only include those that are relevant\n * to the current lending state or available pools.\n *\n * A composite asset (e.g. vSUI priced at SUI/USD x VSUI/SUI.RR) lists its ratio feed under the\n * asset's own oracle id, so the ratio feed is kept whenever the asset is: the contract reads the\n * asset's price as valid only while both feeds are fresh.\n *\n * @param feeds - Array of price feeds to filter\n * @param filters - Filter criteria including lending state and pools\n * @returns Filtered array of price feeds\n */\nexport function filterPriceFeeds(\n feeds: OraclePriceFeed[],\n filters: {\n lendingState?: UserLendingInfo[]\n pools?: Pool[]\n lendingPositions?: LendingPosition[]\n }\n): OraclePriceFeed[] {\n return feeds.filter((feed) => {\n // Filter by lending state (user's current positions)\n if (filters?.lendingState) {\n const inState = filters.lendingState.find((state) => {\n return feed.oracleId === state.pool.oracleId\n })\n if (inState) {\n return true\n }\n }\n\n if (filters?.lendingPositions) {\n const inPosition = filters.lendingPositions.find((position) => {\n const availableTypes = [\n 'navi-lending-supply',\n 'navi-lending-borrow',\n 'navi-lending-emode-supply',\n 'navi-lending-emode-borrow'\n ]\n if (!availableTypes.includes(position.type)) {\n return false\n }\n const pool = position[position.type]?.pool\n return feed.oracleId === pool?.oracleId\n })\n if (inPosition) {\n return true\n }\n }\n\n // Filter by available pools\n if (filters?.pools) {\n const inPool = filters.pools.find((pool) => {\n return feed.oracleId === pool.oracleId\n })\n if (inPool) {\n return true\n }\n }\n return false\n })\n}\n\nexport async function updateOraclePriceBeforeUserOperationPTB(\n tx: Transaction,\n address: string,\n pools: Pool[],\n options?: Partial<\n EnvOption &\n SuiClientOption &\n MarketOption & {\n throws?: boolean\n pythFeeCoin?: TransactionObjectArgument\n }\n >\n) {\n let relevantFeeds: OraclePriceFeed[] | undefined\n try {\n const allPriceFeeds = await getPriceFeeds({\n ...options\n })\n\n const markets = [] as string[]\n\n pools.forEach((pool) => {\n if (!markets.includes(pool.market)) {\n markets.push(pool.market)\n }\n })\n\n const lendingPositions = await getLendingPositions(address, {\n ...options,\n markets\n })\n\n relevantFeeds = filterPriceFeeds(allPriceFeeds, {\n lendingPositions,\n pools\n })\n\n const updatedTx = await updateOraclePricesPTB(tx, relevantFeeds, {\n updatePythPriceFeeds: true,\n ...options\n })\n return updatedTx\n } catch (e) {\n if (options?.throws) {\n throw e\n }\n console.error(e)\n // Degraded path: a Pyth refresh failure happens before any moveCall is\n // appended, so the tx is still clean. Retry the oracle update without the\n // Pyth feed refresh (matches the pre-v2 behavior where Pyth failures were\n // swallowed but update_single_price calls were still appended) instead of\n // dropping the oracle update entirely.\n if (relevantFeeds) {\n try {\n return await updateOraclePricesPTB(tx, relevantFeeds, {\n ...options,\n updatePythPriceFeeds: false\n })\n } catch (fallbackError) {\n console.error(fallbackError)\n }\n }\n return tx\n }\n}\n"],"names":["pythConnections","getPythConnection","endpoint","url","conn","SuiPriceServiceConnection","getPythStalePriceFeedId","priceIds","options","returnData","config","getConfig","DEFAULT_CACHE_TIME","latestPriceFeeds","currentTimestamp","priceFeed","uncheckedPrice","error","getOnChainPriceInfo","pythInfos","priceInfos","client","suiClient","priceInfoObjectIds","k","priceInfoObjects","multiGetSuiObjects","obj","data","pythInfo","v","priceStruct","priceValue","magnitude","negative","conf","timestamp","getPythStalePriceFeedIdV2","maxTime","updatePythPriceFeeds","tx","priceFeedIds","priceUpdateData","SuiPythClient","updateOraclePricesPTB","priceFeeds","feed","stalePriceFeedIds","getPriceFeeds","isRatioPriceFeed","filterPriceFeeds","feeds","filters","state","position","pool","updateOraclePriceBeforeUserOperationPTB","address","pools","relevantFeeds","allPriceFeeds","markets","lendingPositions","getLendingPositions","e","fallbackError"],"mappings":";;;;AA4CA,MAAMA,wBAAsB,IAAA,GACtBC,IAAoB,CAACC,MAAsB;AAC/C,QAAMC,IAAMD,KAAY;AACxB,MAAIE,IAAOJ,EAAgB,IAAIG,CAAG;AAClC,SAAKC,MACHA,IAAO,IAAIC,EAA0BF,GAAK,EAAE,SAAS,KAAO,GAC5DH,EAAgB,IAAIG,GAAKC,CAAI,IAExBA;AACT;AAYA,eAAsBE,EACpBC,GACAC,GACmB;AACnB,MAAI;AACF,UAAMC,IAAuB,CAAA,GACvBC,IAAS,MAAMC,EAAU,EAAE,GAAGH,GAAS,WAAWI,GAAoB,GACtEC,IAAmB,MAAMZ;AAAA,MAC7BS,EAAO,OAAO;AAAA,IAAA,EACd,oBAAoBH,CAAQ;AAC9B,QAAI,CAACM,EAAkB,QAAOJ;AAE9B,UAAMK,IAAmB,KAAK,OAAM,oBAAI,QAAO,QAAA,IAAY,GAAI;AAC/D,eAAWC,KAAaF,GAAkB;AACxC,YAAMG,IAAiBD,EAAU,kBAA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MAAMC,EAAoBN,GAAS;AAAA,MAC1D,GAAGjD;AAAA,MACH,SAAAqD;AAAA,IAAA,CACD;AAED,WAAAF,IAAgBT,EAAiBU,GAAe;AAAA,MAC9C,kBAAAE;AAAA,MACA,OAAAJ;AAAA,IAAA,CACD,GAEiB,MAAMd,EAAsBJ,GAAImB,GAAe;AAAA,MAC/D,sBAAsB;AAAA,MACtB,GAAGnD;AAAA,IAAA,CACJ;AAAA,EAEH,SAASwD,GAAG;AACV,QAAIxD,GAAS;AACX,YAAMwD;AAQR,QANA,QAAQ,MAAMA,CAAC,GAMXL;AACF,UAAI;AACF,eAAO,MAAMf,EAAsBJ,GAAImB,GAAe;AAAA,UACpD,GAAGnD;AAAA,UACH,sBAAsB;AAAA,QAAA,CACvB;AAAA,MACH,SAASyD,GAAe;AACtB,gBAAQ,MAAMA,CAAa;AAAA,MAC7B;AAEF,WAAOzB;AAAA,EACT;AACF;"}
@@ -1,8 +1,8 @@
1
- const o = "2.2.0", s = {
2
- version: o
1
+ const e = "2.2.1-preview.20261113.4089b35", o = {
2
+ version: e
3
3
  };
4
4
  export {
5
- s as default,
6
- o as version
5
+ o as default,
6
+ e as version
7
7
  };
8
8
  //# sourceMappingURL=package.json.js.map
package/dist/types.d.ts CHANGED
@@ -428,6 +428,15 @@ export type OraclePriceFeed = {
428
428
  priceDecimal: number;
429
429
  /** Supra pair identifier */
430
430
  supraPairId: number;
431
+ /**
432
+ * Set only on a composite ratio feed, e.g. Pyth `Crypto.VSUI/SUI.RR`. Its value is the ratio's
433
+ * own on-chain oracle id (200..=255). Once `oracle::set_composite(asset, ratio)` is on chain, the
434
+ * asset is priced at own feed x ratio and its price is valid only while both feeds are fresh.
435
+ * `oracleId` (and `coinType`) are the asset's, so {@link filterPriceFeeds} selects the ratio feed
436
+ * together with the asset's own feed and {@link updateOraclePricesPTB} pushes both.
437
+ * Absent on an asset's own price feed.
438
+ */
439
+ ratioOracleId?: number;
431
440
  };
432
441
  /**
433
442
  * Lending protocol config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MAAM,CAAA;QAChB,KAAK,EAAE,aAAa,CAAA;QACpB,IAAI,EAAE,SAAS,CAAA;QACf,QAAQ,EAAE,QAAQ,CAAA;KACnB,CAAA;IACD,2BAA2B,CAAC,EAAE;QAC5B,MAAM,EAAE,MAAM,CAAA;QACd,KAAK,EAAE,aAAa,CAAA;QACpB,QAAQ,EAAE,MAAM,CAAA;QAChB,IAAI,EAAE,SAAS,CAAA;QACf,QAAQ,EAAE,QAAQ,CAAA;KACnB,CAAA;CACF,CAAA;AAED,MAAM,MAAM,qBAAqB,CAAC,CAAC,SAAS,mBAAmB,IAAI,IAAI,CACrE,eAAe,EACf,IAAI,GAAG,QAAQ,GAAG,UAAU,GAAG,QAAQ,CACxC,GAAG;IACF,IAAI,EAAE,CAAC,CAAA;CACR,GAAG,QAAQ,CAAC,IAAI,CAAC,eAAe,EAAE,CAAC,CAAC,CAAC,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@naviprotocol/lending",
3
- "version": "2.2.0",
3
+ "version": "2.2.1-preview.20261113.4089b35",
4
4
  "description": "NAVI Lending SDK",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -38,6 +38,20 @@
38
38
  "engines": {
39
39
  "node": ">=22"
40
40
  },
41
+ "scripts": {
42
+ "build": "run-p build:lib",
43
+ "build:lib": "vite build",
44
+ "prettier": "prettier --check src/",
45
+ "prettier:fix": "prettier --write src/",
46
+ "lint": "eslint . --ext .ts,.tsx",
47
+ "lint:fix": "eslint . --ext .ts,.tsx --fix",
48
+ "verify": "run-p prettier lint",
49
+ "verify:fix": "run-p prettier:fix lint:fix",
50
+ "test": "vitest --config ./vite.config.unit.js",
51
+ "test:types": "pnpm build:lib && tsc --noEmit -p tsconfig.type-tests.json",
52
+ "test:watch": "vitest",
53
+ "test:coverage": "vitest run --coverage"
54
+ },
41
55
  "dependencies": {
42
56
  "bignumber.js": "9.1.2",
43
57
  "lodash.camelcase": "4.3.0"
@@ -53,19 +67,5 @@
53
67
  },
54
68
  "peerDependencies": {
55
69
  "@mysten/sui": ">=2.0.0"
56
- },
57
- "scripts": {
58
- "build": "run-p build:lib",
59
- "build:lib": "vite build",
60
- "prettier": "prettier --check src/",
61
- "prettier:fix": "prettier --write src/",
62
- "lint": "eslint . --ext .ts,.tsx",
63
- "lint:fix": "eslint . --ext .ts,.tsx --fix",
64
- "verify": "run-p prettier lint",
65
- "verify:fix": "run-p prettier:fix lint:fix",
66
- "test": "vitest --config ./vite.config.unit.js",
67
- "test:types": "pnpm build:lib && tsc --noEmit -p tsconfig.type-tests.json",
68
- "test:watch": "vitest",
69
- "test:coverage": "vitest run --coverage"
70
70
  }
71
- }
71
+ }
package/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2021 NAVI
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.