@panoptic-eng/sdk 1.0.13 → 1.0.15
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/README.md +23 -1
- package/dist/cow/index.js +1 -1
- package/dist/index.d.ts +13 -13
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -2
- package/dist/index.js.map +1 -1
- package/dist/panoptic/v2/index.js +4 -3
- package/dist/panoptic/v2/index.js.map +1 -1
- package/dist/test/index.d.ts +2 -2
- package/dist/test/index.d.ts.map +1 -1
- package/dist/uniswap/index.js +1 -1
- package/dist/{writes-uU8w6eAC.js → writes-BlCi23qF.js} +80 -11
- package/dist/writes-BlCi23qF.js.map +1 -0
- package/package.json +21 -5
- package/dist/writes-uU8w6eAC.js.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { BORROW_INDEX_BITS, BPS_SCALE, MARKET_EPOCH_BITS, MARKET_EPOCH_SHIFT, RATE_AT_TARGET_BITS, SECONDS_PER_YEAR, UNREALIZED_INTEREST_BITS, annualizePerSecondRateWad, deriveSupplyRatePerSecWad, formatPerSecondRateWadAsAprPct, formatPerSecondRateWadAsApyPct, formatRateWad, formatTokenAmount, formatTokenAmountSigned, formatTokenDelta, formatTokenFlow, formatWad, formatWadPercent, formatWadSigned, getAccountCollateral, getAccountSummaryBasic, getAccountSummaryRisk, getCollateralAddresses, getCollateralData, getCurrentRates, getInterestState, getIrmCurrent, getIrmCurve, getLiquidationPrices, getNetLiquidationValue, getNetLiquidationValues, isLiquidatable, packMarketState, panopticQueryAbi, parseTokenAmount, parseWad, ratePerSecWadToAprPct, readBlockAndAggregate, requireReturnData, utilizationBpsToWad, utilizationPctToWad } from "../../irm-psiA-OZ-.js";
|
|
2
2
|
import { AccountInsolventError, AlreadyInitializedError, BPS_DENOMINATOR, BatchValidationError, BelowMinimumRedemptionError, CastingError, ChunkHasZeroLiquidityError, ChunkLimitError, CrossPoolError, DEFAULT_MAX_SPREAD, DEFAULT_VEGOID, DepositTooLargeError, DuplicateTokenIdError, EffectiveLiquidityAboveThresholdError, ExceedsMaximumRedemptionError, InputListFailError, InsufficientCreditLiquidityError, InvalidBuilderCodeError, InvalidHistoryRangeError, InvalidTickBoundError, InvalidTickError, InvalidTokenIdParameterError, InvalidUniswapCallbackError, LEG_BITS, LEG_LIMITS, LEG_MASKS, LengthMismatchError, LiquidityTooHighError, LoanSlotExhaustedError, MAX_TICK, MAX_TRACKED_CHUNKS, MIN_TICK, MaxRetriesExceededError, MissingPositionIdsError, NetLiquidityZeroError, NetworkMismatchError, NoLegsExercisableError, NotALongLegError, NotBuilderError, NotEnoughLiquidityInChunkError, NotEnoughTokensError, NotGuardianError, NotMarginCalledError, NotPanopticPoolError, ORACLE_EPOCH_SECONDS, OracleRateLimitedError, PanopticError$1 as PanopticError, PanopticHelperNotDeployedError, PanopticValidationError, PoolNotInitializedError, PositionCountNotZeroError, PositionNotOwnedError, PositionSnapshotNotFoundError, PositionTooLargeError, PriceBoundFailError, PriceImpactTooLargeError, ProviderLagError, REORG_DEPTH, ReentrancyError, RpcError, RpcResponseError, SCHEMA_VERSION, STANDARD_TICK_WIDTHS, STORAGE_PREFIX, SafeModeError, StaleDataError, StaleOracleError, StorageDataNotFoundError, SwapTokenMismatchError, SyncTimeoutError, TOKEN_ID_BITS, TokenIdHasZeroLegsError, TooManyLegsOpenError, TransferFailedError, UTILIZATION_DENOMINATOR, UnauthorizedUniswapCallbackError, UnderOverFlowError, UnhealthyPoolError, WAD$1 as WAD, WrongPoolIdError, WrongUniswapPoolError, ZERO_COLLATERAL, ZERO_VALUATION, ZeroAddressError, ZeroCollateralRequirementError, calculatePositionDelta, calculatePositionDeltaWithSwap, calculatePositionGamma, calculatePositionGreeks, calculatePositionValue, collateralTrackerV2Abi, decodeLeftRightSigned, decodeLeftRightUnsigned, decodePosition, decodePositionBalance, decodeTickSpacing, fetchPoolId$1 as fetchPoolId, formatPriceRange$1 as formatPriceRange, formatTick$1 as formatTick, formatTickRange$1 as formatTickRange, getBlockMeta, getLegDelta, getLegGamma, getLegValue, getOracleState$1 as getOracleState, getPool$1 as getPool, getPoolMetadata$1 as getPoolMetadata, getPosition, getPositionGreeks, getPositions, getPricesAtTick$1 as getPricesAtTick, getRiskParameters$1 as getRiskParameters, getTickSpacing$1 as getTickSpacing, getUtilization$1 as getUtilization, isCall, isDefinedRisk, isPanopticErrorType, panopticFactoryV3Abi, panopticFactoryV4Abi, panopticGuardianAbi, panopticPoolV2Abi, panopticQueryAbi$1, parsePanopticError, priceToTick$1 as priceToTick, riskEngineAbi, roundToTickSpacing$1 as roundToTickSpacing, semiFungiblePositionManagerV3Abi, semiFungiblePositionManagerV4Abi, sqrtPriceX96ToPriceDecimalScaled$1 as sqrtPriceX96ToPriceDecimalScaled, sqrtPriceX96ToTick$1 as sqrtPriceX96ToTick, stateViewAbi, tickLimits$1 as tickLimits, tickToPrice$1 as tickToPrice, tickToPriceDecimalScaled$1 as tickToPriceDecimalScaled, tickToSqrtPriceX96$1 as tickToSqrtPriceX96, uniswapV3PoolAbi, validateBuilderCode$1 as validateBuilderCode } from "../../position-C3Ca4itE.js";
|
|
3
3
|
import { approveErc20ForCow, cancelCowOrder, checkCowApproval, getCowOrderStatus, isCowSupportedChain, quoteCowSwap, signAndSubmitCowOrder } from "../../cow-GmGNOlyp.js";
|
|
4
|
-
import { addLegToTokenId, approve, approveAndWait, approvePool, assertCanBurn, assertCanForceExercise, assertCanLiquidate, assertCanMint, assertFresh, assertHealthy, assertTradeable, borrow, borrowAndWait, buildBatchDispatchArgs, buildOpenPositionCalldata, buildUniqueLoan, calculateResyncBlock, cancelTransaction, checkApproval, clearCheckpoint, clearTrackedPositions, closePosition, closePositionAndWait, countLegs, createFileStorage, createMemoryStorage, createNonceManager, createTokenIdBuilder, decodeAllLegs, decodeDispatchCalldata, decodeLeg, decodePoolId, decodeTickSpacing$1, decodeTokenId, decodeVegoid, deployNewPool, deployNewPoolAndWait, deposit, depositAndWait, detectReorg, dispatch, dispatchAndWait, encodeLeg, encodePoolId, encodeV4PoolId, executeBatchDispatch, executeBatchDispatchAndWait, forceExercise, forceExerciseAndWait, getAssetIndex, getClosedPositionsKey, getOpenPositionIds, getPendingPositionsKey, getPoolMetaKey, getPoolPrefix, getPositionMetaKey, getPositionsKey, getSchemaVersionKey, getSyncCheckpointKey, getTrackedChunksKey, getTrackedPositionIds, hasLoanOrCredit, hasLongLeg, isCredit, isCreditLeg, isGasError, isInputListFailError, isLoan, isLoanLeg, isNonceError, isPositionTracked, isRetryableRpcError, isShortOnly, isSpread, jsonSerializer, liquidate, liquidateAndWait, loadCheckpoint, mint, mintAndWait, openPosition, openPositionAndWait, pokeOracle, pokeOracleAndWait, previewBorrow, previewUnwrap, previewWrap, publicBroadcaster, recoverSnapshot, recoverSnapshotFromTx, redeem, redeemAndWait, repay, repayAndWait, resolveTokenIndex, rollPosition, rollPositionAndWait, saveCheckpoint, settleAccumulatedPremia, settleAccumulatedPremiaAndWait, simulateOpenPosition, simulateWithTokenFlow, smartRepay, smartRepayAndWait, speedUpTransaction, supply, supplyAndWait, swapExactIn, swapExactInAndWait, swapExactOut, swapExactOutAndWait, syncPositions, unsupply, unsupplyAndWait, unwrapWeth, unwrapWethAndWait, unwrapXstock, unwrapXstockAndWait, validateBatch, validatePoolId, verifyBlockContinuity, wethWrapAbi, withdraw, withdrawAndWait, withdrawWithPositions, withdrawWithPositionsAndWait, wrapEth, wrapEthAndWait, wrapXstock, wrapXstockAndWait, xstockWrapperAbi } from "../../writes-
|
|
4
|
+
import { addLegToTokenId, approve, approveAndWait, approvePool, assertCanBurn, assertCanForceExercise, assertCanLiquidate, assertCanMint, assertFresh, assertHealthy, assertTradeable, borrow, borrowAndWait, buildBatchDispatchArgs, buildOpenPositionCalldata, buildUniqueLoan, calculateResyncBlock, cancelTransaction, checkApproval, clearCheckpoint, clearTrackedPositions, closePosition, closePositionAndWait, countLegs, createFileStorage, createMemoryStorage, createNonceManager, createTokenIdBuilder, decodeAllLegs, decodeDispatchCalldata, decodeLeg, decodePoolId, decodeTickSpacing$1, decodeTokenId, decodeVegoid, deployNewPool, deployNewPoolAndWait, deposit, depositAndWait, detectReorg, dispatch, dispatchAndWait, encodeLeg, encodePoolId, encodeV4PoolId, executeBatchDispatch, executeBatchDispatchAndWait, forceExercise, forceExerciseAndWait, getAssetIndex, getClosedPositionsKey, getOpenPositionIds, getPendingPositionsKey, getPoolMetaKey, getPoolPrefix, getPositionMetaKey, getPositionsKey, getSchemaVersionKey, getSyncCheckpointKey, getTrackedChunksKey, getTrackedPositionIds, hasLoanOrCredit, hasLongLeg, isCredit, isCreditLeg, isGasError, isInputListFailError, isLoan, isLoanLeg, isNonceError, isPositionTracked, isRetryableRpcError, isShortOnly, isSpread, jsonSerializer, liquidate, liquidateAndWait, loadCheckpoint, mint, mintAndWait, openPosition, openPositionAndWait, pokeOracle, pokeOracleAndWait, previewBorrow, previewUnwrap, previewWrap, publicBroadcaster, recoverSnapshot, recoverSnapshotFromTx, redeem, redeemAndWait, repay, repayAndWait, resolveTokenIndex, rollPosition, rollPositionAndWait, saveCheckpoint, settleAccumulatedPremia, settleAccumulatedPremiaAndWait, simulateOpenPosition, simulateWithTokenFlow, smartRepay, smartRepayAndWait, speedUpTransaction, supply, supplyAndWait, swapExactIn, swapExactInAndWait, swapExactOut, swapExactOutAndWait, syncPositions, unsupply, unsupplyAndWait, unwrapWeth, unwrapWethAndWait, unwrapXstock, unwrapXstockAndWait, validateBatch, validatePoolId, verifyBlockContinuity, wethWrapAbi, withdraw, withdrawAndWait, withdrawWithPositions, withdrawWithPositionsAndWait, wrapEth, wrapEthAndWait, wrapXstock, wrapXstockAndWait, xstockWrapperAbi } from "../../writes-BlCi23qF.js";
|
|
5
5
|
import { approveErc20ForPermit2, approveRouterViaPermit2, checkRouterApproval, quoteSwapExactInViaRouter, quoteSwapExactOutViaRouter, swapExactInViaRouter, swapExactOutViaRouter } from "../../router-Dd4tGu9L.js";
|
|
6
6
|
import { ContractFunctionExecutionError, decodeFunctionResult, encodeAbiParameters, encodeFunctionData, getAddress, keccak256, zeroAddress } from "viem";
|
|
7
7
|
import { multicall } from "viem/actions";
|
|
@@ -1129,14 +1129,15 @@ async function tryDispatchSimulation(params) {
|
|
|
1129
1129
|
const { client, poolAddress, account, tokenId, existingPositionIds, positionSize, swapAtMint } = params;
|
|
1130
1130
|
try {
|
|
1131
1131
|
const finalPositionIdList = [...existingPositionIds, tokenId];
|
|
1132
|
+
const MAX_EFFECTIVE_LIQUIDITY_LIMIT = 8388607;
|
|
1132
1133
|
const tickLimits$1 = swapAtMint ? [
|
|
1133
1134
|
887272,
|
|
1134
1135
|
-887272,
|
|
1135
|
-
|
|
1136
|
+
MAX_EFFECTIVE_LIQUIDITY_LIMIT
|
|
1136
1137
|
] : [
|
|
1137
1138
|
-887272,
|
|
1138
1139
|
887272,
|
|
1139
|
-
|
|
1140
|
+
MAX_EFFECTIVE_LIQUIDITY_LIMIT
|
|
1140
1141
|
];
|
|
1141
1142
|
const callData = encodeFunctionData({
|
|
1142
1143
|
abi: panopticPoolV2Abi,
|