@haven-fi/solauto-sdk 1.0.91 → 1.0.93

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.
@@ -70,9 +70,9 @@ function getDebtAdjustmentUsd(liqThresholdBps, supplyUsd, debtUsd, targetLiqUtil
70
70
  function getSolautoFeesBps(isReferred, feeType, positionNetWorthUsd) {
71
71
  const minSize = 10000; // Minimum position size
72
72
  const maxSize = 1000000; // Maximum position size
73
- const maxFeeBps = 400; // Fee in basis points for minSize (4%)
74
- const minFeeBps = 50; // Fee in basis points for maxSize (0.5%)
75
- const k = 0.6;
73
+ const maxFeeBps = 500; // Fee in basis points for minSize (5%)
74
+ const minFeeBps = 10; // Fee in basis points for maxSize (0.1%)
75
+ const k = 0.55;
76
76
  let feeBps = 0;
77
77
  if (feeType === generated_1.FeeType.Small) {
78
78
  feeBps = minFeeBps;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@haven-fi/solauto-sdk",
3
- "version": "1.0.91",
3
+ "version": "1.0.93",
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",
@@ -96,26 +96,26 @@ export function getSolautoFeesBps(
96
96
  referrer: number;
97
97
  total: number;
98
98
  } {
99
- const minSize = 10000; // Minimum position size
100
- const maxSize = 1000000; // Maximum position size
101
- const maxFeeBps = 400; // Fee in basis points for minSize (4%)
102
- const minFeeBps = 50; // Fee in basis points for maxSize (0.5%)
103
- const k = 0.6;
104
-
105
- let feeBps: number = 0;
106
-
107
- if (feeType === FeeType.Small) {
108
- feeBps = minFeeBps;
109
- } else if (positionNetWorthUsd <= minSize) {
110
- feeBps = maxFeeBps;
111
- } else if (positionNetWorthUsd >= maxSize) {
112
- feeBps = minFeeBps;
113
- } else {
114
- const t =
115
- (Math.log(positionNetWorthUsd) - Math.log(minSize)) /
116
- (Math.log(maxSize) - Math.log(minSize));
117
- feeBps = Math.round(minFeeBps + (maxFeeBps - minFeeBps) * (1 - Math.pow(t, k)));
118
- }
99
+ const minSize = 10_000; // Minimum position size
100
+ const maxSize = 1_000_000; // Maximum position size
101
+ const maxFeeBps = 500; // Fee in basis points for minSize (5%)
102
+ const minFeeBps = 10; // Fee in basis points for maxSize (0.1%)
103
+ const k = 0.55;
104
+
105
+ let feeBps: number = 0;
106
+
107
+ if (feeType === FeeType.Small) {
108
+ feeBps = minFeeBps;
109
+ } else if (positionNetWorthUsd <= minSize) {
110
+ feeBps = maxFeeBps;
111
+ } else if (positionNetWorthUsd >= maxSize) {
112
+ feeBps = minFeeBps;
113
+ } else {
114
+ const t =
115
+ (Math.log(positionNetWorthUsd) - Math.log(minSize)) /
116
+ (Math.log(maxSize) - Math.log(minSize));
117
+ feeBps = Math.round(minFeeBps + (maxFeeBps - minFeeBps) * (1 - Math.pow(t, k)));
118
+ }
119
119
 
120
120
  let referrer = 0;
121
121
  if (isReferred) {