timelock-sdk 0.0.87 → 0.0.88
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/{client-pWy70TUj.d.cts → client-6pZEu7Q3.d.cts} +225 -225
- package/dist/{client-CYa7ruZt.d.ts → client-C5RLDuP0.d.ts} +146 -146
- package/dist/client.cjs +4 -4
- package/dist/client.cjs.map +1 -1
- package/dist/client.d.cts +1 -1
- package/dist/client.d.ts +1 -1
- package/dist/client.js +4 -4
- package/dist/client.js.map +1 -1
- package/dist/package.d.cts +1 -1
- package/dist/package.d.ts +1 -1
- package/package.json +1 -1
package/dist/client.cjs
CHANGED
|
@@ -557,16 +557,16 @@ const useMintOption = (marketAddr) => {
|
|
|
557
557
|
//#endregion
|
|
558
558
|
//#region src/hooks/options/useOptionPnl.ts
|
|
559
559
|
const useOptionPnl = (option) => {
|
|
560
|
-
const { marketAddr, optionType,
|
|
560
|
+
const { marketAddr, optionType, strikeTick, positionSizeCurrent } = option;
|
|
561
561
|
const { pool, optionAssetIsToken0, payoutAssetDecimals, tickSpacing } = useMarketData(marketAddr);
|
|
562
562
|
const { exact: currentTick } = useCurrentTick(pool);
|
|
563
563
|
const displayPnl = (0, react.useMemo)(() => {
|
|
564
564
|
if (optionAssetIsToken0 === void 0 || currentTick === void 0 || !payoutAssetDecimals) return void 0;
|
|
565
|
-
const
|
|
566
|
-
const delta = (optionAssetIsToken0 ? require_optionUtils.token0ToToken1(positionSizeCurrent, currentTick) : require_optionUtils.token1ToToken0(positionSizeCurrent, currentTick)) -
|
|
565
|
+
const strikeSize = optionAssetIsToken0 ? require_optionUtils.token0ToToken1(positionSizeCurrent, strikeTick) : require_optionUtils.token1ToToken0(positionSizeCurrent, strikeTick);
|
|
566
|
+
const delta = (optionAssetIsToken0 ? require_optionUtils.token0ToToken1(positionSizeCurrent, currentTick) : require_optionUtils.token1ToToken0(positionSizeCurrent, currentTick)) - strikeSize;
|
|
567
567
|
return require_optionUtils.wrapAmount(optionType === "CALL" ? delta : -delta, payoutAssetDecimals);
|
|
568
568
|
}, [
|
|
569
|
-
|
|
569
|
+
strikeTick,
|
|
570
570
|
optionType,
|
|
571
571
|
optionAssetIsToken0,
|
|
572
572
|
currentTick,
|