@haven-fi/solauto-sdk 1.0.88 → 1.0.91
Sign up to get free protection for your applications and to get access to all the features.
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"numberUtils.d.ts","sourceRoot":"","sources":["../../src/utils/numberUtils.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,wBAAgB,uBAAuB,CACrC,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,EACf,eAAe,EAAE,MAAM,GACtB,MAAM,CAMR;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAElE;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAEpE;AAED,wBAAgB,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAE7C;AAED,wBAAgB,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAE3C;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM,CAqBrD;AAED,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,UAAU,GAAG,MAAM,CAejE;AAED,wBAAgB,oBAAoB,CAClC,eAAe,EAAE,MAAM,EACvB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,EACf,2BAA2B,EAAE,MAAM,EACnC,gBAAgB,CAAC,EAAE,MAAM,UAW1B;AAED,wBAAgB,iBAAiB,CAC/B,UAAU,EAAE,OAAO,EACnB,OAAO,EAAE,OAAO,EAChB,mBAAmB,EAAE,MAAM,GAC1B;IACD,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;CACf,
|
1
|
+
{"version":3,"file":"numberUtils.d.ts","sourceRoot":"","sources":["../../src/utils/numberUtils.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MA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,EAAE,eAAe,EAAE,MAAM,UAKvE"}
|
@@ -70,11 +70,12 @@ 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 =
|
74
|
-
const minFeeBps = 50; // Fee in basis points for maxSize (
|
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;
|
75
76
|
let feeBps = 0;
|
76
77
|
if (feeType === generated_1.FeeType.Small) {
|
77
|
-
feeBps =
|
78
|
+
feeBps = minFeeBps;
|
78
79
|
}
|
79
80
|
else if (positionNetWorthUsd <= minSize) {
|
80
81
|
feeBps = maxFeeBps;
|
@@ -85,7 +86,7 @@ function getSolautoFeesBps(isReferred, feeType, positionNetWorthUsd) {
|
|
85
86
|
else {
|
86
87
|
const t = (Math.log(positionNetWorthUsd) - Math.log(minSize)) /
|
87
88
|
(Math.log(maxSize) - Math.log(minSize));
|
88
|
-
feeBps = Math.round(minFeeBps + (maxFeeBps - minFeeBps) * (1 - t));
|
89
|
+
feeBps = Math.round(minFeeBps + (maxFeeBps - minFeeBps) * (1 - Math.pow(t, k)));
|
89
90
|
}
|
90
91
|
let referrer = 0;
|
91
92
|
if (isReferred) {
|
package/package.json
CHANGED
package/src/utils/numberUtils.ts
CHANGED
@@ -97,23 +97,25 @@ export function getSolautoFeesBps(
|
|
97
97
|
total: number;
|
98
98
|
} {
|
99
99
|
const minSize = 10000; // Minimum position size
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
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
|
+
}
|
117
119
|
|
118
120
|
let referrer = 0;
|
119
121
|
if (isReferred) {
|