@paraswap/dex-lib 4.7.15-executor-build-os-arm.0 → 4.7.16

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.
Files changed (34) hide show
  1. package/build/abi/pharaoh-v3/PharaohV3Factory.abi.json +0 -310
  2. package/build/abi/uniswap-v4/hooks/arena/arena-fee-helper.abi.json +476 -0
  3. package/build/dex/index.js +2 -0
  4. package/build/dex/index.js.map +1 -1
  5. package/build/dex/uniswap-v3/config.js +38 -34
  6. package/build/dex/uniswap-v3/config.js.map +1 -1
  7. package/build/dex/uniswap-v3/forks/pharaoh-v3/pharaoh-v3-pool.js +2 -5
  8. package/build/dex/uniswap-v3/forks/pharaoh-v3/pharaoh-v3-pool.js.map +1 -1
  9. package/build/dex/uniswap-v3/forks/pharaoh-v3/pharaoh-v3.js +9 -15
  10. package/build/dex/uniswap-v3/forks/pharaoh-v3/pharaoh-v3.js.map +1 -1
  11. package/build/dex/uniswap-v3/forks/velodrome-slipstream/velodrome-slipstream-pool.d.ts +2 -2
  12. package/build/dex/uniswap-v3/forks/velodrome-slipstream/velodrome-slipstream-pool.js.map +1 -1
  13. package/build/dex/uniswap-v3/uniswap-v3-pool.d.ts +2 -1
  14. package/build/dex/uniswap-v3/uniswap-v3-pool.js +3 -1
  15. package/build/dex/uniswap-v3/uniswap-v3-pool.js.map +1 -1
  16. package/build/dex/uniswap-v3/uniswap-v3.d.ts +2 -2
  17. package/build/dex/uniswap-v3/uniswap-v3.js +1 -1
  18. package/build/dex/uniswap-v3/uniswap-v3.js.map +1 -1
  19. package/build/dex/uniswap-v4/hooks/arena/arena-hook.d.ts +17 -0
  20. package/build/dex/uniswap-v4/hooks/arena/arena-hook.js +97 -0
  21. package/build/dex/uniswap-v4/hooks/arena/arena-hook.js.map +1 -0
  22. package/build/dex/uniswap-v4/hooks/arena.d.ts +6 -0
  23. package/build/dex/uniswap-v4/hooks/arena.js +10 -0
  24. package/build/dex/uniswap-v4/hooks/arena.js.map +1 -0
  25. package/build/dex/uniswap-v4/hooks/base-fee/base-fee-hook.d.ts +0 -0
  26. package/build/dex/uniswap-v4/hooks/base-fee/base-fee-hook.js +2 -0
  27. package/build/dex/uniswap-v4/hooks/base-fee/base-fee-hook.js.map +1 -0
  28. package/build/dex/uniswap-v4/hooks/index.d.ts +16 -1
  29. package/build/dex/uniswap-v4/hooks/index.js +34 -6
  30. package/build/dex/uniswap-v4/hooks/index.js.map +1 -1
  31. package/build/dex/uniswap-v4/hooks/types.d.ts +50 -0
  32. package/build/dex/uniswap-v4/hooks/types.js +3 -0
  33. package/build/dex/uniswap-v4/hooks/types.js.map +1 -0
  34. package/package.json +1 -1
@@ -0,0 +1,97 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.ArenaHook = void 0;
7
+ const __1 = require("..");
8
+ const ethers_1 = require("ethers");
9
+ const arena_fee_helper_abi_json_1 = __importDefault(require("../../../../abi/uniswap-v4/hooks/arena/arena-fee-helper.abi.json"));
10
+ const utils_1 = require("../../utils");
11
+ const ARENA_FEE_HELPER_ADDRESS = '0x537505DA49b4249b576fc8d00028bfDdf6189077';
12
+ class ArenaHook extends __1.BaseHook {
13
+ dexHelper;
14
+ arenaFeeHelper;
15
+ deployers = new Set();
16
+ constructor(dexHelper, arenaFeeHelper = new ethers_1.Contract(ARENA_FEE_HELPER_ADDRESS, arena_fee_helper_abi_json_1.default, dexHelper.provider)) {
17
+ super();
18
+ this.dexHelper = dexHelper;
19
+ this.arenaFeeHelper = arenaFeeHelper;
20
+ }
21
+ name() {
22
+ return 'ArenaHook';
23
+ }
24
+ setDeployer(address, enabled) {
25
+ if (enabled)
26
+ this.deployers.add(address.toLowerCase());
27
+ else
28
+ this.deployers.delete(address.toLowerCase());
29
+ }
30
+ async getHookPermissions() {
31
+ return {
32
+ beforeInitialize: true,
33
+ afterInitialize: false,
34
+ beforeAddLiquidity: false,
35
+ afterAddLiquidity: false,
36
+ beforeRemoveLiquidity: false,
37
+ afterRemoveLiquidity: false,
38
+ beforeSwap: false,
39
+ afterSwap: true,
40
+ beforeDonate: false,
41
+ afterDonate: false,
42
+ beforeSwapReturnDelta: false,
43
+ afterSwapReturnDelta: true,
44
+ afterAddLiquidityReturnDelta: false,
45
+ afterRemoveLiquidityReturnDelta: false,
46
+ };
47
+ }
48
+ async beforeInitialize(sender, key, sqrtPriceX96) {
49
+ if (!this.deployers.has(sender.toLowerCase())) {
50
+ throw new Error('Only deployer can call this function');
51
+ }
52
+ return '0x00000000'; // matches Solidity returning the selector
53
+ }
54
+ async afterSwap(sender, key, params, delta, hookData) {
55
+ // Determine unspecified output (same logic as Solidity)
56
+ const zeroForOne = params.zeroForOne;
57
+ const amountSpecified = BigInt(params.amountSpecified);
58
+ const isOutput0 = amountSpecified < 0n === zeroForOne;
59
+ const unspecifiedDelta = isOutput0 ? delta.amount0 : delta.amount1;
60
+ let output = unspecifiedDelta;
61
+ if (output === 0n)
62
+ return ['0x00000000', 0n];
63
+ if (output < 0n)
64
+ output = -output;
65
+ // Retrieve total fee ppm for this pool
66
+ const totalFeePpm = await this.arenaFeeHelper.getTotalFeePpm((0, utils_1.toId)(key));
67
+ if (totalFeePpm === 0) {
68
+ return ['0x00000000', 0n];
69
+ }
70
+ // MAX_HOOK_FEE = 1e6
71
+ const MAX_HOOK_FEE = 1_000_000;
72
+ const feeAmount = (output * BigInt(totalFeePpm)) / BigInt(MAX_HOOK_FEE);
73
+ // Split fee exactly like `_takeFees()` in Solidity
74
+ const feeParts = await this.arenaFeeHelper.getFeesForPool((0, utils_1.toId)(key));
75
+ let consumed = 0n;
76
+ const payouts = [];
77
+ for (let i = 0; i < feeParts.length; i++) {
78
+ const partPpm = BigInt(feeParts[i].feePpm);
79
+ let partAmount = (output * partPpm) / BigInt(MAX_HOOK_FEE);
80
+ // Apply remainder adjustment for the last recipient
81
+ consumed += partAmount;
82
+ if (i === feeParts.length - 1 && consumed < feeAmount) {
83
+ partAmount += feeAmount - consumed;
84
+ }
85
+ payouts.push({
86
+ recipient: feeParts[i].recipient,
87
+ fee: partAmount,
88
+ });
89
+ }
90
+ return [
91
+ '0xb47b2fb1', // selector for `super(BaseFeeHook).afterSwap`
92
+ feeAmount, // returned as int128 in Solidity
93
+ ];
94
+ }
95
+ }
96
+ exports.ArenaHook = ArenaHook;
97
+ //# sourceMappingURL=arena-hook.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"arena-hook.js","sourceRoot":"","sources":["../../../../../src/dex/uniswap-v4/hooks/arena/arena-hook.ts"],"names":[],"mappings":";;;;;;AAAA,0BAA8B;AAI9B,mCAAkC;AAElC,iIAAiG;AACjG,uCAAmC;AAEnC,MAAM,wBAAwB,GAAG,4CAA4C,CAAC;AAE9E,MAAa,SAAU,SAAQ,YAAQ;IAI1B;IACQ;IAJF,SAAS,GAAG,IAAI,GAAG,EAAU,CAAC;IAE/C,YACW,SAAqB,EACb,iBAAiB,IAAI,iBAAQ,CAC5C,wBAAwB,EACxB,mCAAiB,EACjB,SAAS,CAAC,QAAQ,CACnB;QAED,KAAK,EAAE,CAAC;QAPC,cAAS,GAAT,SAAS,CAAY;QACb,mBAAc,GAAd,cAAc,CAI9B;IAGH,CAAC;IAED,IAAI;QACF,OAAO,WAAW,CAAC;IACrB,CAAC;IAED,WAAW,CAAC,OAAgB,EAAE,OAAgB;QAC5C,IAAI,OAAO;YAAE,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC;;YAClD,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC;IACpD,CAAC;IAED,KAAK,CAAC,kBAAkB;QACtB,OAAO;YACL,gBAAgB,EAAE,IAAI;YACtB,eAAe,EAAE,KAAK;YACtB,kBAAkB,EAAE,KAAK;YACzB,iBAAiB,EAA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 @@
1
+ import { Network } from '../../../constants';
2
+ export declare const ARENA_HOOK: {
3
+ name: string;
4
+ address: string;
5
+ networks: Network[];
6
+ };
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ARENA_HOOK = void 0;
4
+ const constants_1 = require("../../../constants");
5
+ exports.ARENA_HOOK = {
6
+ name: 'ArenaHook',
7
+ address: '0xe32a5d788c568fc5a671255d17b618e70552e044',
8
+ networks: [constants_1.Network.AVALANCHE],
9
+ };
10
+ //# sourceMappingURL=arena.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"arena.js","sourceRoot":"","sources":["../../../../src/dex/uniswap-v4/hooks/arena.ts"],"names":[],"mappings":";;;AAAA,kDAA6C;AAEhC,QAAA,UAAU,GAAG;IACxB,IAAI,EAAE,WAAW;IACjB,OAAO,EAAE,4CAA4C;IACrD,QAAQ,EAAE,CAAC,mBAAO,CAAC,SAAS,CAAC;CAC9B,CAAC"}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ //# sourceMappingURL=base-fee-hook.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base-fee-hook.js","sourceRoot":"","sources":["../../../../../src/dex/uniswap-v4/hooks/base-fee/base-fee-hook.ts"],"names":[],"mappings":""}
@@ -1 +1,16 @@
1
- export {};
1
+ import { PoolKey } from '../types';
2
+ import { ModifyLiquidityParams, BalanceDelta, IBaseHook, HooksPermissions, SwapParams, BeforeSwapDelta } from './types';
3
+ export declare abstract class BaseHook implements IBaseHook {
4
+ abstract name(): string;
5
+ abstract getHookPermissions(): Promise<HooksPermissions>;
6
+ beforeInitialize(sender: string, key: PoolKey, sqrtPriceX96: string): Promise<string>;
7
+ afterInitialize(sender: string, key: PoolKey, sqrtPriceX96: string, tick: number): Promise<string>;
8
+ beforeAddLiquidity(sender: string, key: PoolKey, params: ModifyLiquidityParams, hookData: string): Promise<string>;
9
+ afterAddLiquidity(sender: string, key: PoolKey, params: ModifyLiquidityParams, delta0: BalanceDelta, delta1: BalanceDelta, hookData: string): Promise<[string, BalanceDelta]>;
10
+ beforeRemoveLiquidity(sender: string, key: PoolKey, params: ModifyLiquidityParams, hookData: string): Promise<string>;
11
+ afterRemoveLiquidity(sender: string, key: PoolKey, params: ModifyLiquidityParams, delta0: BalanceDelta, delta1: BalanceDelta, hookData: string): Promise<[string, BalanceDelta]>;
12
+ beforeSwap(sender: string, key: PoolKey, params: SwapParams, hookData: string): Promise<[string, BeforeSwapDelta, number]>;
13
+ afterSwap(sender: string, key: PoolKey, params: SwapParams, delta: BalanceDelta, hookData: string): Promise<[string, bigint]>;
14
+ beforeDonate(sender: string, key: PoolKey, amount0: string, amount1: string, hookData: string): Promise<string>;
15
+ afterDonate(sender: string, key: PoolKey, amount0: string, amount1: string, hookData: string): Promise<string>;
16
+ }
@@ -1,9 +1,37 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const template_1 = require("./template");
4
- const spot_1 = require("./spot");
5
- const SPOT_HOOK_ADDRESS = '0xa0b0d2d00fd544d8e0887f1a3cedd6e24baf10cc';
6
- template_1.uniswapV4HookRegistry.registerFactory(SPOT_HOOK_ADDRESS, params => {
7
- return new spot_1.SpotHook(params);
8
- });
3
+ exports.BaseHook = void 0;
4
+ class BaseHook {
5
+ async beforeInitialize(sender, key, sqrtPriceX96) {
6
+ return '0x00000000';
7
+ }
8
+ async afterInitialize(sender, key, sqrtPriceX96, tick) {
9
+ return '0x00000000';
10
+ }
11
+ async beforeAddLiquidity(sender, key, params, hookData) {
12
+ return '0x00000000';
13
+ }
14
+ async afterAddLiquidity(sender, key, params, delta0, delta1, hookData) {
15
+ return ['0x00000000', { amount0: 0n, amount1: 0n }];
16
+ }
17
+ async beforeRemoveLiquidity(sender, key, params, hookData) {
18
+ return '0x00000000';
19
+ }
20
+ async afterRemoveLiquidity(sender, key, params, delta0, delta1, hookData) {
21
+ return ['0x00000000', { amount0: 0n, amount1: 0n }];
22
+ }
23
+ async beforeSwap(sender, key, params, hookData) {
24
+ return ['0x00000000', { amount0: 0n, amount1: 0n }, 0];
25
+ }
26
+ async afterSwap(sender, key, params, delta, hookData) {
27
+ return ['0x00000000', 0n];
28
+ }
29
+ async beforeDonate(sender, key, amount0, amount1, hookData) {
30
+ return '0x00000000';
31
+ }
32
+ async afterDonate(sender, key, amount0, amount1, hookData) {
33
+ return '0x00000000';
34
+ }
35
+ }
36
+ exports.BaseHook = BaseHook;
9
37
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/dex/uniswap-v4/hooks/index.ts"],"names":[],"mappings":";;AAAA,yCAAmD;AACnD,iCAAkC;AAElC,MAAM,iBAAiB,GAAG,4CAA4C,CAAC;AAEvE,gCAAqB,CAAC,eAAe,CAAC,iBAAiB,EAAE,MAAM,CAAC,EAAE;IAChE,OAAO,IAAI,eAAQ,CAAC,MAAM,CAAC,CAAC;AAC9B,CAAC,CAAC,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/dex/uniswap-v4/hooks/index.ts"],"names":[],"mappings":";;;AAUA,MAAsB,QAAQ;IAI5B,KAAK,CAAC,gBAAgB,CACpB,MAAc,EACd,GAAY,EACZ,YAAoB;QAEpB,OAAO,YAAY,CAAC;IACtB,CAAC;IAED,KAAK,CAAC,eAAe,CACnB,MAAc,EACd,GAAY,EACZ,YAAoB,EACpB,IAAY;QAEZ,OAAO,YAAY,CAAC;IACtB,CAAC;IAED,KAAK,CAAC,kBAAkB,CACtB,MAAc,EACd,GAAY,EACZ,MAA6B,EAC7B,QAAgB;QAEhB,OAAO,YAAY,CAAC;IACtB,CAAC;IAED,KAAK,CAAC,iBAAiB,CACrB,MAAc,EACd,GAAY,EACZ,MAA6B,EAC7B,MAAoB,EACpB,MAAoB,EACpB,QAAgB;QAEhB,OAAO,CAAC,YAAY,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,CAAC;IACtD,CAAC;IAED,KAAK,CAAC,qBAAqB,CACzB,MAAc,EACd,GAAY,EACZ,MAA6B,EAC7B,QAAgB;QAEhB,OAAO,YAAY,CAAC;IACtB,CAAC;IAED,KAAK,CAAC,oBAAoB,CACxB,MAAc,EACd,GAAY,EACZ,MAA6B,EAC7B,MAAoB,EACpB,MAAoB,EACpB,QAAgB;QAEhB,OAAO,CAAC,YAAY,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,CAAC;IACtD,CAAC;IAED,KAAK,CAAC,UAAU,CACd,MAAc,EACd,GAAY,EACZ,MAAkB,EAClB,QAAgB;QAEhB,OAAO,CAAC,YAAY,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;IACzD,CAAC;IAED,KAAK,CAAC,SAAS,CACb,MAAc,EACd,GAAY,EACZ,MAAkB,EAClB,KAAmB,EACnB,QAAgB;QAEhB,OAAO,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC;IAC5B,CAAC;IAED,KAAK,CAAC,YAAY,CAChB,MAAc,EACd,GAAY,EACZ,OAAe,EACf,OAAe,EACf,QAAgB;QAEhB,OAAO,YAAY,CAAC;IACtB,CAAC;IAED,KAAK,CAAC,WAAW,CACf,MAAc,EACd,GAAY,EACZ,OAAe,EACf,OAAe,EACf,QAAgB;QAEhB,OAAO,YAAY,CAAC;IACtB,CAAC;CACF;AAnGD,4BAmGC"}
@@ -0,0 +1,50 @@
1
+ import { PoolKey } from '../types';
2
+ export interface BalanceDelta {
3
+ amount0: bigint;
4
+ amount1: bigint;
5
+ }
6
+ export interface BeforeSwapDelta {
7
+ amount0: bigint;
8
+ amount1: bigint;
9
+ }
10
+ export interface SwapParams {
11
+ zeroForOne: boolean;
12
+ amountSpecified: string;
13
+ sqrtPriceLimitX96: string;
14
+ }
15
+ export interface ModifyLiquidityParams {
16
+ tickLower: number;
17
+ tickUpper: number;
18
+ liquidityDelta: string;
19
+ salt: string;
20
+ }
21
+ export interface HooksPermissions {
22
+ beforeInitialize: boolean;
23
+ afterInitialize: boolean;
24
+ beforeAddLiquidity: boolean;
25
+ afterAddLiquidity: boolean;
26
+ beforeRemoveLiquidity: boolean;
27
+ afterRemoveLiquidity: boolean;
28
+ beforeSwap: boolean;
29
+ afterSwap: boolean;
30
+ beforeDonate: boolean;
31
+ afterDonate: boolean;
32
+ beforeSwapReturnDelta: boolean;
33
+ afterSwapReturnDelta: boolean;
34
+ afterAddLiquidityReturnDelta: boolean;
35
+ afterRemoveLiquidityReturnDelta: boolean;
36
+ }
37
+ export interface IBaseHook {
38
+ name(): string;
39
+ beforeInitialize?(sender: string, key: PoolKey, sqrtPriceX96: string): Promise<string>;
40
+ afterInitialize?(sender: string, key: PoolKey, sqrtPriceX96: string, tick: number): Promise<string>;
41
+ beforeAddLiquidity?(sender: string, key: PoolKey, params: ModifyLiquidityParams, hookData: string): Promise<string>;
42
+ beforeRemoveLiquidity?(sender: string, key: PoolKey, params: ModifyLiquidityParams, hookData: string): Promise<string>;
43
+ afterAddLiquidity?(sender: string, key: PoolKey, params: ModifyLiquidityParams, delta0: BalanceDelta, delta1: BalanceDelta, hookData: string): Promise<[string, BalanceDelta]>;
44
+ afterRemoveLiquidity?(sender: string, key: PoolKey, params: ModifyLiquidityParams, delta0: BalanceDelta, delta1: BalanceDelta, hookData: string): Promise<[string, BalanceDelta]>;
45
+ beforeSwap?(sender: string, key: PoolKey, params: SwapParams, hookData: string): Promise<[string, BeforeSwapDelta, number]>;
46
+ afterSwap?(sender: string, key: PoolKey, params: SwapParams, delta: BalanceDelta, hookData: string): Promise<[string, bigint]>;
47
+ beforeDonate?(sender: string, key: PoolKey, amount0: string, amount1: string, hookData: string): Promise<string>;
48
+ afterDonate?(sender: string, key: PoolKey, amount0: string, amount1: string, hookData: string): Promise<string>;
49
+ getHookPermissions(): Promise<HooksPermissions>;
50
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/dex/uniswap-v4/hooks/types.ts"],"names":[],"mappings":""}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paraswap/dex-lib",
3
- "version": "4.7.15-executor-build-os-arm.0",
3
+ "version": "4.7.16",
4
4
  "main": "build/index.js",
5
5
  "types": "build/index.d.ts",
6
6
  "repository": "https://github.com/paraswap/paraswap-dex-lib",