[{"inputs":[{"internalType":"contract ICVIOracle","name":"_cviOracle","type":"address"},{"internalType":"uint16","name":"_maxCVIValue","type":"uint16"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[],"name":"adjustedVolumeTimestamp","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"buyingPremiumFeeMaxPercent","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"buyingPremiumThreshold","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint168","name":"_tokenAmount","type":"uint168"},{"internalType":"uint8","name":"_leverage","type":"uint8"},{"internalType":"uint256","name":"_collateralRatio","type":"uint256"},{"internalType":"uint256","name":"_lastCollateralRatio","type":"uint256"},{"internalType":"bool","name":"_withVolumeFee","type":"bool"}],"name":"calculateBuyingPremiumFee","outputs":[{"internalType":"uint168","name":"buyingPremiumFee","type":"uint168"},{"internalType":"uint16","name":"combinedPremiumFeePercentage","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint168","name":"_tokenAmount","type":"uint168"},{"internalType":"uint8","name":"_leverage","type":"uint8"},{"internalType":"uint256","name":"_collateralRatio","type":"uint256"},{"internalType":"uint256","name":"_lastCollateralRatio","type":"uint256"},{"internalType":"bool","name":"_withVolumeFee","type":"bool"},{"internalType":"uint16","name":"_turbulenceIndicatorPercent","type":"uint16"}],"name":"calculateBuyingPremiumFeeWithAddendum","outputs":[{"internalType":"uint168","name":"buyingPremiumFee","type":"uint168"},{"internalType":"uint16","name":"combinedPremiumFeePercentage","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_creationTimestamp","type":"uint256"},{"internalType":"bool","name":"_isNoLockPositionAddress","type":"bool"}],"name":"calculateClosePositionFeePercent","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bool","name":"_withVolumeFee","type":"bool"}],"name":"calculateClosingPremiumFee","outputs":[{"internalType":"uint16","name":"combinedPremiumFeePercentage","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_collateralRatio","type":"uint256"},{"internalType":"uint256","name":"_lastCollateralRatio","type":"uint256"},{"internalType":"bool","name":"_withVolumeFee","type":"bool"}],"name":"calculateClosingPremiumFeeWithAddendum","outputs":[{"internalType":"uint16","name":"combinedPremiumFeePercentage","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"period","type":"uint256"},{"internalType":"uint16","name":"cviValue","type":"uint16"}],"internalType":"struct IFeesCalculator.CVIValue[]","name":"_cviValues","type":"tuple[]"}],"name":"calculateSingleUnitFundingFee","outputs":[{"internalType":"uint256","name":"fundingFee","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"totalTime","type":"uint256"},{"internalType":"uint256","name":"newRounds","type":"uint256"},{"internalType":"uint16","name":"_lastCVIValue","type":"uint16"},{"internalType":"uint16","name":"_currCVIValue","type":"uint16"}],"name":"calculateTurbulenceIndicatorPercent","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"calculateWithdrawFeePercent","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"closeAdjustedVolumeTimestamp","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"closeMaxVolumeFee","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"closeMaxVolumeFeeDeltaCollateral","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"closeMidVolumeFee","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"closePositionFeeDecayPeriod","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"closePositionFeePercent","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"closePositionLPFeePercent","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"closePositionMaxFeePercent","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"closeVolumeFeeTimeWindow","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"closeVolumeTimeWindow","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"closingPremiumFeeMaxPercent","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"collateralToBuyingPremiumMapping","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"cviOracle","outputs":[{"internalType":"contract ICVIOracle","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"depositFeePercent","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"fundingFeeConstantRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxCVIValue","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxTurbulenceFeePercentToTrim","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxVolumeFee","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxVolumeFeeDeltaCollateral","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"midVolumeFee","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"openPositionFeePercent","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"openPositionFees","outputs":[{"internalType":"uint16","name":"openPositionFeePercentResult","type":"uint16"},{"internalType":"uint16","name":"buyingPremiumFeeMaxPercentResult","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"openPositionLPFeePercent","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"oracleHeartbeatPeriod","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_newBuyingPremiumFeeMaxPercentage","type":"uint16"}],"name":"setBuyingPremiumFeeMax","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_newBuyingPremiumThreshold","type":"uint16"}],"name":"setBuyingPremiumThreshold","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_newCloseMaxVolumeFee","type":"uint16"}],"name":"setCloseMaxVolumeFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_newCloseMaxVolumeFeeDeltaCollateral","type":"uint16"}],"name":"setCloseMaxVolumeFeeDeltaCollateral","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_newCloseMidVolumeFee","type":"uint16"}],"name":"setCloseMidVolumeFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_newClosePositionFeePercentage","type":"uint16"}],"name":"setClosePositionFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_newClosePositionFeeDecayPeriod","type":"uint256"}],"name":"setClosePositionFeeDecay","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_newClosePositionLPFeePercent","type":"uint16"}],"name":"setClosePositionLPFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_newClosePositionMaxFeePercentage","type":"uint16"}],"name":"setClosePositionMaxFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_newCloseVolumeFeeTimeWindow","type":"uint16"}],"name":"setCloseVolumeFeeTimeWindow","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_newCloseVolumeTimeWindow","type":"uint16"}],"name":"setCloseVolumeTimeWindow","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_newClosingPremiumFeeMaxPercentage","type":"uint16"}],"name":"setClosingPremiumFeeMax","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16[]","name":"_newCollateralToBuyingPremiumMapping","type":"uint16[]"}],"name":"setCollateralToBuyingPremiumMapping","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_newDepositFeePercentage","type":"uint16"}],"name":"setDepositFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_newfundingFeeConstantRate","type":"uint16"}],"name":"setFundingFeeConstantRate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_newMaxTurbulenceFeePercentToTrim","type":"uint16"}],"name":"setMaxTurbulenceFeePercentToTrim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_newMaxVolumeFee","type":"uint16"}],"name":"setMaxVolumeFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_newMaxVolumeFeeDeltaCollateral","type":"uint16"}],"name":"setMaxVolumeFeeDeltaCollateral","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_newMidVolumeFee","type":"uint16"}],"name":"setMidVolumeFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_newOpenPositionFeePercentage","type":"uint16"}],"name":"setOpenPositionFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_newOpenPositionLPFeePercent","type":"uint16"}],"name":"setOpenPositionLPFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ICVIOracle","name":"_cviOracle","type":"address"}],"name":"setOracle","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_newOracleHeartbeatPeriod","type":"uint256"}],"name":"setOracleHeartbeatPeriod","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newUpdator","type":"address"}],"name":"setStateUpdator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_newTurbulenceDeviationPercentage","type":"uint16"}],"name":"setTurbulenceDeviationPercent","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_newTurbulenceDeviationThresholdPercent","type":"uint16"}],"name":"setTurbulenceDeviationThresholdPercent","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_newTurbulenceStepPercentage","type":"uint16"}],"name":"setTurbulenceStep","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_newVolumeFeeTimeWindow","type":"uint16"}],"name":"setVolumeFeeTimeWindow","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_newVolumeTimeWindow","type":"uint16"}],"name":"setVolumeTimeWindow","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_newWithdrawFeePercentage","type":"uint16"}],"name":"setWithdrawFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"stateUpdator","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"turbulenceDeviationPercentage","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"turbulenceDeviationThresholdPercent","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"turbulenceIndicatorPercent","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"turbulenceStepPercent","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_collateralRatio","type":"uint256"},{"internalType":"uint256","name":"_lastCollateralRatio","type":"uint256"}],"name":"updateAdjustedTimestamp","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_collateralRatio","type":"uint256"},{"internalType":"uint256","name":"_lastCollateralRatio","type":"uint256"}],"name":"updateCloseAdjustedTimestamp","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_latestTimestamp","type":"uint256"},{"internalType":"uint256","name":"_blockTimestampSnapshot","type":"uint256"},{"internalType":"uint256","name":"_latestTimestampSnapshot","type":"uint256"},{"internalType":"uint80","name":"latestOracleRoundId","type":"uint80"}],"name":"updateSnapshots","outputs":[{"components":[{"internalType":"uint256","name":"latestSnapshot","type":"uint256"},{"internalType":"uint256","name":"singleUnitFundingFee","type":"uint256"},{"internalType":"uint256","name":"totalTime","type":"uint256"},{"internalType":"uint256","name":"totalRounds","type":"uint256"},{"internalType":"uint256","name":"cviValueTimestamp","type":"uint256"},{"internalType":"uint80","name":"newLatestRoundId","type":"uint80"},{"internalType":"uint16","name":"cviValue","type":"uint16"},{"internalType":"bool","name":"updatedSnapshot","type":"bool"},{"internalType":"bool","name":"updatedLatestRoundId","type":"bool"},{"internalType":"bool","name":"updatedLatestTimestamp","type":"bool"},{"internalType":"bool","name":"updatedTurbulenceData","type":"bool"}],"internalType":"struct IFeesCalculator.SnapshotUpdate","name":"snapshotUpdate","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_totalTime","type":"uint256"},{"internalType":"uint256","name":"_newRounds","type":"uint256"},{"internalType":"uint16","name":"_lastCVIValue","type":"uint16"},{"internalType":"uint16","name":"_currCVIValue","type":"uint16"}],"name":"updateTurbulenceIndicatorPercent","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"volumeFeeTimeWindow","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"volumeTimeWindow","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"withdrawFeePercent","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"}]