@haven-fi/solauto-sdk 1.0.142 → 1.0.144

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,7 +1,7 @@
1
1
  export declare const BASIS_POINTS = 10000;
2
2
  export declare const DEFAULT_LIMIT_GAP_BPS = 1000;
3
3
  export declare const MIN_POSITION_STATE_FRESHNESS_SECS = 5;
4
- export declare const MIN_REPAY_GAP_BPS = 100;
4
+ export declare const MIN_REPAY_GAP_BPS = 50;
5
5
  export declare const MIN_BOOST_GAP_BPS = 50;
6
6
  export declare const PRICES: {
7
7
  [key: string]: {
@@ -1 +1 @@
1
- {"version":3,"file":"solautoConstants.d.ts","sourceRoot":"","sources":["../../src/constants/solautoConstants.ts"],"names":[],"mappings":"AAeA,eAAO,MAAM,YAAY,QAAQ,CAAC;AAElC,eAAO,MAAM,qBAAqB,OAAO,CAAC;AAC1C,eAAO,MAAM,iCAAiC,IAAI,CAAC;AACnD,eAAO,MAAM,iBAAiB,MAAM,CAAC;AACrC,eAAO,MAAM,iBAAiB,KAAK,CAAC;AAQpC,eAAO,MAAM,MAAM,EAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;KAAE,CAAA;CAAO,CAAC;AAE9E,eAAO,MAAM,WAAW,iDAAiD,CAAC;AAE1E,eAAO,MAAM,kBAAkB,gDAAgD,CAAC;AAEhF,eAAO,MAAM,qBAAqB,UAWjC,CAAC"}
1
+ {"version":3,"file":"solautoConstants.d.ts","sourceRoot":"","sources":["../../src/constants/solautoConstants.ts"],"names":[],"mappings":"AAeA,eAAO,MAAM,YAAY,QAAQ,CAAC;AAElC,eAAO,MAAM,qBAAqB,OAAO,CAAC;AAC1C,eAAO,MAAM,iCAAiC,IAAI,CAAC;AACnD,eAAO,MAAM,iBAAiB,KAAK,CAAC;AACpC,eAAO,MAAM,iBAAiB,KAAK,CAAC;AAQpC,eAAO,MAAM,MAAM,EAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;KAAE,CAAA;CAAO,CAAC;AAE9E,eAAO,MAAM,WAAW,iDAAiD,CAAC;AAE1E,eAAO,MAAM,kBAAkB,gDAAgD,CAAC;AAEhF,eAAO,MAAM,qBAAqB,UAWjC,CAAC"}
@@ -9,7 +9,7 @@ const generalAccounts_1 = require("./generalAccounts");
9
9
  exports.BASIS_POINTS = 10000;
10
10
  exports.DEFAULT_LIMIT_GAP_BPS = 1000;
11
11
  exports.MIN_POSITION_STATE_FRESHNESS_SECS = 5;
12
- exports.MIN_REPAY_GAP_BPS = 100;
12
+ exports.MIN_REPAY_GAP_BPS = 50;
13
13
  exports.MIN_BOOST_GAP_BPS = 50;
14
14
  // export const JITO_BLOCK_ENGINE = "ny.mainnet.block-engine.jito.wtf";
15
15
  // export const JITO_CONNECTION = new JitoRpcConnection(
@@ -81,10 +81,10 @@ function eligibleForRebalance(positionState, positionSettings, positionDca, curr
81
81
  : positionSettings.boostToBps;
82
82
  const repayFrom = positionSettings.repayToBps + positionSettings.repayGap;
83
83
  const boostFrom = boostToBps - positionSettings.boostGap;
84
- if (Math.max(0, positionState.liqUtilizationRateBps - boostFrom) / boostFrom >= bpsDistanceThreshold) {
84
+ if (Math.max(0, positionState.liqUtilizationRateBps - boostFrom) <= bpsDistanceThreshold) {
85
85
  return "boost";
86
86
  }
87
- else if (Math.max(0, repayFrom - positionState.liqUtilizationRateBps) >= bpsDistanceThreshold) {
87
+ else if (Math.max(0, repayFrom - positionState.liqUtilizationRateBps) <= bpsDistanceThreshold) {
88
88
  return "repay";
89
89
  }
90
90
  return undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@haven-fi/solauto-sdk",
3
- "version": "1.0.142",
3
+ "version": "1.0.144",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "description": "Typescript SDK for the Solauto program on the Solana blockchain",
@@ -17,7 +17,7 @@ export const BASIS_POINTS = 10000;
17
17
 
18
18
  export const DEFAULT_LIMIT_GAP_BPS = 1000;
19
19
  export const MIN_POSITION_STATE_FRESHNESS_SECS = 5;
20
- export const MIN_REPAY_GAP_BPS = 100;
20
+ export const MIN_REPAY_GAP_BPS = 50;
21
21
  export const MIN_BOOST_GAP_BPS = 50;
22
22
 
23
23
  // export const JITO_BLOCK_ENGINE = "ny.mainnet.block-engine.jito.wtf";
@@ -145,9 +145,9 @@ export function eligibleForRebalance(
145
145
  const repayFrom = positionSettings.repayToBps + positionSettings.repayGap;
146
146
  const boostFrom = boostToBps - positionSettings.boostGap;
147
147
 
148
- if (Math.max(0, positionState.liqUtilizationRateBps - boostFrom) / boostFrom >= bpsDistanceThreshold) {
148
+ if (Math.max(0, positionState.liqUtilizationRateBps - boostFrom) <= bpsDistanceThreshold) {
149
149
  return "boost";
150
- } else if (Math.max(0, repayFrom - positionState.liqUtilizationRateBps) >= bpsDistanceThreshold) {
150
+ } else if (Math.max(0, repayFrom - positionState.liqUtilizationRateBps) <= bpsDistanceThreshold) {
151
151
  return "repay";
152
152
  }
153
153