@depthhq/maker-sdk 0.1.14 → 0.1.15

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
@@ -26604,7 +26604,7 @@ import { PublicKey as PublicKey2 } from "@solana/web3.js";
26604
26604
 
26605
26605
  // src/bot/policy.ts
26606
26606
  import { positionPnl } from "@depthhq/sdk";
26607
- import { quoteBounds, quoteSizes } from "@depthhq/bindings";
26607
+ import { fundingFresh, quoteBounds, quoteSizes } from "@depthhq/bindings";
26608
26608
 
26609
26609
  // src/hedge/policy.ts
26610
26610
  function validateHedgePolicy(policy) {
@@ -27480,10 +27480,15 @@ class QuoteHandle {
27480
27480
  }
27481
27481
  ]).rpc({ commitment: "confirmed" });
27482
27482
  } catch (error) {
27483
+ const receipt = await this.status();
27484
+ if (["reserving", "active", "filled", "cancelled", "rejected"].includes(receipt.status))
27485
+ return receipt;
27483
27486
  const code2 = error.error?.errorCode?.code;
27484
- if (code2 !== "WrongMarketAccountStatus" && code2 !== "WrongOrderStatus" || Date.now() >= deadline) {
27487
+ if (code2 !== "WrongMarketAccountStatus" && code2 !== "WrongOrderStatus") {
27485
27488
  throw error;
27486
27489
  }
27490
+ if (Date.now() >= deadline)
27491
+ return receipt;
27487
27492
  await new Promise((resolve) => setTimeout(resolve, pollMs));
27488
27493
  continue;
27489
27494
  }
@@ -25119,7 +25119,7 @@ import { PublicKey as PublicKey2 } from "@solana/web3.js";
25119
25119
 
25120
25120
  // src/bot/policy.ts
25121
25121
  import { positionPnl } from "@depthhq/sdk";
25122
- import { quoteBounds, quoteSizes } from "@depthhq/bindings";
25122
+ import { fundingFresh, quoteBounds, quoteSizes } from "@depthhq/bindings";
25123
25123
 
25124
25124
  // src/hedge/policy.ts
25125
25125
  function validateHedgePolicy(policy) {
@@ -25999,10 +25999,15 @@ class QuoteHandle {
25999
25999
  }
26000
26000
  ]).rpc({ commitment: "confirmed" });
26001
26001
  } catch (error) {
26002
+ const receipt = await this.status();
26003
+ if (["reserving", "active", "filled", "cancelled", "rejected"].includes(receipt.status))
26004
+ return receipt;
26002
26005
  const code = error.error?.errorCode?.code;
26003
- if (code !== "WrongMarketAccountStatus" && code !== "WrongOrderStatus" || Date.now() >= deadline) {
26006
+ if (code !== "WrongMarketAccountStatus" && code !== "WrongOrderStatus") {
26004
26007
  throw error;
26005
26008
  }
26009
+ if (Date.now() >= deadline)
26010
+ return receipt;
26006
26011
  await new Promise((resolve) => setTimeout(resolve, pollMs));
26007
26012
  continue;
26008
26013
  }
package/dist/node.js CHANGED
@@ -211,7 +211,7 @@ class BotStore {
211
211
 
212
212
  // src/bot/policy.ts
213
213
  import { positionPnl } from "@depthhq/sdk";
214
- import { quoteBounds, quoteSizes } from "@depthhq/bindings";
214
+ import { fundingFresh, quoteBounds, quoteSizes } from "@depthhq/bindings";
215
215
 
216
216
  // src/hedge/policy.ts
217
217
  function validateHedgePolicy(policy) {
@@ -303,7 +303,7 @@ function quoteHealth(market, now) {
303
303
  const age = now - market.oracleTimestamp.toNumber();
304
304
  if (age < 0 || age > market.config.maxOracleAgeSeconds)
305
305
  return "oracle stale";
306
- if (now > market.lastFundingTimestamp.toNumber() + market.config.fundingIntervalSeconds)
306
+ if (!fundingFresh(market.lastFundingTimestamp.toNumber(), market.config.fundingIntervalSeconds, now))
307
307
  return "funding overdue";
308
308
  if (BigInt(market.oraclePriceE8.toString()) < 100000000n)
309
309
  return "oracle price invalid";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@depthhq/maker-sdk",
3
- "version": "0.1.14",
3
+ "version": "0.1.15",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -29,8 +29,8 @@
29
29
  "@solana/web3.js": "1.99.0",
30
30
  "buffer": "6.0.3",
31
31
  "viem": "2.38.0",
32
- "@depthhq/bindings": "0.1.4",
33
- "@depthhq/sdk": "0.1.8"
32
+ "@depthhq/bindings": "0.1.5",
33
+ "@depthhq/sdk": "0.1.9"
34
34
  },
35
35
  "scripts": {
36
36
  "build": "node ../../scripts/build-package.mjs maker-sdk",