@0dotxyz/p0-ts-sdk 1.1.0-alpha.10 → 1.1.0-alpha.12
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.cjs +8 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -1
- package/dist/vendor.cjs +84 -87
- package/dist/vendor.cjs.map +1 -1
- package/dist/vendor.d.cts +46 -18
- package/dist/vendor.d.ts +46 -18
- package/dist/vendor.js +70 -74
- package/dist/vendor.js.map +1 -1
- package/package.json +1 -1
package/dist/vendor.js
CHANGED
|
@@ -12967,7 +12967,7 @@ function roundNearest(decimal) {
|
|
|
12967
12967
|
var interpolateLinear = (x, x0, y0, x1, y1) => {
|
|
12968
12968
|
return y0 + (x - x0) * (y1 - y0) / (x1 - x0);
|
|
12969
12969
|
};
|
|
12970
|
-
var
|
|
12970
|
+
var getKaminoBorrowRate = (currentUtilization, curve) => {
|
|
12971
12971
|
let [x0, y0, x1, y1] = [0, 0, 0, 0];
|
|
12972
12972
|
if (currentUtilization > 1) {
|
|
12973
12973
|
currentUtilization = 1;
|
|
@@ -12999,29 +12999,21 @@ var getBorrowRate = (currentUtilization, curve) => {
|
|
|
12999
12999
|
function calculateAPYFromAPR(apr) {
|
|
13000
13000
|
return Math.pow(1 + apr / SLOTS_PER_YEAR, SLOTS_PER_YEAR) - 1;
|
|
13001
13001
|
}
|
|
13002
|
-
function
|
|
13003
|
-
const liquidityAvailableAmount = new Decimal3(
|
|
13004
|
-
|
|
13005
|
-
);
|
|
13006
|
-
const borrowedAmount = new Fraction(
|
|
13007
|
-
reserve.liquidity.borrowedAmountSf
|
|
13008
|
-
).toDecimal();
|
|
13002
|
+
function getKaminoTotalSupply(reserve) {
|
|
13003
|
+
const liquidityAvailableAmount = new Decimal3(reserve.liquidity.availableAmount.toString());
|
|
13004
|
+
const borrowedAmount = new Fraction(reserve.liquidity.borrowedAmountSf).toDecimal();
|
|
13009
13005
|
const accumulatedProtocolFee = new Fraction(
|
|
13010
13006
|
reserve.liquidity.accumulatedProtocolFeesSf
|
|
13011
13007
|
).toDecimal();
|
|
13012
13008
|
const accumulatedReferrerFees = new Fraction(
|
|
13013
13009
|
reserve.liquidity.accumulatedReferrerFeesSf
|
|
13014
13010
|
).toDecimal();
|
|
13015
|
-
const pendingReferrerFees = new Fraction(
|
|
13016
|
-
reserve.liquidity.pendingReferrerFeesSf
|
|
13017
|
-
).toDecimal();
|
|
13011
|
+
const pendingReferrerFees = new Fraction(reserve.liquidity.pendingReferrerFeesSf).toDecimal();
|
|
13018
13012
|
return liquidityAvailableAmount.add(borrowedAmount).sub(accumulatedProtocolFee).sub(accumulatedReferrerFees).sub(pendingReferrerFees);
|
|
13019
13013
|
}
|
|
13020
13014
|
function calculateUtilizationRatio(reserve) {
|
|
13021
|
-
const totalBorrows = new Fraction(
|
|
13022
|
-
|
|
13023
|
-
).toDecimal();
|
|
13024
|
-
const totalSupply = getTotalSupply(reserve);
|
|
13015
|
+
const totalBorrows = new Fraction(reserve.liquidity.borrowedAmountSf).toDecimal();
|
|
13016
|
+
const totalSupply = getKaminoTotalSupply(reserve);
|
|
13025
13017
|
if (totalSupply.eq(0)) {
|
|
13026
13018
|
return 0;
|
|
13027
13019
|
}
|
|
@@ -13033,38 +13025,28 @@ function slotAdjustmentFactor(recentSlotDurationMs = DEFAULT_RECENT_SLOT_DURATIO
|
|
|
13033
13025
|
function calculateSlotAdjustmentFactor(reserve, recentSlotDurationMs) {
|
|
13034
13026
|
return 1e3 / SLOTS_PER_SECOND / recentSlotDurationMs;
|
|
13035
13027
|
}
|
|
13036
|
-
function
|
|
13028
|
+
function calculateKaminoEstimatedBorrowRate(reserve, recentSlotDurationMs = DEFAULT_RECENT_SLOT_DURATION_MS) {
|
|
13037
13029
|
const slotAdjFactor = slotAdjustmentFactor(recentSlotDurationMs);
|
|
13038
13030
|
const currentUtilization = calculateUtilizationRatio(reserve);
|
|
13039
13031
|
const curve = truncateBorrowCurve(reserve.config.borrowRateCurve.points);
|
|
13040
|
-
return
|
|
13032
|
+
return getKaminoBorrowRate(currentUtilization, curve) * slotAdjFactor;
|
|
13041
13033
|
}
|
|
13042
|
-
function
|
|
13043
|
-
const borrowRate =
|
|
13044
|
-
reserve,
|
|
13045
|
-
recentSlotDurationMs
|
|
13046
|
-
);
|
|
13034
|
+
function calculateKaminoEstimatedSupplyRate(reserve, recentSlotDurationMs = DEFAULT_RECENT_SLOT_DURATION_MS) {
|
|
13035
|
+
const borrowRate = calculateKaminoEstimatedBorrowRate(reserve, recentSlotDurationMs);
|
|
13047
13036
|
const currentUtilization = calculateUtilizationRatio(reserve);
|
|
13048
13037
|
const protocolTakeRatePct = 1 - reserve.config.protocolTakeRatePct / 100;
|
|
13049
13038
|
return borrowRate * currentUtilization * protocolTakeRatePct;
|
|
13050
13039
|
}
|
|
13051
|
-
function
|
|
13040
|
+
function calculateKaminoSupplyAPY(reserve, recentSlotDurationMs = DEFAULT_RECENT_SLOT_DURATION_MS) {
|
|
13052
13041
|
const currentUtilization = calculateUtilizationRatio(reserve);
|
|
13053
|
-
const borrowRate =
|
|
13054
|
-
reserve,
|
|
13055
|
-
recentSlotDurationMs
|
|
13056
|
-
);
|
|
13042
|
+
const borrowRate = calculateKaminoEstimatedBorrowRate(reserve, recentSlotDurationMs);
|
|
13057
13043
|
const protocolTakeRatePct = 1 - reserve.config.protocolTakeRatePct / 100;
|
|
13058
|
-
return calculateAPYFromAPR(
|
|
13059
|
-
currentUtilization * borrowRate * protocolTakeRatePct
|
|
13060
|
-
);
|
|
13044
|
+
return calculateAPYFromAPR(currentUtilization * borrowRate * protocolTakeRatePct);
|
|
13061
13045
|
}
|
|
13062
13046
|
function scaledSupplies(state) {
|
|
13063
13047
|
const liqMintDecimals = new Decimal3(state.liquidity.mintDecimals.toString());
|
|
13064
|
-
const totalSupplyLamports =
|
|
13065
|
-
const mintTotalSupplyLam = new Decimal3(
|
|
13066
|
-
state.collateral.mintTotalSupply.toString()
|
|
13067
|
-
);
|
|
13048
|
+
const totalSupplyLamports = getKaminoTotalSupply(state);
|
|
13049
|
+
const mintTotalSupplyLam = new Decimal3(state.collateral.mintTotalSupply.toString());
|
|
13068
13050
|
const liqScale = new Decimal3(10).pow(liqMintDecimals);
|
|
13069
13051
|
const collScale = new Decimal3(10).pow(liqMintDecimals);
|
|
13070
13052
|
const totalSupply = totalSupplyLamports.div(liqScale);
|
|
@@ -13097,7 +13079,7 @@ function generateKaminoReserveCurve(curvePoints, slotAdjustmentFactor2, fixedHos
|
|
|
13097
13079
|
const curve = truncateBorrowCurve(curvePoints);
|
|
13098
13080
|
return Array.from({ length: 101 }, (_, i) => {
|
|
13099
13081
|
const utilization = i / 100;
|
|
13100
|
-
const baseBorrowRate =
|
|
13082
|
+
const baseBorrowRate = getKaminoBorrowRate(utilization, curve) * slotAdjustmentFactor2;
|
|
13101
13083
|
const borrowAPR = baseBorrowRate + fixedHostInterestRate;
|
|
13102
13084
|
const supplyAPR = utilization * borrowAPR * protocolTakeRatePct;
|
|
13103
13085
|
const borrowAPY = calculateAPYFromAPR(borrowAPR);
|
|
@@ -13135,9 +13117,7 @@ function getRewardPerTimeUnitSecond(reward) {
|
|
|
13135
13117
|
const rewardAmountPerUnitDecimals = new Decimal3(10).pow(
|
|
13136
13118
|
reward.rewardsPerSecondDecimals.toString()
|
|
13137
13119
|
);
|
|
13138
|
-
const rewardAmountPerUnitLamports = new Decimal3(10).pow(
|
|
13139
|
-
rewardTokenDecimals.toString()
|
|
13140
|
-
);
|
|
13120
|
+
const rewardAmountPerUnitLamports = new Decimal3(10).pow(rewardTokenDecimals.toString());
|
|
13141
13121
|
const rpsAdjusted = new Decimal3(rewardPerTimeUnitSecond.toString()).div(rewardAmountPerUnitDecimals).div(rewardAmountPerUnitLamports);
|
|
13142
13122
|
return rewardPerTimeUnitSecond ? rpsAdjusted : new Decimal3(0);
|
|
13143
13123
|
}
|
|
@@ -13153,18 +13133,14 @@ async function getReserveRewardsApy(priceByMint, farmState, reserveState) {
|
|
|
13153
13133
|
if (reservePrice === void 0 || reservePrice === null || rewardPrice === void 0 || rewardPrice === null) {
|
|
13154
13134
|
continue;
|
|
13155
13135
|
}
|
|
13156
|
-
const { apy, apr } = calculateRewardApy(
|
|
13157
|
-
priceByMint,
|
|
13158
|
-
reserveState,
|
|
13159
|
-
rewardInfo
|
|
13160
|
-
);
|
|
13136
|
+
const { apy, apr } = calculateRewardApy(priceByMint, reserveState, rewardInfo);
|
|
13161
13137
|
rewardApys.push({ rewardApy: apy, rewardInfo, rewardApr: apr });
|
|
13162
13138
|
}
|
|
13163
13139
|
return rewardApys;
|
|
13164
13140
|
}
|
|
13165
13141
|
function calculateRewardApy(priceByMint, reserve, rewardInfo) {
|
|
13166
13142
|
const decimals = reserve.liquidity.mintDecimals.toNumber();
|
|
13167
|
-
const totalSupply =
|
|
13143
|
+
const totalSupply = getKaminoTotalSupply(reserve);
|
|
13168
13144
|
const mintAddress = reserve.liquidity.mintPubkey;
|
|
13169
13145
|
const totalAmount = lamportsToNumberDecimal(totalSupply, decimals);
|
|
13170
13146
|
const mintPrice = priceByMint[mintAddress.toString()] ?? 0;
|
|
@@ -27955,9 +27931,7 @@ var TEN = new BN(10);
|
|
|
27955
27931
|
var PERCENTAGE_PRECISION_EXP = new BN(6);
|
|
27956
27932
|
var PERCENTAGE_PRECISION = new BN(10).pow(PERCENTAGE_PRECISION_EXP);
|
|
27957
27933
|
var SPOT_MARKET_RATE_PRECISION_EXP = new BN(6);
|
|
27958
|
-
var SPOT_MARKET_RATE_PRECISION = new BN(10).pow(
|
|
27959
|
-
SPOT_MARKET_RATE_PRECISION_EXP
|
|
27960
|
-
);
|
|
27934
|
+
var SPOT_MARKET_RATE_PRECISION = new BN(10).pow(SPOT_MARKET_RATE_PRECISION_EXP);
|
|
27961
27935
|
var SPOT_MARKET_UTILIZATION_PRECISION_EXP = new BN(6);
|
|
27962
27936
|
var SPOT_MARKET_UTILIZATION_PRECISION = new BN(10).pow(
|
|
27963
27937
|
SPOT_MARKET_UTILIZATION_PRECISION_EXP
|
|
@@ -27971,24 +27945,21 @@ function divCeil(a, b) {
|
|
|
27971
27945
|
}
|
|
27972
27946
|
return quotient;
|
|
27973
27947
|
}
|
|
27974
|
-
function
|
|
27948
|
+
function getDriftTokenAmount(balanceAmount, spotMarket, balanceType) {
|
|
27975
27949
|
const precisionDecrease = TEN.pow(new BN(19 - spotMarket.decimals));
|
|
27976
27950
|
if (isSpotBalanceTypeVariant(balanceType, "deposit")) {
|
|
27977
27951
|
return balanceAmount.mul(spotMarket.cumulativeDepositInterest).div(precisionDecrease);
|
|
27978
27952
|
} else {
|
|
27979
|
-
return divCeil(
|
|
27980
|
-
balanceAmount.mul(spotMarket.cumulativeBorrowInterest),
|
|
27981
|
-
precisionDecrease
|
|
27982
|
-
);
|
|
27953
|
+
return divCeil(balanceAmount.mul(spotMarket.cumulativeBorrowInterest), precisionDecrease);
|
|
27983
27954
|
}
|
|
27984
27955
|
}
|
|
27985
|
-
function
|
|
27986
|
-
let tokenDepositAmount =
|
|
27956
|
+
function calculateDriftUtilization(bank, delta = ZERO) {
|
|
27957
|
+
let tokenDepositAmount = getDriftTokenAmount(
|
|
27987
27958
|
bank.depositBalance,
|
|
27988
27959
|
bank,
|
|
27989
27960
|
"deposit" /* DEPOSIT */
|
|
27990
27961
|
);
|
|
27991
|
-
let tokenBorrowAmount =
|
|
27962
|
+
let tokenBorrowAmount = getDriftTokenAmount(
|
|
27992
27963
|
bank.borrowBalance,
|
|
27993
27964
|
bank,
|
|
27994
27965
|
"borrow" /* BORROW */
|
|
@@ -28008,14 +27979,12 @@ function calculateUtilization(bank, delta = ZERO) {
|
|
|
28008
27979
|
}
|
|
28009
27980
|
return utilization;
|
|
28010
27981
|
}
|
|
28011
|
-
function
|
|
28012
|
-
const utilization = currentUtilization ||
|
|
27982
|
+
function calculateDriftInterestRate(bank, delta = ZERO, currentUtilization = null) {
|
|
27983
|
+
const utilization = currentUtilization || calculateDriftUtilization(bank, delta);
|
|
28013
27984
|
const optimalUtil = new BN(bank.optimalUtilization);
|
|
28014
27985
|
const optimalRate = new BN(bank.optimalBorrowRate);
|
|
28015
27986
|
const maxRate = new BN(bank.maxBorrowRate);
|
|
28016
|
-
const minRate = new BN(bank.minBorrowRate).mul(
|
|
28017
|
-
PERCENTAGE_PRECISION.divn(200)
|
|
28018
|
-
);
|
|
27987
|
+
const minRate = new BN(bank.minBorrowRate).mul(PERCENTAGE_PRECISION.divn(200));
|
|
28019
27988
|
const weightsDivisor = new BN(1e3);
|
|
28020
27989
|
const segments = [
|
|
28021
27990
|
[new BN(85e4), new BN(50)],
|
|
@@ -28050,17 +28019,17 @@ function calculateInterestRate(bank, delta = ZERO, currentUtilization = null) {
|
|
|
28050
28019
|
}
|
|
28051
28020
|
return BN.max(minRate, rate);
|
|
28052
28021
|
}
|
|
28053
|
-
function
|
|
28054
|
-
return
|
|
28022
|
+
function calculateDriftBorrowRate(bank, delta = ZERO, currentUtilization = null) {
|
|
28023
|
+
return calculateDriftInterestRate(bank, delta, currentUtilization);
|
|
28055
28024
|
}
|
|
28056
|
-
function
|
|
28057
|
-
const utilization = currentUtilization ||
|
|
28058
|
-
const borrowRate =
|
|
28025
|
+
function calculateDriftDepositRate(bank, delta = ZERO, currentUtilization = null) {
|
|
28026
|
+
const utilization = currentUtilization || calculateDriftUtilization(bank, delta);
|
|
28027
|
+
const borrowRate = calculateDriftBorrowRate(bank, delta, utilization);
|
|
28059
28028
|
const depositRate = borrowRate.mul(PERCENTAGE_PRECISION.sub(new BN(bank.insuranceFund.totalFactor))).mul(utilization).div(SPOT_MARKET_UTILIZATION_PRECISION).div(PERCENTAGE_PRECISION);
|
|
28060
28029
|
return depositRate;
|
|
28061
28030
|
}
|
|
28062
|
-
function
|
|
28063
|
-
const depositRate =
|
|
28031
|
+
function calculateDriftLendingAPY(bank, delta = ZERO, currentUtilization = null, compoundingPeriodsPerYear = 365) {
|
|
28032
|
+
const depositRate = calculateDriftDepositRate(bank, delta, currentUtilization);
|
|
28064
28033
|
if (depositRate.eq(ZERO)) {
|
|
28065
28034
|
return ZERO;
|
|
28066
28035
|
}
|
|
@@ -28087,13 +28056,13 @@ function calculateLendingAPY(bank, delta = ZERO, currentUtilization = null, comp
|
|
|
28087
28056
|
const apy = apyInCalcPrecision.mul(PERCENTAGE_PRECISION).div(CALC_PRECISION);
|
|
28088
28057
|
return apy;
|
|
28089
28058
|
}
|
|
28090
|
-
function
|
|
28091
|
-
const depositRate =
|
|
28059
|
+
function calculateDriftLendingAPR(bank, delta = ZERO, currentUtilization = null) {
|
|
28060
|
+
const depositRate = calculateDriftDepositRate(bank, delta, currentUtilization);
|
|
28092
28061
|
const apr = depositRate.mul(PERCENTAGE_PRECISION).div(SPOT_MARKET_RATE_PRECISION);
|
|
28093
28062
|
return apr;
|
|
28094
28063
|
}
|
|
28095
|
-
function
|
|
28096
|
-
const borrowRate =
|
|
28064
|
+
function calculateDriftBorrowAPY(bank, delta = ZERO, currentUtilization = null, compoundingPeriodsPerYear = 365) {
|
|
28065
|
+
const borrowRate = calculateDriftBorrowRate(bank, delta, currentUtilization);
|
|
28097
28066
|
if (borrowRate.eq(ZERO)) {
|
|
28098
28067
|
return ZERO;
|
|
28099
28068
|
}
|
|
@@ -28120,11 +28089,38 @@ function calculateBorrowAPY(bank, delta = ZERO, currentUtilization = null, compo
|
|
|
28120
28089
|
const apy = apyInCalcPrecision.mul(PERCENTAGE_PRECISION).div(CALC_PRECISION);
|
|
28121
28090
|
return apy;
|
|
28122
28091
|
}
|
|
28123
|
-
function
|
|
28124
|
-
const borrowRate =
|
|
28092
|
+
function calculateDriftBorrowAPR(bank, delta = ZERO, currentUtilization = null) {
|
|
28093
|
+
const borrowRate = calculateDriftBorrowRate(bank, delta, currentUtilization);
|
|
28125
28094
|
const apr = borrowRate.mul(PERCENTAGE_PRECISION).div(SPOT_MARKET_RATE_PRECISION);
|
|
28126
28095
|
return apr;
|
|
28127
28096
|
}
|
|
28097
|
+
var SLOTS_PER_YEAR2 = 63072e3;
|
|
28098
|
+
function calculateAPYFromAPR2(apr) {
|
|
28099
|
+
if (apr === 0) return 0;
|
|
28100
|
+
return Math.pow(1 + apr / SLOTS_PER_YEAR2, SLOTS_PER_YEAR2) - 1;
|
|
28101
|
+
}
|
|
28102
|
+
function generateDriftReserveCurve(spotMarket) {
|
|
28103
|
+
return Array.from({ length: 101 }, (_, i) => {
|
|
28104
|
+
const utilizationPercent = i / 100;
|
|
28105
|
+
const utilizationBN = new BN(
|
|
28106
|
+
Math.floor(utilizationPercent * SPOT_MARKET_UTILIZATION_PRECISION.toNumber())
|
|
28107
|
+
);
|
|
28108
|
+
const borrowRateBN = calculateDriftBorrowRate(spotMarket, ZERO, utilizationBN);
|
|
28109
|
+
const depositRateBN = calculateDriftDepositRate(spotMarket, ZERO, utilizationBN);
|
|
28110
|
+
const borrowAPR = borrowRateBN.toNumber() / SPOT_MARKET_RATE_PRECISION.toNumber();
|
|
28111
|
+
const supplyAPR = depositRateBN.toNumber() / SPOT_MARKET_RATE_PRECISION.toNumber();
|
|
28112
|
+
const borrowAPY = calculateAPYFromAPR2(borrowAPR);
|
|
28113
|
+
const supplyAPY = calculateAPYFromAPR2(supplyAPR);
|
|
28114
|
+
return {
|
|
28115
|
+
utilization: utilizationPercent * 100,
|
|
28116
|
+
// Convert to percentage (0-100)
|
|
28117
|
+
borrowAPY: borrowAPY * 100,
|
|
28118
|
+
// Convert to percentage
|
|
28119
|
+
supplyAPY: supplyAPY * 100
|
|
28120
|
+
// Convert to percentage
|
|
28121
|
+
};
|
|
28122
|
+
});
|
|
28123
|
+
}
|
|
28128
28124
|
|
|
28129
28125
|
// src/vendor/drift/utils/rewards.utils.ts
|
|
28130
28126
|
async function getDriftRewards(spotMarkets, userStates, connection) {
|
|
@@ -28275,6 +28271,6 @@ function makeUpdateSpotMarketIx({ spotMarket }) {
|
|
|
28275
28271
|
);
|
|
28276
28272
|
}
|
|
28277
28273
|
|
|
28278
|
-
export { ACCOUNT_SIZE, ACCOUNT_TYPE_SIZE, ASSOCIATED_TOKEN_PROGRAM_ID, AccountLayout, AccountState, AccountType, CorpAction, DEFAULT_RECENT_SLOT_DURATION_MS, DRIFT_IDL, DRIFT_PROGRAM_ID, DriftSpotBalanceType, ExtensionType, FARMS_PROGRAM_ID, KFARMS_IDL, KLEND_ACCOUNT_CODER, KLEND_IDL, KLEND_PROGRAM_ID, LENGTH_SIZE, MAX_SLOT_DIFFERENCE, MEMO_PROGRAM_ID, MINT_SIZE, MULTISIG_SIZE, MintLayout, MultisigLayout, NATIVE_MINT, ONE, ONE_HUNDRED_PCT_IN_BPS, ONE_YEAR, PERCENTAGE_PRECISION, PERCENTAGE_PRECISION_EXP, PriceStatus, PriceType, REFRESH_OBLIGATION_DISCRIMINATOR, SEED_BASE_REFERRER_STATE, SEED_BASE_REFERRER_TOKEN_STATE, SEED_BASE_SHORT_URL, SEED_BASE_USER_METADATA, SEED_DRIFT_SIGNER, SEED_DRIFT_STATE, SEED_FEE_RECEIVER, SEED_LENDING_MARKET_AUTH, SEED_RESERVE_COLL_MINT, SEED_RESERVE_COLL_SUPPLY, SEED_RESERVE_LIQ_SUPPLY, SEED_SPOT_MARKET, SEED_SPOT_MARKET_VAULT, SEED_USER, SEED_USER_STATE, SEED_USER_STATS, SLOTS_PER_DAY, SLOTS_PER_HOUR, SLOTS_PER_MINUTE, SLOTS_PER_SECOND, SLOTS_PER_YEAR, SPOT_MARKET_RATE_PRECISION, SPOT_MARKET_RATE_PRECISION_EXP, SPOT_MARKET_UTILIZATION_PRECISION, SPOT_MARKET_UTILIZATION_PRECISION_EXP, SWITCHBOARD_ONDEMANDE_PRICE_PRECISION, SinglePoolInstruction, SplAccountType, SpotBalanceType, TEN, TOKEN_2022_PROGRAM_ID, TOKEN_PROGRAM_ID, TYPE_SIZE, TokenAccountNotFoundError, TokenError, TokenInstruction, TokenInvalidAccountError, TokenInvalidAccountOwnerError, TokenInvalidAccountSizeError, TokenInvalidInstructionDataError, TokenInvalidInstructionKeysError, TokenInvalidInstructionProgramError, TokenInvalidInstructionTypeError, TokenInvalidMintError, TokenInvalidOwnerError, TokenOwnerOffCurveError, TokenUnsupportedInstructionError, ZERO, addSigners, calculateAPYFromAPR,
|
|
28274
|
+
export { ACCOUNT_SIZE, ACCOUNT_TYPE_SIZE, ASSOCIATED_TOKEN_PROGRAM_ID, AccountLayout, AccountState, AccountType, CorpAction, DEFAULT_RECENT_SLOT_DURATION_MS, DRIFT_IDL, DRIFT_PROGRAM_ID, DriftSpotBalanceType, ExtensionType, FARMS_PROGRAM_ID, KFARMS_IDL, KLEND_ACCOUNT_CODER, KLEND_IDL, KLEND_PROGRAM_ID, LENGTH_SIZE, MAX_SLOT_DIFFERENCE, MEMO_PROGRAM_ID, MINT_SIZE, MULTISIG_SIZE, MintLayout, MultisigLayout, NATIVE_MINT, ONE, ONE_HUNDRED_PCT_IN_BPS, ONE_YEAR, PERCENTAGE_PRECISION, PERCENTAGE_PRECISION_EXP, PriceStatus, PriceType, REFRESH_OBLIGATION_DISCRIMINATOR, SEED_BASE_REFERRER_STATE, SEED_BASE_REFERRER_TOKEN_STATE, SEED_BASE_SHORT_URL, SEED_BASE_USER_METADATA, SEED_DRIFT_SIGNER, SEED_DRIFT_STATE, SEED_FEE_RECEIVER, SEED_LENDING_MARKET_AUTH, SEED_RESERVE_COLL_MINT, SEED_RESERVE_COLL_SUPPLY, SEED_RESERVE_LIQ_SUPPLY, SEED_SPOT_MARKET, SEED_SPOT_MARKET_VAULT, SEED_USER, SEED_USER_STATE, SEED_USER_STATS, SLOTS_PER_DAY, SLOTS_PER_HOUR, SLOTS_PER_MINUTE, SLOTS_PER_SECOND, SLOTS_PER_YEAR, SPOT_MARKET_RATE_PRECISION, SPOT_MARKET_RATE_PRECISION_EXP, SPOT_MARKET_UTILIZATION_PRECISION, SPOT_MARKET_UTILIZATION_PRECISION_EXP, SWITCHBOARD_ONDEMANDE_PRICE_PRECISION, SinglePoolInstruction, SplAccountType, SpotBalanceType, TEN, TOKEN_2022_PROGRAM_ID, TOKEN_PROGRAM_ID, TYPE_SIZE, TokenAccountNotFoundError, TokenError, TokenInstruction, TokenInvalidAccountError, TokenInvalidAccountOwnerError, TokenInvalidAccountSizeError, TokenInvalidInstructionDataError, TokenInvalidInstructionKeysError, TokenInvalidInstructionProgramError, TokenInvalidInstructionTypeError, TokenInvalidMintError, TokenInvalidOwnerError, TokenOwnerOffCurveError, TokenUnsupportedInstructionError, ZERO, addSigners, calculateAPYFromAPR, calculateDriftBorrowAPR, calculateDriftBorrowAPY, calculateDriftBorrowRate, calculateDriftDepositRate, calculateDriftInterestRate, calculateDriftLendingAPR, calculateDriftLendingAPY, calculateDriftUtilization, calculateKaminoEstimatedBorrowRate, calculateKaminoEstimatedSupplyRate, calculateKaminoSupplyAPY, calculateRewardApy, calculateSlotAdjustmentFactor, calculateUtilizationRatio, closeAccountInstructionData, createAccountIx, createAssociatedTokenAccountIdempotentInstruction, createAssociatedTokenAccountInstruction, createCloseAccountInstruction, createInitializeAccountInstruction, createMemoInstruction, createPoolOnrampIx, createSyncNativeInstruction, createTransferCheckedInstruction, decodeDriftSpotMarketData, decodeDriftStateData, decodeDriftUserData, decodeDriftUserStatsData, decodeFarmDataRaw, decodeKlendObligationData, decodeKlendReserveData, decodeSwitchboardPullFeedData, deriveBaseObligation, deriveDriftSigner, deriveDriftSpotMarket, deriveDriftSpotMarketVault, deriveDriftState, deriveDriftUser, deriveDriftUserStats, deriveFeeReceiver, deriveLendingMarketAuthority, deriveObligation, deriveReferrerState, deriveReferrerTokenState, deriveReserveCollateralMint, deriveReserveCollateralSupply, deriveReserveLiquiditySupply, deriveShortUrl, deriveUserMetadata, deriveUserState, driftRewardsRawToDto, driftSpotMarketRawToDto, driftStateRawToDto, driftUserRawToDto, driftUserStatsRawToDto, dtoToDriftRewardsRaw, dtoToDriftSpotMarketRaw, dtoToDriftStateRaw, dtoToDriftUserRaw, dtoToDriftUserStatsRaw, dtoToFarmRaw, dtoToObligationRaw, dtoToReserveRaw, farmRawToDto, findMplMetadataAddress, findPoolAddress, findPoolMintAddress, findPoolMintAddressByVoteAccount, findPoolMintAuthorityAddress, findPoolMplAuthorityAddress, findPoolOnRampAddress, findPoolStakeAddress, findPoolStakeAuthorityAddress, generateDriftReserveCurve, generateKaminoReserveCurve, getAccount, getAccountLen, getAllDerivedDriftAccounts, getAllDerivedKaminoAccounts, getAllRequiredMarkets, getAssociatedTokenAddressSync, getDriftRewards, getDriftTokenAmount, getFixedHostInterestRate, getKaminoBorrowRate, getKaminoTotalSupply, getMinimumBalanceForRentExemptAccount, getMinimumBalanceForRentExemptAccountWithExtensions, getMint, getMultipleAccounts, getProtocolTakeRatePct, getReserveRewardsApy, getRewardPerTimeUnitSecond, getStakeAccount, getSwitchboardProgram, initializeAccountInstructionData, initializeStakedPoolIxs, initializeStakedPoolTx, interpolateLinear, isSpotBalanceTypeVariant, layout, makeRefreshObligationIx, makeRefreshReservesBatchIx, makeRefreshingIxs, makeUpdateSpotMarketCumulativeInterestIx, makeUpdateSpotMarketIx, obligationRawToDto, parsePriceData, parsePriceInfo2 as parsePriceInfo, replenishPoolIx, reserveRawToDto, scaledSupplies, slotAdjustmentFactor, switchboardAccountCoder, syncNativeInstructionData, transferCheckedInstructionData, truncateBorrowCurve, unpackAccount };
|
|
28279
28275
|
//# sourceMappingURL=vendor.js.map
|
|
28280
28276
|
//# sourceMappingURL=vendor.js.map
|