@haven-fi/solauto-sdk 1.0.93 → 1.0.95
Sign up to get free protection for your applications and to get access to all the features.
@@ -77,7 +77,7 @@ class SolautoClient extends txHandler_1.TxHandler {
|
|
77
77
|
}
|
78
78
|
this.solautoFeesWallet = generalAccounts_1.SOLAUTO_FEES_WALLET;
|
79
79
|
this.solautoFeesSupplyTa = (0, accountUtils_1.getTokenAccount)(this.solautoFeesWallet, this.supplyMint);
|
80
|
-
this.authorityLutAddress = authorityReferralStateData?.lookupTable
|
80
|
+
this.authorityLutAddress = authorityReferralStateData?.lookupTable && !(0, umi_web3js_adapters_1.toWeb3JsPublicKey)(authorityReferralStateData.lookupTable).equals(web3_js_1.PublicKey.default)
|
81
81
|
? (0, umi_web3js_adapters_1.toWeb3JsPublicKey)(authorityReferralStateData?.lookupTable)
|
82
82
|
: undefined;
|
83
83
|
this.upToDateLutAccounts = (0, umi_web3js_adapters_1.toWeb3JsPublicKey)(this.signer.publicKey).equals(this.authority)
|
@@ -69,9 +69,9 @@ function getDebtAdjustmentUsd(liqThresholdBps, supplyUsd, debtUsd, targetLiqUtil
|
|
69
69
|
}
|
70
70
|
function getSolautoFeesBps(isReferred, feeType, positionNetWorthUsd) {
|
71
71
|
const minSize = 10000; // Minimum position size
|
72
|
-
const maxSize =
|
72
|
+
const maxSize = 500000; // Maximum position size
|
73
73
|
const maxFeeBps = 500; // Fee in basis points for minSize (5%)
|
74
|
-
const minFeeBps =
|
74
|
+
const minFeeBps = 50; // Fee in basis points for maxSize (0.5%)
|
75
75
|
const k = 0.55;
|
76
76
|
let feeBps = 0;
|
77
77
|
if (feeType === generated_1.FeeType.Small) {
|
package/package.json
CHANGED
@@ -176,8 +176,8 @@ export abstract class SolautoClient extends TxHandler {
|
|
176
176
|
|
177
177
|
const authorityReferralStateData = this.referralStateManager.referralStateData;
|
178
178
|
const hasReferredBy =
|
179
|
-
|
180
|
-
|
179
|
+
authorityReferralStateData &&
|
180
|
+
authorityReferralStateData.referredByState !==
|
181
181
|
publicKey(PublicKey.default);
|
182
182
|
const referredByAuthority =
|
183
183
|
!hasReferredBy &&
|
@@ -204,7 +204,7 @@ export abstract class SolautoClient extends TxHandler {
|
|
204
204
|
this.supplyMint
|
205
205
|
);
|
206
206
|
|
207
|
-
this.authorityLutAddress = authorityReferralStateData?.lookupTable
|
207
|
+
this.authorityLutAddress = authorityReferralStateData?.lookupTable && !toWeb3JsPublicKey(authorityReferralStateData.lookupTable).equals(PublicKey.default)
|
208
208
|
? toWeb3JsPublicKey(authorityReferralStateData?.lookupTable)
|
209
209
|
: undefined;
|
210
210
|
this.upToDateLutAccounts = toWeb3JsPublicKey(this.signer.publicKey).equals(
|
package/src/utils/numberUtils.ts
CHANGED
@@ -97,9 +97,9 @@ export function getSolautoFeesBps(
|
|
97
97
|
total: number;
|
98
98
|
} {
|
99
99
|
const minSize = 10_000; // Minimum position size
|
100
|
-
const maxSize =
|
100
|
+
const maxSize = 500_000; // Maximum position size
|
101
101
|
const maxFeeBps = 500; // Fee in basis points for minSize (5%)
|
102
|
-
const minFeeBps =
|
102
|
+
const minFeeBps = 50; // Fee in basis points for maxSize (0.5%)
|
103
103
|
const k = 0.55;
|
104
104
|
|
105
105
|
let feeBps: number = 0;
|