From 75b48ecdcd22aaad2d3199ef0f48f29e855b9db9 Mon Sep 17 00:00:00 2001 From: Rod Vagg Date: Mon, 9 Sep 2024 19:18:05 +1000 Subject: [PATCH] fix: update snap for latest lotus & minor test regex fix --- test/UniswapV3Pool.swaps.spec.ts | 2 +- .../UniswapV3Pool.gas.spec.ts.snap | 72 +- .../UniswapV3Pool.swaps.spec.ts.snap | 748 +++++++++++++++++- 3 files changed, 742 insertions(+), 80 deletions(-) diff --git a/test/UniswapV3Pool.swaps.spec.ts b/test/UniswapV3Pool.swaps.spec.ts index 013b5676..a20281cf 100644 --- a/test/UniswapV3Pool.swaps.spec.ts +++ b/test/UniswapV3Pool.swaps.spec.ts @@ -514,7 +514,7 @@ describe('UniswapV3Pool swap tests', () => { await (await tx).wait() } catch (error) { // extract reason - const match = /revert reason: Error\((.+)\),/g.exec(error.message) || [null, null] + const match = /revert reason: Error\(([^)]+)\),/g.exec(error.message) || [null, null] const vmError = `VM Exception while processing transaction: revert ${match[1]}` expect({ diff --git a/test/__snapshots__/UniswapV3Pool.gas.spec.ts.snap b/test/__snapshots__/UniswapV3Pool.gas.spec.ts.snap index 81fba378..c4b61a93 100644 --- a/test/__snapshots__/UniswapV3Pool.gas.spec.ts.snap +++ b/test/__snapshots__/UniswapV3Pool.gas.spec.ts.snap @@ -1,73 +1,73 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`UniswapV3Pool gas tests fee is off #burn above current price burn entire position after some time passes 1`] = `16858984`; +exports[`UniswapV3Pool gas tests fee is off #burn above current price burn entire position after some time passes 1`] = `17039948`; -exports[`UniswapV3Pool gas tests fee is off #burn above current price burn when only position using ticks 1`] = `16858984`; +exports[`UniswapV3Pool gas tests fee is off #burn above current price burn when only position using ticks 1`] = `17039948`; -exports[`UniswapV3Pool gas tests fee is off #burn above current price entire position burn but other positions are using the ticks 1`] = `20348170`; +exports[`UniswapV3Pool gas tests fee is off #burn above current price entire position burn but other positions are using the ticks 1`] = `19210034`; -exports[`UniswapV3Pool gas tests fee is off #burn above current price partial position burn 1`] = `20325158`; +exports[`UniswapV3Pool gas tests fee is off #burn above current price partial position burn 1`] = `20495633`; -exports[`UniswapV3Pool gas tests fee is off #burn around current price burn entire position after some time passes 1`] = `21826474`; +exports[`UniswapV3Pool gas tests fee is off #burn around current price burn entire position after some time passes 1`] = `21651040`; -exports[`UniswapV3Pool gas tests fee is off #burn around current price burn when only position using ticks 1`] = `20244539`; +exports[`UniswapV3Pool gas tests fee is off #burn around current price burn when only position using ticks 1`] = `20068602`; -exports[`UniswapV3Pool gas tests fee is off #burn around current price entire position burn but other positions are using the ticks 1`] = `24130946`; +exports[`UniswapV3Pool gas tests fee is off #burn around current price entire position burn but other positions are using the ticks 1`] = `23977957`; -exports[`UniswapV3Pool gas tests fee is off #burn around current price partial position burn 1`] = `24749042`; +exports[`UniswapV3Pool gas tests fee is off #burn around current price partial position burn 1`] = `24925432`; -exports[`UniswapV3Pool gas tests fee is off #burn below current price burn entire position after some time passes 1`] = `19035885`; +exports[`UniswapV3Pool gas tests fee is off #burn below current price burn entire position after some time passes 1`] = `20281848`; -exports[`UniswapV3Pool gas tests fee is off #burn below current price burn when only position using ticks 1`] = `19035885`; +exports[`UniswapV3Pool gas tests fee is off #burn below current price burn when only position using ticks 1`] = `20281848`; -exports[`UniswapV3Pool gas tests fee is off #burn below current price entire position burn but other positions are using the ticks 1`] = `24351940`; +exports[`UniswapV3Pool gas tests fee is off #burn below current price entire position burn but other positions are using the ticks 1`] = `24577204`; -exports[`UniswapV3Pool gas tests fee is off #burn below current price partial position burn 1`] = `25357423`; +exports[`UniswapV3Pool gas tests fee is off #burn below current price partial position burn 1`] = `25547747`; -exports[`UniswapV3Pool gas tests fee is off #increaseObservationCardinalityNext grow by 1 slot 1`] = `12069045`; +exports[`UniswapV3Pool gas tests fee is off #increaseObservationCardinalityNext grow by 1 slot 1`] = `12235828`; -exports[`UniswapV3Pool gas tests fee is off #increaseObservationCardinalityNext no op 1`] = `11788288`; +exports[`UniswapV3Pool gas tests fee is off #increaseObservationCardinalityNext no op 1`] = `11952852`; -exports[`UniswapV3Pool gas tests fee is off #poke best case 1`] = `15542873`; +exports[`UniswapV3Pool gas tests fee is off #poke best case 1`] = `15567811`; -exports[`UniswapV3Pool gas tests fee is off #snapshotCumulativesInside tick above 1`] = `7862236`; +exports[`UniswapV3Pool gas tests fee is off #snapshotCumulativesInside tick above 1`] = `7879028`; -exports[`UniswapV3Pool gas tests fee is off #snapshotCumulativesInside tick below 1`] = `7848095`; +exports[`UniswapV3Pool gas tests fee is off #snapshotCumulativesInside tick below 1`] = `7864952`; -exports[`UniswapV3Pool gas tests fee is off #snapshotCumulativesInside tick inside 1`] = `8811320`; +exports[`UniswapV3Pool gas tests fee is off #snapshotCumulativesInside tick inside 1`] = `8828062`; -exports[`UniswapV3Pool gas tests fee is on #burn above current price burn entire position after some time passes 1`] = `17203408`; +exports[`UniswapV3Pool gas tests fee is on #burn above current price burn entire position after some time passes 1`] = `17402244`; -exports[`UniswapV3Pool gas tests fee is on #burn above current price burn when only position using ticks 1`] = `17203408`; +exports[`UniswapV3Pool gas tests fee is on #burn above current price burn when only position using ticks 1`] = `17402244`; -exports[`UniswapV3Pool gas tests fee is on #burn above current price entire position burn but other positions are using the ticks 1`] = `20682373`; +exports[`UniswapV3Pool gas tests fee is on #burn above current price entire position burn but other positions are using the ticks 1`] = `19571346`; -exports[`UniswapV3Pool gas tests fee is on #burn above current price partial position burn 1`] = `20691610`; +exports[`UniswapV3Pool gas tests fee is on #burn above current price partial position burn 1`] = `20871128`; -exports[`UniswapV3Pool gas tests fee is on #burn around current price burn entire position after some time passes 1`] = `22214826`; +exports[`UniswapV3Pool gas tests fee is on #burn around current price burn entire position after some time passes 1`] = `22025148`; -exports[`UniswapV3Pool gas tests fee is on #burn around current price burn when only position using ticks 1`] = `20609047`; +exports[`UniswapV3Pool gas tests fee is on #burn around current price burn when only position using ticks 1`] = `20439646`; -exports[`UniswapV3Pool gas tests fee is on #burn around current price entire position burn but other positions are using the ticks 1`] = `24512242`; +exports[`UniswapV3Pool gas tests fee is on #burn around current price entire position burn but other positions are using the ticks 1`] = `24344469`; -exports[`UniswapV3Pool gas tests fee is on #burn around current price partial position burn 1`] = `25115170`; +exports[`UniswapV3Pool gas tests fee is on #burn around current price partial position burn 1`] = `25288035`; -exports[`UniswapV3Pool gas tests fee is on #burn below current price burn entire position after some time passes 1`] = `19393781`; +exports[`UniswapV3Pool gas tests fee is on #burn below current price burn entire position after some time passes 1`] = `20638884`; -exports[`UniswapV3Pool gas tests fee is on #burn below current price burn when only position using ticks 1`] = `19393781`; +exports[`UniswapV3Pool gas tests fee is on #burn below current price burn when only position using ticks 1`] = `20638884`; -exports[`UniswapV3Pool gas tests fee is on #burn below current price entire position burn but other positions are using the ticks 1`] = `24707532`; +exports[`UniswapV3Pool gas tests fee is on #burn below current price entire position burn but other positions are using the ticks 1`] = `24946267`; -exports[`UniswapV3Pool gas tests fee is on #burn below current price partial position burn 1`] = `25723014`; +exports[`UniswapV3Pool gas tests fee is on #burn below current price partial position burn 1`] = `25913095`; -exports[`UniswapV3Pool gas tests fee is on #increaseObservationCardinalityNext grow by 1 slot 1`] = `12161903`; +exports[`UniswapV3Pool gas tests fee is on #increaseObservationCardinalityNext grow by 1 slot 1`] = `12328651`; -exports[`UniswapV3Pool gas tests fee is on #increaseObservationCardinalityNext no op 1`] = `11881067`; +exports[`UniswapV3Pool gas tests fee is on #increaseObservationCardinalityNext no op 1`] = `12045631`; -exports[`UniswapV3Pool gas tests fee is on #poke best case 1`] = `15901061`; +exports[`UniswapV3Pool gas tests fee is on #poke best case 1`] = `15933211`; -exports[`UniswapV3Pool gas tests fee is on #snapshotCumulativesInside tick above 1`] = `7868305`; +exports[`UniswapV3Pool gas tests fee is on #snapshotCumulativesInside tick above 1`] = `7885142`; -exports[`UniswapV3Pool gas tests fee is on #snapshotCumulativesInside tick below 1`] = `7854426`; +exports[`UniswapV3Pool gas tests fee is on #snapshotCumulativesInside tick below 1`] = `7871313`; -exports[`UniswapV3Pool gas tests fee is on #snapshotCumulativesInside tick inside 1`] = `8813742`; +exports[`UniswapV3Pool gas tests fee is on #snapshotCumulativesInside tick inside 1`] = `8830485`; diff --git a/test/__snapshots__/UniswapV3Pool.swaps.spec.ts.snap b/test/__snapshots__/UniswapV3Pool.swaps.spec.ts.snap index 0b3168ce..e36c7c00 100644 --- a/test/__snapshots__/UniswapV3Pool.swaps.spec.ts.snap +++ b/test/__snapshots__/UniswapV3Pool.swaps.spec.ts.snap @@ -85,7 +85,7 @@ Object { "poolBalance0": "1", "poolBalance1": "26087635650665564424699143612505016738", "poolPriceBefore": "1.7014e+38", - "swapError": "VM Exception while processing transaction: revert SPL), vm error: message failed with backtrace:\\\\n00: f04363 (method 3844450837) -- contract reverted (33)\\\\n01: f04366 (method 3844450837) -- contract reverted (33)\\\\n (RetCode=33)\\", method=\\"estimateGas\\", transaction={\\"from\\":\\"0x651F8E3f40f3Fc568f72430632CD0A9d20b38657\\",\\"to\\":\\"0x0C8E49CD6A86ED0631C912a1076743C73E21aC82\\",\\"data\\":\\"0xe2be910900000000000000000000000000313aeacc4a661ede6b9556bb15476d79f29d3b0000000000000000000000000000000000000000000000000de0b6b3a7640000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000016a09e667f3bcc908b2fb1366\\",\\"accessList\\":null}, error={\\"name\\":\\"ProviderError\\",\\"_stack\\":\\"ProviderError: failed to estimate gas: message execution failed: exit 33, revert reason: Error(SPL", + "swapError": "VM Exception while processing transaction: revert SPL", "tickBefore": 880340, } `; @@ -207,7 +207,7 @@ Object { "poolBalance0": "1", "poolBalance1": "26087635650665564424699143612505016738", "poolPriceBefore": "1.7014e+38", - "swapError": "VM Exception while processing transaction: revert SPL), vm error: message failed with backtrace:\\\\n00: f04379 (method 3844450837) -- contract reverted (33)\\\\n01: f04382 (method 3844450837) -- contract reverted (33)\\\\n (RetCode=33)\\", method=\\"estimateGas\\", transaction={\\"from\\":\\"0x651F8E3f40f3Fc568f72430632CD0A9d20b38657\\",\\"to\\":\\"0x67Ad6d4F79977ddC9590Cf2e11338032C372255f\\",\\"data\\":\\"0xf603482c0000000000000000000000002ebca58477c1dcb3b6f5cc52c34d53c3e0878ae00000000000000000000000000000000000000000000000000de0b6b3a7640000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000016a09e667f3bcc908b2fb1366\\",\\"accessList\\":null}, error={\\"name\\":\\"ProviderError\\",\\"_stack\\":\\"ProviderError: failed to estimate gas: message execution failed: exit 33, revert reason: Error(SPL", + "swapError": "VM Exception while processing transaction: revert SPL", "tickBefore": 880340, } `; @@ -217,7 +217,7 @@ Object { "poolBalance0": "1", "poolBalance1": "26087635650665564424699143612505016738", "poolPriceBefore": "1.7014e+38", - "swapError": "VM Exception while processing transaction: revert SPL), vm error: message failed with backtrace:\\\\n00: f04443 (method 3844450837) -- contract reverted (33)\\\\n01: f04446 (method 3844450837) -- contract reverted (33)\\\\n (RetCode=33)\\", method=\\"estimateGas\\", transaction={\\"from\\":\\"0x651F8E3f40f3Fc568f72430632CD0A9d20b38657\\",\\"to\\":\\"0x4acdB8a1E330797d9E2F7083de769497F56F9445\\",\\"data\\":\\"0x9e77b805000000000000000000000000275d18f1d578777e947ef4c6d3062ae99d8f3fda0000000000000000000000000000000000000000a1e89b12424876d9b744b6790000000000000000000000000000000000000000000000000000000000000001\\",\\"accessList\\":null}, error={\\"name\\":\\"ProviderError\\",\\"_stack\\":\\"ProviderError: failed to estimate gas: message execution failed: exit 33, revert reason: Error(SPL", + "swapError": "VM Exception while processing transaction: revert SPL", "tickBefore": 880340, } `; @@ -227,7 +227,7 @@ Object { "poolBalance0": "1", "poolBalance1": "26087635650665564424699143612505016738", "poolPriceBefore": "1.7014e+38", - "swapError": "VM Exception while processing transaction: revert SPL), vm error: message failed with backtrace:\\\\n00: f04419 (method 3844450837) -- contract reverted (33)\\\\n01: f04422 (method 3844450837) -- contract reverted (33)\\\\n (RetCode=33)\\", method=\\"estimateGas\\", transaction={\\"from\\":\\"0x651F8E3f40f3Fc568f72430632CD0A9d20b38657\\",\\"to\\":\\"0xbd2be87015c30AD9c20ceD6A16F9928dbb75FA49\\",\\"data\\":\\"0x9e77b805000000000000000000000000917243ae82a519cf6a860229df035f008746b642000000000000000000000000000000000000000194c583ada5b529204a2bc8300000000000000000000000000000000000000000000000000000000000000001\\",\\"accessList\\":null}, error={\\"name\\":\\"ProviderError\\",\\"_stack\\":\\"ProviderError: failed to estimate gas: message execution failed: exit 33, revert reason: Error(SPL", + "swapError": "VM Exception while processing transaction: revert SPL", "tickBefore": 880340, } `; @@ -285,7 +285,7 @@ Object { "poolBalance0": "26037782196502120275425782622539039026", "poolBalance1": "1", "poolPriceBefore": "0.0000000000000000000000000000000000000059000", - "swapError": "VM Exception while processing transaction: revert SPL), vm error: message failed with backtrace:\\\\n00: f04483 (method 3844450837) -- contract reverted (33)\\\\n01: f04486 (method 3844450837) -- contract reverted (33)\\\\n (RetCode=33)\\", method=\\"estimateGas\\", transaction={\\"from\\":\\"0x651F8E3f40f3Fc568f72430632CD0A9d20b38657\\",\\"to\\":\\"0x3058aF1EF8fEa9AEaa8F3BfDe7cf9E26129A6cbf\\",\\"data\\":\\"0x6dfc0ddb00000000000000000000000031b94f87e08e68a8cb1c2b2d8b8bfcbf7b6c295d0000000000000000000000000000000000000000000000000de0b6b3a764000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000b504f333f9de6484597d89b3\\",\\"accessList\\":null}, error={\\"name\\":\\"ProviderError\\",\\"_stack\\":\\"ProviderError: failed to estimate gas: message execution failed: exit 33, revert reason: Error(SPL", + "swapError": "VM Exception while processing transaction: revert SPL", "tickBefore": -880303, } `; @@ -359,7 +359,7 @@ Object { "poolBalance0": "26037782196502120275425782622539039026", "poolBalance1": "1", "poolPriceBefore": "0.0000000000000000000000000000000000000059000", - "swapError": "VM Exception while processing transaction: revert SPL), vm error: message failed with backtrace:\\\\n00: f04499 (method 3844450837) -- contract reverted (33)\\\\n01: f04502 (method 3844450837) -- contract reverted (33)\\\\n (RetCode=33)\\", method=\\"estimateGas\\", transaction={\\"from\\":\\"0x651F8E3f40f3Fc568f72430632CD0A9d20b38657\\",\\"to\\":\\"0xddfE6b9aba0F06027b35c544959dCba4e5c8884A\\",\\"data\\":\\"0xbac7bf780000000000000000000000003d41c358bafad4cf9241d6b12a9b90890c4dad300000000000000000000000000000000000000000000000000de0b6b3a764000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000b504f333f9de6484597d89b3\\",\\"accessList\\":null}, error={\\"name\\":\\"ProviderError\\",\\"_stack\\":\\"ProviderError: failed to estimate gas: message execution failed: exit 33, revert reason: Error(SPL", + "swapError": "VM Exception while processing transaction: revert SPL", "tickBefore": -880303, } `; @@ -369,7 +369,7 @@ Object { "poolBalance0": "26037782196502120275425782622539039026", "poolBalance1": "1", "poolPriceBefore": "0.0000000000000000000000000000000000000059000", - "swapError": "VM Exception while processing transaction: revert SPL), vm error: message failed with backtrace:\\\\n00: f04555 (method 3844450837) -- contract reverted (33)\\\\n01: f04558 (method 3844450837) -- contract reverted (33)\\\\n (RetCode=33)\\", method=\\"estimateGas\\", transaction={\\"from\\":\\"0x651F8E3f40f3Fc568f72430632CD0A9d20b38657\\",\\"to\\":\\"0x2c55D818b52A3FE403EF3d9Df851Ae8efc8Df85F\\",\\"data\\":\\"0x2ec20bf9000000000000000000000000274743366b9053e867ed6301327c06717164677f0000000000000000000000000000000000000000a1e89b12424876d9b744b6790000000000000000000000000000000000000000000000000000000000000001\\",\\"accessList\\":null}, error={\\"name\\":\\"ProviderError\\",\\"_stack\\":\\"ProviderError: failed to estimate gas: message execution failed: exit 33, revert reason: Error(SPL", + "swapError": "VM Exception while processing transaction: revert SPL", "tickBefore": -880303, } `; @@ -379,7 +379,7 @@ Object { "poolBalance0": "26037782196502120275425782622539039026", "poolBalance1": "1", "poolPriceBefore": "0.0000000000000000000000000000000000000059000", - "swapError": "VM Exception while processing transaction: revert SPL), vm error: message failed with backtrace:\\\\n00: f04563 (method 3844450837) -- contract reverted (33)\\\\n01: f04566 (method 3844450837) -- contract reverted (33)\\\\n (RetCode=33)\\", method=\\"estimateGas\\", transaction={\\"from\\":\\"0x651F8E3f40f3Fc568f72430632CD0A9d20b38657\\",\\"to\\":\\"0xbc08dBEc74e4a68193E1DA9Bb7C5a9f10602E59a\\",\\"data\\":\\"0x2ec20bf90000000000000000000000003c7b5796e9689a18f74d2a2f837fd20b65fe6453000000000000000000000000000000000000000194c583ada5b529204a2bc8300000000000000000000000000000000000000000000000000000000000000001\\",\\"accessList\\":null}, error={\\"name\\":\\"ProviderError\\",\\"_stack\\":\\"ProviderError: failed to estimate gas: message execution failed: exit 33, revert reason: Error(SPL", + "swapError": "VM Exception while processing transaction: revert SPL", "tickBefore": -880303, } `; @@ -629,7 +629,7 @@ Object { "poolBalance0": "2000000000000000000", "poolBalance1": "2000000000000000000", "poolPriceBefore": "1.0000", - "swapError": "VM Exception while processing transaction: revert SPL), vm error: message failed with backtrace:\\\\n00: f03748 (method 3844450837) -- contract reverted (33)\\\\n01: f03751 (method 3844450837) -- contract reverted (33)\\\\n (RetCode=33)\\", method=\\"estimateGas\\", transaction={\\"from\\":\\"0x651F8E3f40f3Fc568f72430632CD0A9d20b38657\\",\\"to\\":\\"0x06fE159ca2339933D81871f145Bd1F616B5bCCF0\\",\\"data\\":\\"0x2ec20bf9000000000000000000000000827aa22b3003f6e2b073c8fd2f1e1b8d0c7f6590000000000000000000000000000000000000000194c583ada5b529204a2bc8300000000000000000000000000000000000000000000000000000000000000001\\",\\"accessList\\":null}, error={\\"name\\":\\"ProviderError\\",\\"_stack\\":\\"ProviderError: failed to estimate gas: message execution failed: exit 33, revert reason: Error(SPL", + "swapError": "VM Exception while processing transaction: revert SPL", "tickBefore": 0, } `; @@ -687,7 +687,7 @@ Object { "poolBalance0": "2000000000000000000", "poolBalance1": "2000000000000000000", "poolPriceBefore": "1.0000", - "swapError": "VM Exception while processing transaction: revert SPL), vm error: message failed with backtrace:\\\\n00: f03756 (method 3844450837) -- contract reverted (33)\\\\n01: f03759 (method 3844450837) -- contract reverted (33)\\\\n (RetCode=33)\\", method=\\"estimateGas\\", transaction={\\"from\\":\\"0x651F8E3f40f3Fc568f72430632CD0A9d20b38657\\",\\"to\\":\\"0xc5A3b8296E5000afeC33fA9894e1139bf7926127\\",\\"data\\":\\"0x9e77b8050000000000000000000000005e6503e05ef8f36dbbcea4a31771ff501f594e910000000000000000000000000000000000000000a1e89b12424876d9b744b6790000000000000000000000000000000000000000000000000000000000000001\\",\\"accessList\\":null}, error={\\"name\\":\\"ProviderError\\",\\"_stack\\":\\"ProviderError: failed to estimate gas: message execution failed: exit 33, revert reason: Error(SPL", + "swapError": "VM Exception while processing transaction: revert SPL", "tickBefore": 0, } `; @@ -729,7 +729,7 @@ Object { "poolBalance0": "0", "poolBalance1": "36796311329002736532545403775337522448", "poolPriceBefore": "3.4026e+38", - "swapError": "VM Exception while processing transaction: revert SPL), vm error: message failed with backtrace:\\\\n00: f04779 (method 3844450837) -- contract reverted (33)\\\\n01: f04782 (method 3844450837) -- contract reverted (33)\\\\n (RetCode=33)\\", method=\\"estimateGas\\", transaction={\\"from\\":\\"0x651F8E3f40f3Fc568f72430632CD0A9d20b38657\\",\\"to\\":\\"0x87d914aaCf6B6ed7D3a51b8663fee42134ba5d5b\\",\\"data\\":\\"0xe2be9109000000000000000000000000d922e3913ca04122bc34d318b6cfbc8dd35a59c000000000000000000000000000000000000000000000000000000000000003e80000000000000000000000000000000000000000000000000000000000000001000000000000000000000000fffd8963efd1fc6a506488495d951d5263988d25\\",\\"accessList\\":null}, error={\\"name\\":\\"ProviderError\\",\\"_stack\\":\\"ProviderError: failed to estimate gas: message execution failed: exit 33, revert reason: Error(SPL", + "swapError": "VM Exception while processing transaction: revert SPL", "tickBefore": 887271, } `; @@ -771,7 +771,7 @@ Object { "poolBalance0": "0", "poolBalance1": "36796311329002736532545403775337522448", "poolPriceBefore": "3.4026e+38", - "swapError": "VM Exception while processing transaction: revert SPL), vm error: message failed with backtrace:\\\\n00: f04715 (method 3844450837) -- contract reverted (33)\\\\n01: f04718 (method 3844450837) -- contract reverted (33)\\\\n (RetCode=33)\\", method=\\"estimateGas\\", transaction={\\"from\\":\\"0x651F8E3f40f3Fc568f72430632CD0A9d20b38657\\",\\"to\\":\\"0x95b2D117005065681De27fa2C87dDF4652a10754\\",\\"data\\":\\"0xe2be9109000000000000000000000000aeec27127e3626e55f7a215219cd262de0fed4510000000000000000000000000000000000000000000000000de0b6b3a76400000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000fffd8963efd1fc6a506488495d951d5263988d25\\",\\"accessList\\":null}, error={\\"name\\":\\"ProviderError\\",\\"_stack\\":\\"ProviderError: failed to estimate gas: message execution failed: exit 33, revert reason: Error(SPL", + "swapError": "VM Exception while processing transaction: revert SPL", "tickBefore": 887271, } `; @@ -781,7 +781,7 @@ Object { "poolBalance0": "0", "poolBalance1": "36796311329002736532545403775337522448", "poolPriceBefore": "3.4026e+38", - "swapError": "VM Exception while processing transaction: revert SPL), vm error: message failed with backtrace:\\\\n00: f04747 (method 3844450837) -- contract reverted (33)\\\\n01: f04750 (method 3844450837) -- contract reverted (33)\\\\n (RetCode=33)\\", method=\\"estimateGas\\", transaction={\\"from\\":\\"0x651F8E3f40f3Fc568f72430632CD0A9d20b38657\\",\\"to\\":\\"0x7E79A84385139Acc527e4a3A21a63Ec83aaCC174\\",\\"data\\":\\"0xe2be9109000000000000000000000000734427969f631cfc32fdbd44fa4699af8a7e407f0000000000000000000000000000000000000000000000000de0b6b3a7640000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000016a09e667f3bcc908b2fb1366\\",\\"accessList\\":null}, error={\\"name\\":\\"ProviderError\\",\\"_stack\\":\\"ProviderError: failed to estimate gas: message execution failed: exit 33, revert reason: Error(SPL", + "swapError": "VM Exception while processing transaction: revert SPL", "tickBefore": 887271, } `; @@ -871,7 +871,7 @@ Object { "poolBalance0": "0", "poolBalance1": "36796311329002736532545403775337522448", "poolPriceBefore": "3.4026e+38", - "swapError": "VM Exception while processing transaction: revert SPL), vm error: message failed with backtrace:\\\\n00: f04795 (method 3844450837) -- contract reverted (33)\\\\n01: f04798 (method 3844450837) -- contract reverted (33)\\\\n (RetCode=33)\\", method=\\"estimateGas\\", transaction={\\"from\\":\\"0x651F8E3f40f3Fc568f72430632CD0A9d20b38657\\",\\"to\\":\\"0xa1Ef20981bC3d1cFc02a6893EF478451DE4942F7\\",\\"data\\":\\"0xf603482c0000000000000000000000008e3f4cdac7734f1bf963426d1de7d93b0b62230d00000000000000000000000000000000000000000000000000000000000003e80000000000000000000000000000000000000000000000000000000000000001000000000000000000000000fffd8963efd1fc6a506488495d951d5263988d25\\",\\"accessList\\":null}, error={\\"name\\":\\"ProviderError\\",\\"_stack\\":\\"ProviderError: failed to estimate gas: message execution failed: exit 33, revert reason: Error(SPL", + "swapError": "VM Exception while processing transaction: revert SPL", "tickBefore": 887271, } `; @@ -881,7 +881,7 @@ Object { "poolBalance0": "0", "poolBalance1": "36796311329002736532545403775337522448", "poolPriceBefore": "3.4026e+38", - "swapError": "VM Exception while processing transaction: revert SPL), vm error: message failed with backtrace:\\\\n00: f04731 (method 3844450837) -- contract reverted (33)\\\\n01: f04734 (method 3844450837) -- contract reverted (33)\\\\n (RetCode=33)\\", method=\\"estimateGas\\", transaction={\\"from\\":\\"0x651F8E3f40f3Fc568f72430632CD0A9d20b38657\\",\\"to\\":\\"0x3e6919941E314e9b0E21BBC29C793Cb8530f2460\\",\\"data\\":\\"0xf603482c0000000000000000000000007baf9beb52525c9d4c47a2ffa95b497fc8c566650000000000000000000000000000000000000000000000000de0b6b3a76400000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000fffd8963efd1fc6a506488495d951d5263988d25\\",\\"accessList\\":null}, error={\\"name\\":\\"ProviderError\\",\\"_stack\\":\\"ProviderError: failed to estimate gas: message execution failed: exit 33, revert reason: Error(SPL", + "swapError": "VM Exception while processing transaction: revert SPL", "tickBefore": 887271, } `; @@ -891,7 +891,7 @@ Object { "poolBalance0": "0", "poolBalance1": "36796311329002736532545403775337522448", "poolPriceBefore": "3.4026e+38", - "swapError": "VM Exception while processing transaction: revert SPL), vm error: message failed with backtrace:\\\\n00: f04763 (method 3844450837) -- contract reverted (33)\\\\n01: f04766 (method 3844450837) -- contract reverted (33)\\\\n (RetCode=33)\\", method=\\"estimateGas\\", transaction={\\"from\\":\\"0x651F8E3f40f3Fc568f72430632CD0A9d20b38657\\",\\"to\\":\\"0x1d303A23D9C2fBbec95420A8ED272b775873ea08\\",\\"data\\":\\"0xf603482c0000000000000000000000008b197cb04483dac4a1bdf0f1bb228f79bfabf77e0000000000000000000000000000000000000000000000000de0b6b3a7640000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000016a09e667f3bcc908b2fb1366\\",\\"accessList\\":null}, error={\\"name\\":\\"ProviderError\\",\\"_stack\\":\\"ProviderError: failed to estimate gas: message execution failed: exit 33, revert reason: Error(SPL", + "swapError": "VM Exception while processing transaction: revert SPL", "tickBefore": 887271, } `; @@ -901,7 +901,7 @@ Object { "poolBalance0": "0", "poolBalance1": "36796311329002736532545403775337522448", "poolPriceBefore": "3.4026e+38", - "swapError": "VM Exception while processing transaction: revert SPL), vm error: message failed with backtrace:\\\\n00: f04827 (method 3844450837) -- contract reverted (33)\\\\n01: f04830 (method 3844450837) -- contract reverted (33)\\\\n (RetCode=33)\\", method=\\"estimateGas\\", transaction={\\"from\\":\\"0x651F8E3f40f3Fc568f72430632CD0A9d20b38657\\",\\"to\\":\\"0x33de97028dAd855042b14b3b000E713Da75f7fa5\\",\\"data\\":\\"0x9e77b80500000000000000000000000094e73f8b3befc782f29dc7d228719ce3e8259dd50000000000000000000000000000000000000000a1e89b12424876d9b744b6790000000000000000000000000000000000000000000000000000000000000001\\",\\"accessList\\":null}, error={\\"name\\":\\"ProviderError\\",\\"_stack\\":\\"ProviderError: failed to estimate gas: message execution failed: exit 33, revert reason: Error(SPL", + "swapError": "VM Exception while processing transaction: revert SPL", "tickBefore": 887271, } `; @@ -911,7 +911,7 @@ Object { "poolBalance0": "0", "poolBalance1": "36796311329002736532545403775337522448", "poolPriceBefore": "3.4026e+38", - "swapError": "VM Exception while processing transaction: revert SPL), vm error: message failed with backtrace:\\\\n00: f04803 (method 3844450837) -- contract reverted (33)\\\\n01: f04806 (method 3844450837) -- contract reverted (33)\\\\n (RetCode=33)\\", method=\\"estimateGas\\", transaction={\\"from\\":\\"0x651F8E3f40f3Fc568f72430632CD0A9d20b38657\\",\\"to\\":\\"0xC9bb6ad48E8dA653584B51E71192323c16B6373f\\",\\"data\\":\\"0x9e77b8050000000000000000000000003c5eec1d61ecf1c50747f105c6b91bd34bde87bf000000000000000000000000000000000000000194c583ada5b529204a2bc8300000000000000000000000000000000000000000000000000000000000000001\\",\\"accessList\\":null}, error={\\"name\\":\\"ProviderError\\",\\"_stack\\":\\"ProviderError: failed to estimate gas: message execution failed: exit 33, revert reason: Error(SPL", + "swapError": "VM Exception while processing transaction: revert SPL", "tickBefore": 887271, } `; @@ -921,7 +921,7 @@ Object { "poolBalance0": "36796311322104302062438284732106019258", "poolBalance1": "0", "poolPriceBefore": "0.0000000000000000000000000000000000000029390", - "swapError": "VM Exception while processing transaction: revert SPL), vm error: message failed with backtrace:\\\\n00: f04899 (method 3844450837) -- contract reverted (33)\\\\n01: f04902 (method 3844450837) -- contract reverted (33)\\\\n (RetCode=33)\\", method=\\"estimateGas\\", transaction={\\"from\\":\\"0x651F8E3f40f3Fc568f72430632CD0A9d20b38657\\",\\"to\\":\\"0x429a8Fe8a6Bb76baBCFd4e62003A3E9200c61b63\\",\\"data\\":\\"0x6dfc0ddb000000000000000000000000546d7cf909a4fd600363bacb08afe3277080d2ab00000000000000000000000000000000000000000000000000000000000003e8000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000001000276a4\\",\\"accessList\\":null}, error={\\"name\\":\\"ProviderError\\",\\"_stack\\":\\"ProviderError: failed to estimate gas: message execution failed: exit 33, revert reason: Error(SPL", + "swapError": "VM Exception while processing transaction: revert SPL", "tickBefore": -887272, } `; @@ -947,7 +947,7 @@ Object { "poolBalance0": "36796311322104302062438284732106019258", "poolBalance1": "0", "poolPriceBefore": "0.0000000000000000000000000000000000000029390", - "swapError": "VM Exception while processing transaction: revert SPL), vm error: message failed with backtrace:\\\\n00: f04835 (method 3844450837) -- contract reverted (33)\\\\n01: f04838 (method 3844450837) -- contract reverted (33)\\\\n (RetCode=33)\\", method=\\"estimateGas\\", transaction={\\"from\\":\\"0x651F8E3f40f3Fc568f72430632CD0A9d20b38657\\",\\"to\\":\\"0xCfCBe96f2944df8A881785e604a74d60e0b5362C\\",\\"data\\":\\"0x6dfc0ddb000000000000000000000000acecaf10c78ea713d5932ca6e9a81b3c9d2a8ae80000000000000000000000000000000000000000000000000de0b6b3a7640000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000001000276a4\\",\\"accessList\\":null}, error={\\"name\\":\\"ProviderError\\",\\"_stack\\":\\"ProviderError: failed to estimate gas: message execution failed: exit 33, revert reason: Error(SPL", + "swapError": "VM Exception while processing transaction: revert SPL", "tickBefore": -887272, } `; @@ -957,7 +957,7 @@ Object { "poolBalance0": "36796311322104302062438284732106019258", "poolBalance1": "0", "poolPriceBefore": "0.0000000000000000000000000000000000000029390", - "swapError": "VM Exception while processing transaction: revert SPL), vm error: message failed with backtrace:\\\\n00: f04867 (method 3844450837) -- contract reverted (33)\\\\n01: f04870 (method 3844450837) -- contract reverted (33)\\\\n (RetCode=33)\\", method=\\"estimateGas\\", transaction={\\"from\\":\\"0x651F8E3f40f3Fc568f72430632CD0A9d20b38657\\",\\"to\\":\\"0xf69229dB6AF9B651da75B25AE86Eb327b95C996F\\",\\"data\\":\\"0x6dfc0ddb0000000000000000000000006c2bb651256881f5df5993b9ce550a002b95ac210000000000000000000000000000000000000000000000000de0b6b3a764000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000b504f333f9de6484597d89b3\\",\\"accessList\\":null}, error={\\"name\\":\\"ProviderError\\",\\"_stack\\":\\"ProviderError: failed to estimate gas: message execution failed: exit 33, revert reason: Error(SPL", + "swapError": "VM Exception while processing transaction: revert SPL", "tickBefore": -887272, } `; @@ -999,7 +999,7 @@ Object { "poolBalance0": "36796311322104302062438284732106019258", "poolBalance1": "0", "poolPriceBefore": "0.0000000000000000000000000000000000000029390", - "swapError": "VM Exception while processing transaction: revert SPL), vm error: message failed with backtrace:\\\\n00: f04915 (method 3844450837) -- contract reverted (33)\\\\n01: f04918 (method 3844450837) -- contract reverted (33)\\\\n (RetCode=33)\\", method=\\"estimateGas\\", transaction={\\"from\\":\\"0x651F8E3f40f3Fc568f72430632CD0A9d20b38657\\",\\"to\\":\\"0x4dAb42e39de3863f8eFEF899ae5a470f7eA7A19e\\",\\"data\\":\\"0xbac7bf780000000000000000000000005ecb9ba70449717e80a540f06364fb46302e3aa900000000000000000000000000000000000000000000000000000000000003e8000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000001000276a4\\",\\"accessList\\":null}, error={\\"name\\":\\"ProviderError\\",\\"_stack\\":\\"ProviderError: failed to estimate gas: message execution failed: exit 33, revert reason: Error(SPL", + "swapError": "VM Exception while processing transaction: revert SPL", "tickBefore": -887272, } `; @@ -1009,7 +1009,7 @@ Object { "poolBalance0": "36796311322104302062438284732106019258", "poolBalance1": "0", "poolPriceBefore": "0.0000000000000000000000000000000000000029390", - "swapError": "VM Exception while processing transaction: revert SPL), vm error: message failed with backtrace:\\\\n00: f04851 (method 3844450837) -- contract reverted (33)\\\\n01: f04854 (method 3844450837) -- contract reverted (33)\\\\n (RetCode=33)\\", method=\\"estimateGas\\", transaction={\\"from\\":\\"0x651F8E3f40f3Fc568f72430632CD0A9d20b38657\\",\\"to\\":\\"0x95f46d877700527f16390E2E556b96E14a77c8a3\\",\\"data\\":\\"0xbac7bf78000000000000000000000000edc9e026f535b45d4bc1581da55412b8f7d9d8dc0000000000000000000000000000000000000000000000000de0b6b3a7640000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000001000276a4\\",\\"accessList\\":null}, error={\\"name\\":\\"ProviderError\\",\\"_stack\\":\\"ProviderError: failed to estimate gas: message execution failed: exit 33, revert reason: Error(SPL", + "swapError": "VM Exception while processing transaction: revert SPL", "tickBefore": -887272, } `; @@ -1019,7 +1019,7 @@ Object { "poolBalance0": "36796311322104302062438284732106019258", "poolBalance1": "0", "poolPriceBefore": "0.0000000000000000000000000000000000000029390", - "swapError": "VM Exception while processing transaction: revert SPL), vm error: message failed with backtrace:\\\\n00: f04883 (method 3844450837) -- contract reverted (33)\\\\n01: f04886 (method 3844450837) -- contract reverted (33)\\\\n (RetCode=33)\\", method=\\"estimateGas\\", transaction={\\"from\\":\\"0x651F8E3f40f3Fc568f72430632CD0A9d20b38657\\",\\"to\\":\\"0x5b6Ea75A99D92cB8936a85D14eE5b120477416b6\\",\\"data\\":\\"0xbac7bf78000000000000000000000000a960dd0cd9515d9e486140dc66cce09f725028e70000000000000000000000000000000000000000000000000de0b6b3a764000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000b504f333f9de6484597d89b3\\",\\"accessList\\":null}, error={\\"name\\":\\"ProviderError\\",\\"_stack\\":\\"ProviderError: failed to estimate gas: message execution failed: exit 33, revert reason: Error(SPL", + "swapError": "VM Exception while processing transaction: revert SPL", "tickBefore": -887272, } `; @@ -1029,7 +1029,7 @@ Object { "poolBalance0": "36796311322104302062438284732106019258", "poolBalance1": "0", "poolPriceBefore": "0.0000000000000000000000000000000000000029390", - "swapError": "VM Exception while processing transaction: revert SPL), vm error: message failed with backtrace:\\\\n00: f04939 (method 3844450837) -- contract reverted (33)\\\\n01: f04942 (method 3844450837) -- contract reverted (33)\\\\n (RetCode=33)\\", method=\\"estimateGas\\", transaction={\\"from\\":\\"0x651F8E3f40f3Fc568f72430632CD0A9d20b38657\\",\\"to\\":\\"0xB61d7f92Aa53a39488EE5c91541f07120C310766\\",\\"data\\":\\"0x2ec20bf90000000000000000000000001e8cb4b8aa56ba9d2c4eb554cab0c2d4e83ceced0000000000000000000000000000000000000000a1e89b12424876d9b744b6790000000000000000000000000000000000000000000000000000000000000001\\",\\"accessList\\":null}, error={\\"name\\":\\"ProviderError\\",\\"_stack\\":\\"ProviderError: failed to estimate gas: message execution failed: exit 33, revert reason: Error(SPL", + "swapError": "VM Exception while processing transaction: revert SPL", "tickBefore": -887272, } `; @@ -1039,7 +1039,7 @@ Object { "poolBalance0": "36796311322104302062438284732106019258", "poolBalance1": "0", "poolPriceBefore": "0.0000000000000000000000000000000000000029390", - "swapError": "VM Exception while processing transaction: revert SPL), vm error: message failed with backtrace:\\\\n00: f04947 (method 3844450837) -- contract reverted (33)\\\\n01: f04950 (method 3844450837) -- contract reverted (33)\\\\n (RetCode=33)\\", method=\\"estimateGas\\", transaction={\\"from\\":\\"0x651F8E3f40f3Fc568f72430632CD0A9d20b38657\\",\\"to\\":\\"0xa8888ABc9daefa08c2c179a336E30Ebc2aD92E4b\\",\\"data\\":\\"0x2ec20bf90000000000000000000000008ca12ffc3961e69f311c9b77db3ef664ec1818ab000000000000000000000000000000000000000194c583ada5b529204a2bc8300000000000000000000000000000000000000000000000000000000000000001\\",\\"accessList\\":null}, error={\\"name\\":\\"ProviderError\\",\\"_stack\\":\\"ProviderError: failed to estimate gas: message execution failed: exit 33, revert reason: Error(SPL", + "swapError": "VM Exception while processing transaction: revert SPL", "tickBefore": -887272, } `; @@ -1289,7 +1289,7 @@ Object { "poolBalance0": "2000000000000000000", "poolBalance1": "2000000000000000000", "poolPriceBefore": "1.0000", - "swapError": "VM Exception while processing transaction: revert SPL), vm error: message failed with backtrace:\\\\n00: f03492 (method 3844450837) -- contract reverted (33)\\\\n01: f03495 (method 3844450837) -- contract reverted (33)\\\\n (RetCode=33)\\", method=\\"estimateGas\\", transaction={\\"from\\":\\"0x651F8E3f40f3Fc568f72430632CD0A9d20b38657\\",\\"to\\":\\"0xFa180a6491085Aad3eA5baDcdA480766951d0280\\",\\"data\\":\\"0x2ec20bf900000000000000000000000027078b9ec8a61bba7a581e515ef8edd8be6016e8000000000000000000000000000000000000000194c583ada5b529204a2bc8300000000000000000000000000000000000000000000000000000000000000001\\",\\"accessList\\":null}, error={\\"name\\":\\"ProviderError\\",\\"_stack\\":\\"ProviderError: failed to estimate gas: message execution failed: exit 33, revert reason: Error(SPL", + "swapError": "VM Exception while processing transaction: revert SPL", "tickBefore": 0, } `; @@ -1347,7 +1347,7 @@ Object { "poolBalance0": "2000000000000000000", "poolBalance1": "2000000000000000000", "poolPriceBefore": "1.0000", - "swapError": "VM Exception while processing transaction: revert SPL), vm error: message failed with backtrace:\\\\n00: f03500 (method 3844450837) -- contract reverted (33)\\\\n01: f03503 (method 3844450837) -- contract reverted (33)\\\\n (RetCode=33)\\", method=\\"estimateGas\\", transaction={\\"from\\":\\"0x651F8E3f40f3Fc568f72430632CD0A9d20b38657\\",\\"to\\":\\"0x1387b016CB529753425Eb8bfcC854aaE72E34F16\\",\\"data\\":\\"0x9e77b805000000000000000000000000026b0c9ce1a377e928c5dd3429faccedabf8f9f40000000000000000000000000000000000000000a1e89b12424876d9b744b6790000000000000000000000000000000000000000000000000000000000000001\\",\\"accessList\\":null}, error={\\"name\\":\\"ProviderError\\",\\"_stack\\":\\"ProviderError: failed to estimate gas: message execution failed: exit 33, revert reason: Error(SPL", + "swapError": "VM Exception while processing transaction: revert SPL", "tickBefore": 0, } `; @@ -1368,6 +1368,38 @@ Object { } `; +exports[`UniswapV3Pool swap tests low fee, large liquidity around current price (stable swap) swap exactly 0.0000000000000010000 token0 for token1 1`] = ` +Object { + "amount0Before": "999700069986003", + "amount0Delta": "1000", + "amount1Before": "999700069986003", + "amount1Delta": "-998", + "executionPrice": "0.99800", + "feeGrowthGlobal0X128Delta": "170141183460469231731", + "feeGrowthGlobal1X128Delta": "0", + "poolPriceAfter": "1.0000", + "poolPriceBefore": "1.0000", + "tickAfter": -1, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests low fee, large liquidity around current price (stable swap) swap exactly 0.0000000000000010000 token1 for token0 1`] = ` +Object { + "amount0Before": "999700069986003", + "amount0Delta": "-998", + "amount1Before": "999700069986003", + "amount1Delta": "1000", + "executionPrice": "1.0020", + "feeGrowthGlobal0X128Delta": "0", + "feeGrowthGlobal1X128Delta": "170141183460469231731", + "poolPriceAfter": "1.0000", + "poolPriceBefore": "1.0000", + "tickAfter": 0, + "tickBefore": 0, +} +`; + exports[`UniswapV3Pool swap tests low fee, large liquidity around current price (stable swap) swap exactly 1.0000 token0 for token1 1`] = ` Object { "amount0Before": "999700069986003", @@ -1416,6 +1448,38 @@ Object { } `; +exports[`UniswapV3Pool swap tests low fee, large liquidity around current price (stable swap) swap exactly 1.0000 token1 for token0 to price 2.0000 1`] = ` +Object { + "amount0Before": "999700069986003", + "amount0Delta": "-999700069986002", + "amount1Before": "999700069986003", + "amount1Delta": "1000700370186095", + "executionPrice": "1.0010", + "feeGrowthGlobal0X128Delta": "0", + "feeGrowthGlobal1X128Delta": "85130172636557991529041720559172", + "poolPriceAfter": "2.0000", + "poolPriceBefore": "1.0000", + "tickAfter": 6931, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests low fee, large liquidity around current price (stable swap) swap token0 for exactly 0.0000000000000010000 token1 1`] = ` +Object { + "amount0Before": "999700069986003", + "amount0Delta": "1002", + "amount1Before": "999700069986003", + "amount1Delta": "-1000", + "executionPrice": "0.99800", + "feeGrowthGlobal0X128Delta": "170141183460469231731", + "feeGrowthGlobal1X128Delta": "0", + "poolPriceAfter": "1.0000", + "poolPriceBefore": "1.0000", + "tickAfter": -1, + "tickBefore": 0, +} +`; + exports[`UniswapV3Pool swap tests low fee, large liquidity around current price (stable swap) swap token0 for exactly 1.0000 token1 1`] = ` Object { "amount0Before": "999700069986003", @@ -1432,6 +1496,64 @@ Object { } `; +exports[`UniswapV3Pool swap tests low fee, large liquidity around current price (stable swap) swap token0 for exactly 1.0000 token1 to price 0.50000 1`] = ` +Object { + "amount0Before": "999700069986003", + "amount0Delta": "1000700370186095", + "amount1Before": "999700069986003", + "amount1Delta": "-999700069986002", + "executionPrice": "0.99900", + "feeGrowthGlobal0X128Delta": "85130172636557991529041720559172", + "feeGrowthGlobal1X128Delta": "0", + "poolPriceAfter": "0.50000", + "poolPriceBefore": "1.0000", + "tickAfter": -6932, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests low fee, large liquidity around current price (stable swap) swap token0 for token1 to price 0.40000 1`] = ` +Object { + "amount0Before": "999700069986003", + "amount0Delta": "1000700370186095", + "amount1Before": "999700069986003", + "amount1Delta": "-999700069986002", + "executionPrice": "0.99900", + "feeGrowthGlobal0X128Delta": "85130172636557991529041720559172", + "feeGrowthGlobal1X128Delta": "0", + "poolPriceAfter": "0.40000", + "poolPriceBefore": "1.0000", + "tickAfter": -9164, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests low fee, large liquidity around current price (stable swap) swap token0 for token1 to price 2.5000 1`] = ` +Object { + "poolBalance0": "999700069986003", + "poolBalance1": "999700069986003", + "poolPriceBefore": "1.0000", + "swapError": "VM Exception while processing transaction: revert SPL", + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests low fee, large liquidity around current price (stable swap) swap token1 for exactly 0.0000000000000010000 token0 1`] = ` +Object { + "amount0Before": "999700069986003", + "amount0Delta": "-1000", + "amount1Before": "999700069986003", + "amount1Delta": "1002", + "executionPrice": "1.0020", + "feeGrowthGlobal0X128Delta": "0", + "feeGrowthGlobal1X128Delta": "170141183460469231731", + "poolPriceAfter": "1.0000", + "poolPriceBefore": "1.0000", + "tickAfter": 0, + "tickBefore": 0, +} +`; + exports[`UniswapV3Pool swap tests low fee, large liquidity around current price (stable swap) swap token1 for exactly 1.0000 token0 1`] = ` Object { "amount0Before": "999700069986003", @@ -1448,6 +1570,48 @@ Object { } `; +exports[`UniswapV3Pool swap tests low fee, large liquidity around current price (stable swap) swap token1 for exactly 1.0000 token0 to price 2.0000 1`] = ` +Object { + "amount0Before": "999700069986003", + "amount0Delta": "-999700069986002", + "amount1Before": "999700069986003", + "amount1Delta": "1000700370186095", + "executionPrice": "1.0010", + "feeGrowthGlobal0X128Delta": "0", + "feeGrowthGlobal1X128Delta": "85130172636557991529041720559172", + "poolPriceAfter": "2.0000", + "poolPriceBefore": "1.0000", + "tickAfter": 6931, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests low fee, large liquidity around current price (stable swap) swap token1 for token0 to price 0.40000 1`] = ` +Object { + "poolBalance0": "999700069986003", + "poolBalance1": "999700069986003", + "poolPriceBefore": "1.0000", + "swapError": "VM Exception while processing transaction: revert SPL", + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests low fee, large liquidity around current price (stable swap) swap token1 for token0 to price 2.5000 1`] = ` +Object { + "amount0Before": "999700069986003", + "amount0Delta": "-999700069986002", + "amount1Before": "999700069986003", + "amount1Delta": "1000700370186095", + "executionPrice": "1.0010", + "feeGrowthGlobal0X128Delta": "0", + "feeGrowthGlobal1X128Delta": "85130172636557991529041720559172", + "poolPriceAfter": "2.5000", + "poolPriceBefore": "1.0000", + "tickAfter": 9163, + "tickBefore": 0, +} +`; + exports[`UniswapV3Pool swap tests max full range liquidity at 1:1 price with default fee swap exactly 0.0000000000000010000 token0 for token1 1`] = ` Object { "amount0Before": "11505743598341114571255423385623647", @@ -1613,7 +1777,7 @@ Object { "poolBalance0": "11505743598341114571255423385623647", "poolBalance1": "11505743598341114571255423385506404", "poolPriceBefore": "1.0000", - "swapError": "VM Exception while processing transaction: revert SPL), vm error: message failed with backtrace:\\\\n00: f04691 (method 3844450837) -- contract reverted (33)\\\\n01: f04694 (method 3844450837) -- contract reverted (33)\\\\n (RetCode=33)\\", method=\\"estimateGas\\", transaction={\\"from\\":\\"0x651F8E3f40f3Fc568f72430632CD0A9d20b38657\\",\\"to\\":\\"0x707e7258aB472840B75A79736f4524e95CcC13AA\\",\\"data\\":\\"0x2ec20bf90000000000000000000000007a7277db78acb203aa9747b540650cca2b3edd2d000000000000000000000000000000000000000194c583ada5b529204a2bc8300000000000000000000000000000000000000000000000000000000000000001\\",\\"accessList\\":null}, error={\\"name\\":\\"ProviderError\\",\\"_stack\\":\\"ProviderError: failed to estimate gas: message execution failed: exit 33, revert reason: Error(SPL", + "swapError": "VM Exception while processing transaction: revert SPL", "tickBefore": 0, } `; @@ -1671,7 +1835,7 @@ Object { "poolBalance0": "11505743598341114571255423385623647", "poolBalance1": "11505743598341114571255423385506404", "poolPriceBefore": "1.0000", - "swapError": "VM Exception while processing transaction: revert SPL), vm error: message failed with backtrace:\\\\n00: f04699 (method 3844450837) -- contract reverted (33)\\\\n01: f04702 (method 3844450837) -- contract reverted (33)\\\\n (RetCode=33)\\", method=\\"estimateGas\\", transaction={\\"from\\":\\"0x651F8E3f40f3Fc568f72430632CD0A9d20b38657\\",\\"to\\":\\"0xC71aBeFD4e5631f05886d3363449F446f9dEf0a8\\",\\"data\\":\\"0x9e77b8050000000000000000000000004b001259591409d06ec9ffcc9cba0027784825f20000000000000000000000000000000000000000a1e89b12424876d9b744b6790000000000000000000000000000000000000000000000000000000000000001\\",\\"accessList\\":null}, error={\\"name\\":\\"ProviderError\\",\\"_stack\\":\\"ProviderError: failed to estimate gas: message execution failed: exit 33, revert reason: Error(SPL", + "swapError": "VM Exception while processing transaction: revert SPL", "tickBefore": 0, } `; @@ -1857,7 +2021,7 @@ Object { "poolBalance0": "1994009290088178439", "poolBalance1": "1994009290088178439", "poolPriceBefore": "1.0000", - "swapError": "VM Exception while processing transaction: revert SPL), vm error: message failed with backtrace:\\\\n00: f04132 (method 3844450837) -- contract reverted (33)\\\\n01: f04135 (method 3844450837) -- contract reverted (33)\\\\n (RetCode=33)\\", method=\\"estimateGas\\", transaction={\\"from\\":\\"0x651F8E3f40f3Fc568f72430632CD0A9d20b38657\\",\\"to\\":\\"0x089fe50014836f1155a638FE9a99A4bBFedf8046\\",\\"data\\":\\"0x2ec20bf900000000000000000000000009617076d064370161b2fac3ea9afe02ab72a00b000000000000000000000000000000000000000194c583ada5b529204a2bc8300000000000000000000000000000000000000000000000000000000000000001\\",\\"accessList\\":null}, error={\\"name\\":\\"ProviderError\\",\\"_stack\\":\\"ProviderError: failed to estimate gas: message execution failed: exit 33, revert reason: Error(SPL", + "swapError": "VM Exception while processing transaction: revert SPL", "tickBefore": 0, } `; @@ -1910,6 +2074,16 @@ Object { } `; +exports[`UniswapV3Pool swap tests medium fee, 1:1 price, 0 liquidity, all liquidity around current price swap token1 for token0 to price 0.40000 1`] = ` +Object { + "poolBalance0": "1994009290088178439", + "poolBalance1": "1994009290088178439", + "poolPriceBefore": "1.0000", + "swapError": "VM Exception while processing transaction: revert SPL", + "tickBefore": 0, +} +`; + exports[`UniswapV3Pool swap tests medium fee, 1:1 price, 0 liquidity, all liquidity around current price swap token1 for token0 to price 2.5000 1`] = ` Object { "amount0Before": "1994009290088178439", @@ -2091,7 +2265,7 @@ Object { "poolBalance0": "2000000000000000000", "poolBalance1": "2000000000000000000", "poolPriceBefore": "1.0000", - "swapError": "VM Exception while processing transaction: revert SPL), vm error: message failed with backtrace:\\\\n00: f03620 (method 3844450837) -- contract reverted (33)\\\\n01: f03623 (method 3844450837) -- contract reverted (33)\\\\n (RetCode=33)\\", method=\\"estimateGas\\", transaction={\\"from\\":\\"0x651F8E3f40f3Fc568f72430632CD0A9d20b38657\\",\\"to\\":\\"0x16948410bd2Dbb4b0b11eb42960C596B845c1E5a\\",\\"data\\":\\"0x2ec20bf90000000000000000000000000f6db57cdcda8802a23e43065428ca869181c116000000000000000000000000000000000000000194c583ada5b529204a2bc8300000000000000000000000000000000000000000000000000000000000000001\\",\\"accessList\\":null}, error={\\"name\\":\\"ProviderError\\",\\"_stack\\":\\"ProviderError: failed to estimate gas: message execution failed: exit 33, revert reason: Error(SPL", + "swapError": "VM Exception while processing transaction: revert SPL", "tickBefore": 0, } `; @@ -2149,7 +2323,7 @@ Object { "poolBalance0": "2000000000000000000", "poolBalance1": "2000000000000000000", "poolPriceBefore": "1.0000", - "swapError": "VM Exception while processing transaction: revert SPL), vm error: message failed with backtrace:\\\\n00: f03628 (method 3844450837) -- contract reverted (33)\\\\n01: f03631 (method 3844450837) -- contract reverted (33)\\\\n (RetCode=33)\\", method=\\"estimateGas\\", transaction={\\"from\\":\\"0x651F8E3f40f3Fc568f72430632CD0A9d20b38657\\",\\"to\\":\\"0x91DC812AeC85Bc75C7470C0408bB0bf24E4A089E\\",\\"data\\":\\"0x9e77b805000000000000000000000000f28c221c275195fca38415164b6e33f6253b51e80000000000000000000000000000000000000000a1e89b12424876d9b744b6790000000000000000000000000000000000000000000000000000000000000001\\",\\"accessList\\":null}, error={\\"name\\":\\"ProviderError\\",\\"_stack\\":\\"ProviderError: failed to estimate gas: message execution failed: exit 33, revert reason: Error(SPL", + "swapError": "VM Exception while processing transaction: revert SPL", "tickBefore": 0, } `; @@ -2170,6 +2344,250 @@ Object { } `; +exports[`UniswapV3Pool swap tests medium fee, 1:1 price, additional liquidity around current price swap exactly 0.0000000000000010000 token0 for token1 1`] = ` +Object { + "amount0Before": "3994009290088178439", + "amount0Delta": "1000", + "amount1Before": "3994009290088178439", + "amount1Delta": "-996", + "executionPrice": "0.99600", + "feeGrowthGlobal0X128Delta": "510423550381407695195", + "feeGrowthGlobal1X128Delta": "0", + "poolPriceAfter": "1.0000", + "poolPriceBefore": "1.0000", + "tickAfter": -1, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, 1:1 price, additional liquidity around current price swap exactly 0.0000000000000010000 token1 for token0 1`] = ` +Object { + "amount0Before": "3994009290088178439", + "amount0Delta": "-996", + "amount1Before": "3994009290088178439", + "amount1Delta": "1000", + "executionPrice": "1.0040", + "feeGrowthGlobal0X128Delta": "0", + "feeGrowthGlobal1X128Delta": "510423550381407695195", + "poolPriceAfter": "1.0000", + "poolPriceBefore": "1.0000", + "tickAfter": 0, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, 1:1 price, additional liquidity around current price swap exactly 1.0000 token0 for token1 1`] = ` +Object { + "amount0Before": "3994009290088178439", + "amount0Delta": "1000000000000000000", + "amount1Before": "3994009290088178439", + "amount1Delta": "-795933705287758544", + "executionPrice": "0.79593", + "feeGrowthGlobal0X128Delta": "256749882580179971840679703106063897", + "feeGrowthGlobal1X128Delta": "0", + "poolPriceAfter": "0.63923", + "poolPriceBefore": "1.0000", + "tickAfter": -4476, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, 1:1 price, additional liquidity around current price swap exactly 1.0000 token0 for token1 to price 0.50000 1`] = ` +Object { + "amount0Before": "3994009290088178439", + "amount0Delta": "1000000000000000000", + "amount1Before": "3994009290088178439", + "amount1Delta": "-795933705287758544", + "executionPrice": "0.79593", + "feeGrowthGlobal0X128Delta": "256749882580179971840679703106063897", + "feeGrowthGlobal1X128Delta": "0", + "poolPriceAfter": "0.63923", + "poolPriceBefore": "1.0000", + "tickAfter": -4476, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, 1:1 price, additional liquidity around current price swap exactly 1.0000 token1 for token0 1`] = ` +Object { + "amount0Before": "3994009290088178439", + "amount0Delta": "-795933705287758544", + "amount1Before": "3994009290088178439", + "amount1Delta": "1000000000000000000", + "executionPrice": "1.2564", + "feeGrowthGlobal0X128Delta": "0", + "feeGrowthGlobal1X128Delta": "256749882580179971840679703106063897", + "poolPriceAfter": "1.5644", + "poolPriceBefore": "1.0000", + "tickAfter": 4475, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, 1:1 price, additional liquidity around current price swap exactly 1.0000 token1 for token0 to price 2.0000 1`] = ` +Object { + "amount0Before": "3994009290088178439", + "amount0Delta": "-795933705287758544", + "amount1Before": "3994009290088178439", + "amount1Delta": "1000000000000000000", + "executionPrice": "1.2564", + "feeGrowthGlobal0X128Delta": "0", + "feeGrowthGlobal1X128Delta": "256749882580179971840679703106063897", + "poolPriceAfter": "1.5644", + "poolPriceBefore": "1.0000", + "tickAfter": 4475, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, 1:1 price, additional liquidity around current price swap token0 for exactly 0.0000000000000010000 token1 1`] = ` +Object { + "amount0Before": "3994009290088178439", + "amount0Delta": "1005", + "amount1Before": "3994009290088178439", + "amount1Delta": "-1000", + "executionPrice": "0.99502", + "feeGrowthGlobal0X128Delta": "680564733841876926926", + "feeGrowthGlobal1X128Delta": "0", + "poolPriceAfter": "1.0000", + "poolPriceBefore": "1.0000", + "tickAfter": -1, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, 1:1 price, additional liquidity around current price swap token0 for exactly 1.0000 token1 1`] = ` +Object { + "amount0Before": "3994009290088178439", + "amount0Delta": "1342022152495072924", + "amount1Before": "3994009290088178439", + "amount1Delta": "-1000000000000000000", + "executionPrice": "0.74514", + "feeGrowthGlobal0X128Delta": "344037963272993171369654596359692757", + "feeGrowthGlobal1X128Delta": "0", + "poolPriceAfter": "0.56026", + "poolPriceBefore": "1.0000", + "tickAfter": -5794, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, 1:1 price, additional liquidity around current price swap token0 for exactly 1.0000 token1 to price 0.50000 1`] = ` +Object { + "amount0Before": "3994009290088178439", + "amount0Delta": "1342022152495072924", + "amount1Before": "3994009290088178439", + "amount1Delta": "-1000000000000000000", + "executionPrice": "0.74514", + "feeGrowthGlobal0X128Delta": "344037963272993171369654596359692757", + "feeGrowthGlobal1X128Delta": "0", + "poolPriceAfter": "0.56026", + "poolPriceBefore": "1.0000", + "tickAfter": -5794, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, 1:1 price, additional liquidity around current price swap token0 for token1 to price 0.40000 1`] = ` +Object { + "amount0Before": "3994009290088178439", + "amount0Delta": "2325523181756544449", + "amount1Before": "3994009290088178439", + "amount1Delta": "-1464187161953474971", + "executionPrice": "0.62962", + "feeGrowthGlobal0X128Delta": "595039006852697724928157455230309818", + "feeGrowthGlobal1X128Delta": "0", + "poolPriceAfter": "0.40000", + "poolPriceBefore": "1.0000", + "tickAfter": -9164, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, 1:1 price, additional liquidity around current price swap token0 for token1 to price 2.5000 1`] = ` +Object { + "poolBalance0": "3994009290088178439", + "poolBalance1": "3994009290088178439", + "poolPriceBefore": "1.0000", + "swapError": "VM Exception while processing transaction: revert SPL", + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, 1:1 price, additional liquidity around current price swap token1 for exactly 0.0000000000000010000 token0 1`] = ` +Object { + "amount0Before": "3994009290088178439", + "amount0Delta": "-1000", + "amount1Before": "3994009290088178439", + "amount1Delta": "1005", + "executionPrice": "1.0050", + "feeGrowthGlobal0X128Delta": "0", + "feeGrowthGlobal1X128Delta": "680564733841876926926", + "poolPriceAfter": "1.0000", + "poolPriceBefore": "1.0000", + "tickAfter": 0, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, 1:1 price, additional liquidity around current price swap token1 for exactly 1.0000 token0 1`] = ` +Object { + "amount0Before": "3994009290088178439", + "amount0Delta": "-1000000000000000000", + "amount1Before": "3994009290088178439", + "amount1Delta": "1342022152495072924", + "executionPrice": "1.3420", + "feeGrowthGlobal0X128Delta": "0", + "feeGrowthGlobal1X128Delta": "344037963272993171369654596359692757", + "poolPriceAfter": "1.7849", + "poolPriceBefore": "1.0000", + "tickAfter": 5793, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, 1:1 price, additional liquidity around current price swap token1 for exactly 1.0000 token0 to price 2.0000 1`] = ` +Object { + "amount0Before": "3994009290088178439", + "amount0Delta": "-1000000000000000000", + "amount1Before": "3994009290088178439", + "amount1Delta": "1342022152495072924", + "executionPrice": "1.3420", + "feeGrowthGlobal0X128Delta": "0", + "feeGrowthGlobal1X128Delta": "344037963272993171369654596359692757", + "poolPriceAfter": "1.7849", + "poolPriceBefore": "1.0000", + "tickAfter": 5793, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, 1:1 price, additional liquidity around current price swap token1 for token0 to price 0.40000 1`] = ` +Object { + "poolBalance0": "3994009290088178439", + "poolBalance1": "3994009290088178439", + "poolPriceBefore": "1.0000", + "swapError": "VM Exception while processing transaction: revert SPL", + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, 1:1 price, additional liquidity around current price swap token1 for token0 to price 2.5000 1`] = ` +Object { + "amount0Before": "3994009290088178439", + "amount0Delta": "-1464187161953474971", + "amount1Before": "3994009290088178439", + "amount1Delta": "2325523181756544449", + "executionPrice": "1.5883", + "feeGrowthGlobal0X128Delta": "0", + "feeGrowthGlobal1X128Delta": "595039006852697724928157455230309818", + "poolPriceAfter": "2.5000", + "poolPriceBefore": "1.0000", + "tickAfter": 9163, + "tickBefore": 0, +} +`; + exports[`UniswapV3Pool swap tests medium fee, 1:10 price, 2e18 max range liquidity swap exactly 0.0000000000000010000 token0 for token1 1`] = ` Object { "amount0Before": "6324555320336758664", @@ -2223,7 +2641,7 @@ Object { "poolBalance0": "6324555320336758664", "poolBalance1": "632455532033675867", "poolPriceBefore": "0.10000", - "swapError": "VM Exception while processing transaction: revert SPL), vm error: message failed with backtrace:\\\\n00: f03924 (method 3844450837) -- contract reverted (33)\\\\n01: f03927 (method 3844450837) -- contract reverted (33)\\\\n (RetCode=33)\\", method=\\"estimateGas\\", transaction={\\"from\\":\\"0x651F8E3f40f3Fc568f72430632CD0A9d20b38657\\",\\"to\\":\\"0x69B44e8D4dEb53997496f6785c4954517eDA5b84\\",\\"data\\":\\"0x6dfc0ddb00000000000000000000000028560229fcce7106f86607c2768f9fa579b8923c0000000000000000000000000000000000000000000000000de0b6b3a764000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000b504f333f9de6484597d89b3\\",\\"accessList\\":null}, error={\\"name\\":\\"ProviderError\\",\\"_stack\\":\\"ProviderError: failed to estimate gas: message execution failed: exit 33, revert reason: Error(SPL", + "swapError": "VM Exception while processing transaction: revert SPL", "tickBefore": -23028, } `; @@ -2297,7 +2715,7 @@ Object { "poolBalance0": "6324555320336758664", "poolBalance1": "632455532033675867", "poolPriceBefore": "0.10000", - "swapError": "VM Exception while processing transaction: revert SPL), vm error: message failed with backtrace:\\\\n00: f03940 (method 3844450837) -- contract reverted (33)\\\\n01: f03943 (method 3844450837) -- contract reverted (33)\\\\n (RetCode=33)\\", method=\\"estimateGas\\", transaction={\\"from\\":\\"0x651F8E3f40f3Fc568f72430632CD0A9d20b38657\\",\\"to\\":\\"0xfd016404f9D8f57d5179E6fdBd5A8E38A397C018\\",\\"data\\":\\"0xbac7bf78000000000000000000000000e3a254dcd545379508d6c74b6e484deb6209e9550000000000000000000000000000000000000000000000000de0b6b3a764000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000b504f333f9de6484597d89b3\\",\\"accessList\\":null}, error={\\"name\\":\\"ProviderError\\",\\"_stack\\":\\"ProviderError: failed to estimate gas: message execution failed: exit 33, revert reason: Error(SPL", + "swapError": "VM Exception while processing transaction: revert SPL", "tickBefore": -23028, } `; @@ -2307,7 +2725,7 @@ Object { "poolBalance0": "6324555320336758664", "poolBalance1": "632455532033675867", "poolPriceBefore": "0.10000", - "swapError": "VM Exception while processing transaction: revert SPL), vm error: message failed with backtrace:\\\\n00: f03996 (method 3844450837) -- contract reverted (33)\\\\n01: f03999 (method 3844450837) -- contract reverted (33)\\\\n (RetCode=33)\\", method=\\"estimateGas\\", transaction={\\"from\\":\\"0x651F8E3f40f3Fc568f72430632CD0A9d20b38657\\",\\"to\\":\\"0xf294C3be926277d0F6E696e110dB6d3845d2f9F9\\",\\"data\\":\\"0x2ec20bf90000000000000000000000001a552c33f08a8b7979762745162f9bdcb7c6cdeb0000000000000000000000000000000000000000a1e89b12424876d9b744b6790000000000000000000000000000000000000000000000000000000000000001\\",\\"accessList\\":null}, error={\\"name\\":\\"ProviderError\\",\\"_stack\\":\\"ProviderError: failed to estimate gas: message execution failed: exit 33, revert reason: Error(SPL", + "swapError": "VM Exception while processing transaction: revert SPL", "tickBefore": -23028, } `; @@ -2317,7 +2735,7 @@ Object { "poolBalance0": "6324555320336758664", "poolBalance1": "632455532033675867", "poolPriceBefore": "0.10000", - "swapError": "VM Exception while processing transaction: revert SPL), vm error: message failed with backtrace:\\\\n00: f04004 (method 3844450837) -- contract reverted (33)\\\\n01: f04007 (method 3844450837) -- contract reverted (33)\\\\n (RetCode=33)\\", method=\\"estimateGas\\", transaction={\\"from\\":\\"0x651F8E3f40f3Fc568f72430632CD0A9d20b38657\\",\\"to\\":\\"0x580D6AA87e4b38FAfC8722B4847DA39419A81F12\\",\\"data\\":\\"0x2ec20bf90000000000000000000000003785cd9766ade0549b30c9a0324ba1ec67a0a7bc000000000000000000000000000000000000000194c583ada5b529204a2bc8300000000000000000000000000000000000000000000000000000000000000001\\",\\"accessList\\":null}, error={\\"name\\":\\"ProviderError\\",\\"_stack\\":\\"ProviderError: failed to estimate gas: message execution failed: exit 33, revert reason: Error(SPL", + "swapError": "VM Exception while processing transaction: revert SPL", "tickBefore": -23028, } `; @@ -2487,7 +2905,7 @@ Object { "poolBalance0": "632455532033675867", "poolBalance1": "6324555320336758664", "poolPriceBefore": "10.000", - "swapError": "VM Exception while processing transaction: revert SPL), vm error: message failed with backtrace:\\\\n00: f03804 (method 3844450837) -- contract reverted (33)\\\\n01: f03807 (method 3844450837) -- contract reverted (33)\\\\n (RetCode=33)\\", method=\\"estimateGas\\", transaction={\\"from\\":\\"0x651F8E3f40f3Fc568f72430632CD0A9d20b38657\\",\\"to\\":\\"0x4714Ab27Bb2CF526d8dC56799BC2872c547BAc78\\",\\"data\\":\\"0xe2be91090000000000000000000000004f11a78fa1aa3aade14968b50ca7cbb13140011f0000000000000000000000000000000000000000000000000de0b6b3a7640000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000016a09e667f3bcc908b2fb1366\\",\\"accessList\\":null}, error={\\"name\\":\\"ProviderError\\",\\"_stack\\":\\"ProviderError: failed to estimate gas: message execution failed: exit 33, revert reason: Error(SPL", + "swapError": "VM Exception while processing transaction: revert SPL", "tickBefore": 23027, } `; @@ -2609,7 +3027,7 @@ Object { "poolBalance0": "632455532033675867", "poolBalance1": "6324555320336758664", "poolPriceBefore": "10.000", - "swapError": "VM Exception while processing transaction: revert SPL), vm error: message failed with backtrace:\\\\n00: f03820 (method 3844450837) -- contract reverted (33)\\\\n01: f03823 (method 3844450837) -- contract reverted (33)\\\\n (RetCode=33)\\", method=\\"estimateGas\\", transaction={\\"from\\":\\"0x651F8E3f40f3Fc568f72430632CD0A9d20b38657\\",\\"to\\":\\"0xc42Bc3B47E8830D36C0b676daB40FF0A7f5Da135\\",\\"data\\":\\"0xf603482c000000000000000000000000859a63632a08f88dfc88ffa1d75608801cf9a5770000000000000000000000000000000000000000000000000de0b6b3a7640000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000016a09e667f3bcc908b2fb1366\\",\\"accessList\\":null}, error={\\"name\\":\\"ProviderError\\",\\"_stack\\":\\"ProviderError: failed to estimate gas: message execution failed: exit 33, revert reason: Error(SPL", + "swapError": "VM Exception while processing transaction: revert SPL", "tickBefore": 23027, } `; @@ -2619,7 +3037,7 @@ Object { "poolBalance0": "632455532033675867", "poolBalance1": "6324555320336758664", "poolPriceBefore": "10.000", - "swapError": "VM Exception while processing transaction: revert SPL), vm error: message failed with backtrace:\\\\n00: f03884 (method 3844450837) -- contract reverted (33)\\\\n01: f03887 (method 3844450837) -- contract reverted (33)\\\\n (RetCode=33)\\", method=\\"estimateGas\\", transaction={\\"from\\":\\"0x651F8E3f40f3Fc568f72430632CD0A9d20b38657\\",\\"to\\":\\"0x48357D71918ED2BDa58E94De5236D32a19cFAaD7\\",\\"data\\":\\"0x9e77b805000000000000000000000000683ecc339d7c3c3fc63e9c752fe7bf0b06ebbd3c0000000000000000000000000000000000000000a1e89b12424876d9b744b6790000000000000000000000000000000000000000000000000000000000000001\\",\\"accessList\\":null}, error={\\"name\\":\\"ProviderError\\",\\"_stack\\":\\"ProviderError: failed to estimate gas: message execution failed: exit 33, revert reason: Error(SPL", + "swapError": "VM Exception while processing transaction: revert SPL", "tickBefore": 23027, } `; @@ -2629,11 +3047,255 @@ Object { "poolBalance0": "632455532033675867", "poolBalance1": "6324555320336758664", "poolPriceBefore": "10.000", - "swapError": "VM Exception while processing transaction: revert SPL), vm error: message failed with backtrace:\\\\n00: f03860 (method 3844450837) -- contract reverted (33)\\\\n01: f03863 (method 3844450837) -- contract reverted (33)\\\\n (RetCode=33)\\", method=\\"estimateGas\\", transaction={\\"from\\":\\"0x651F8E3f40f3Fc568f72430632CD0A9d20b38657\\",\\"to\\":\\"0x870203FBA9C8039e25Eb63264710B602B9f2EbBf\\",\\"data\\":\\"0x9e77b805000000000000000000000000627a09a417eaade38695f4e1f08eba7c32b72285000000000000000000000000000000000000000194c583ada5b529204a2bc8300000000000000000000000000000000000000000000000000000000000000001\\",\\"accessList\\":null}, error={\\"name\\":\\"ProviderError\\",\\"_stack\\":\\"ProviderError: failed to estimate gas: message execution failed: exit 33, revert reason: Error(SPL", + "swapError": "VM Exception while processing transaction: revert SPL", "tickBefore": 23027, } `; +exports[`UniswapV3Pool swap tests medium fee, token0 liquidity only swap exactly 0.0000000000000010000 token0 for token1 1`] = ` +Object { + "amount0Before": "1995041008271423675", + "amount0Delta": "0", + "amount1Before": "0", + "amount1Delta": "0", + "executionPrice": "NaN", + "feeGrowthGlobal0X128Delta": "0", + "feeGrowthGlobal1X128Delta": "0", + "poolPriceAfter": "0.0000000000000000000000000000000000000029390", + "poolPriceBefore": "1.0000", + "tickAfter": -887272, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, token0 liquidity only swap exactly 0.0000000000000010000 token1 for token0 1`] = ` +Object { + "amount0Before": "1995041008271423675", + "amount0Delta": "-996", + "amount1Before": "0", + "amount1Delta": "1000", + "executionPrice": "1.0040", + "feeGrowthGlobal0X128Delta": "0", + "feeGrowthGlobal1X128Delta": "510423550381407695195", + "poolPriceAfter": "1.0000", + "poolPriceBefore": "1.0000", + "tickAfter": 0, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, token0 liquidity only swap exactly 1.0000 token0 for token1 1`] = ` +Object { + "amount0Before": "1995041008271423675", + "amount0Delta": "0", + "amount1Before": "0", + "amount1Delta": "0", + "executionPrice": "NaN", + "feeGrowthGlobal0X128Delta": "0", + "feeGrowthGlobal1X128Delta": "0", + "poolPriceAfter": "0.0000000000000000000000000000000000000029390", + "poolPriceBefore": "1.0000", + "tickAfter": -887272, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, token0 liquidity only swap exactly 1.0000 token0 for token1 to price 0.50000 1`] = ` +Object { + "amount0Before": "1995041008271423675", + "amount0Delta": "0", + "amount1Before": "0", + "amount1Delta": "0", + "executionPrice": "NaN", + "feeGrowthGlobal0X128Delta": "0", + "feeGrowthGlobal1X128Delta": "0", + "poolPriceAfter": "0.50000", + "poolPriceBefore": "1.0000", + "tickAfter": -6932, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, token0 liquidity only swap exactly 1.0000 token1 for token0 1`] = ` +Object { + "amount0Before": "1995041008271423675", + "amount0Delta": "-665331998665331998", + "amount1Before": "0", + "amount1Delta": "1000000000000000000", + "executionPrice": "1.5030", + "feeGrowthGlobal0X128Delta": "0", + "feeGrowthGlobal1X128Delta": "510423550381407695195061911147652317", + "poolPriceAfter": "2.2455", + "poolPriceBefore": "1.0000", + "tickAfter": 8089, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, token0 liquidity only swap exactly 1.0000 token1 for token0 to price 2.0000 1`] = ` +Object { + "amount0Before": "1995041008271423675", + "amount0Delta": "-585786437626904951", + "amount1Before": "0", + "amount1Delta": "830919884399388263", + "executionPrice": "1.4185", + "feeGrowthGlobal0X128Delta": "0", + "feeGrowthGlobal1X128Delta": "424121077477644648929101317621422688", + "poolPriceAfter": "2.0000", + "poolPriceBefore": "1.0000", + "tickAfter": 6931, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, token0 liquidity only swap token0 for exactly 0.0000000000000010000 token1 1`] = ` +Object { + "amount0Before": "1995041008271423675", + "amount0Delta": "0", + "amount1Before": "0", + "amount1Delta": "0", + "executionPrice": "NaN", + "feeGrowthGlobal0X128Delta": "0", + "feeGrowthGlobal1X128Delta": "0", + "poolPriceAfter": "0.0000000000000000000000000000000000000029390", + "poolPriceBefore": "1.0000", + "tickAfter": -887272, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, token0 liquidity only swap token0 for exactly 1.0000 token1 1`] = ` +Object { + "amount0Before": "1995041008271423675", + "amount0Delta": "0", + "amount1Before": "0", + "amount1Delta": "0", + "executionPrice": "NaN", + "feeGrowthGlobal0X128Delta": "0", + "feeGrowthGlobal1X128Delta": "0", + "poolPriceAfter": "0.0000000000000000000000000000000000000029390", + "poolPriceBefore": "1.0000", + "tickAfter": -887272, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, token0 liquidity only swap token0 for exactly 1.0000 token1 to price 0.50000 1`] = ` +Object { + "amount0Before": "1995041008271423675", + "amount0Delta": "0", + "amount1Before": "0", + "amount1Delta": "0", + "executionPrice": "NaN", + "feeGrowthGlobal0X128Delta": "0", + "feeGrowthGlobal1X128Delta": "0", + "poolPriceAfter": "0.50000", + "poolPriceBefore": "1.0000", + "tickAfter": -6932, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, token0 liquidity only swap token0 for token1 to price 0.40000 1`] = ` +Object { + "amount0Before": "1995041008271423675", + "amount0Delta": "0", + "amount1Before": "0", + "amount1Delta": "0", + "executionPrice": "NaN", + "feeGrowthGlobal0X128Delta": "0", + "feeGrowthGlobal1X128Delta": "0", + "poolPriceAfter": "0.40000", + "poolPriceBefore": "1.0000", + "tickAfter": -9164, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, token0 liquidity only swap token0 for token1 to price 2.5000 1`] = ` +Object { + "poolBalance0": "1995041008271423675", + "poolBalance1": "0", + "poolPriceBefore": "1.0000", + "swapError": "VM Exception while processing transaction: revert SPL", + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, token0 liquidity only swap token1 for exactly 0.0000000000000010000 token0 1`] = ` +Object { + "amount0Before": "1995041008271423675", + "amount0Delta": "-1000", + "amount1Before": "0", + "amount1Delta": "1005", + "executionPrice": "1.0050", + "feeGrowthGlobal0X128Delta": "0", + "feeGrowthGlobal1X128Delta": "680564733841876926926", + "poolPriceAfter": "1.0000", + "poolPriceBefore": "1.0000", + "tickAfter": 0, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, token0 liquidity only swap token1 for exactly 1.0000 token0 1`] = ` +Object { + "amount0Before": "1995041008271423675", + "amount0Delta": "-1000000000000000000", + "amount1Before": "0", + "amount1Delta": "2006018054162487463", + "executionPrice": "2.0060", + "feeGrowthGlobal0X128Delta": "0", + "feeGrowthGlobal1X128Delta": "1023918857334819954209013958517557896", + "poolPriceAfter": "4.0000", + "poolPriceBefore": "1.0000", + "tickAfter": 13863, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, token0 liquidity only swap token1 for exactly 1.0000 token0 to price 2.0000 1`] = ` +Object { + "amount0Before": "1995041008271423675", + "amount0Delta": "-585786437626904951", + "amount1Before": "0", + "amount1Delta": "830919884399388263", + "executionPrice": "1.4185", + "feeGrowthGlobal0X128Delta": "0", + "feeGrowthGlobal1X128Delta": "424121077477644648929101317621422688", + "poolPriceAfter": "2.0000", + "poolPriceBefore": "1.0000", + "tickAfter": 6931, + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, token0 liquidity only swap token1 for token0 to price 0.40000 1`] = ` +Object { + "poolBalance0": "1995041008271423675", + "poolBalance1": "0", + "poolPriceBefore": "1.0000", + "swapError": "VM Exception while processing transaction: revert SPL", + "tickBefore": 0, +} +`; + +exports[`UniswapV3Pool swap tests medium fee, token0 liquidity only swap token1 for token0 to price 2.5000 1`] = ` +Object { + "amount0Before": "1995041008271423675", + "amount0Delta": "-735088935932648267", + "amount1Before": "0", + "amount1Delta": "1165774985123750584", + "executionPrice": "1.5859", + "feeGrowthGlobal0X128Delta": "0", + "feeGrowthGlobal1X128Delta": "595039006852697554786973994761078087", + "poolPriceAfter": "2.5000", + "poolPriceBefore": "1.0000", + "tickAfter": 9163, + "tickBefore": 0, +} +`; + exports[`UniswapV3Pool swap tests medium fee, token1 liquidity only swap exactly 0.0000000000000010000 token0 for token1 1`] = ` Object { "amount0Before": "0", @@ -2799,7 +3461,7 @@ Object { "poolBalance0": "0", "poolBalance1": "1995041008271423675", "poolPriceBefore": "1.0000", - "swapError": "VM Exception while processing transaction: revert SPL), vm error: message failed with backtrace:\\\\n00: f04307 (method 3844450837) -- contract reverted (33)\\\\n01: f04310 (method 3844450837) -- contract reverted (33)\\\\n (RetCode=33)\\", method=\\"estimateGas\\", transaction={\\"from\\":\\"0x651F8E3f40f3Fc568f72430632CD0A9d20b38657\\",\\"to\\":\\"0xb6397EFf1A07089a8587FAa9cFA9FFDa86Ee60CF\\",\\"data\\":\\"0x2ec20bf9000000000000000000000000f8eda4509862680e44edd7eb4b045732855ff8e2000000000000000000000000000000000000000194c583ada5b529204a2bc8300000000000000000000000000000000000000000000000000000000000000001\\",\\"accessList\\":null}, error={\\"name\\":\\"ProviderError\\",\\"_stack\\":\\"ProviderError: failed to estimate gas: message execution failed: exit 33, revert reason: Error(SPL", + "swapError": "VM Exception while processing transaction: revert SPL", "tickBefore": 0, } `; @@ -2857,7 +3519,7 @@ Object { "poolBalance0": "0", "poolBalance1": "1995041008271423675", "poolPriceBefore": "1.0000", - "swapError": "VM Exception while processing transaction: revert SPL), vm error: message failed with backtrace:\\\\n00: f04315 (method 3844450837) -- contract reverted (33)\\\\n01: f04318 (method 3844450837) -- contract reverted (33)\\\\n (RetCode=33)\\", method=\\"estimateGas\\", transaction={\\"from\\":\\"0x651F8E3f40f3Fc568f72430632CD0A9d20b38657\\",\\"to\\":\\"0xFd0191D70eA8f0653BB7f062165cCadAEA82d7C3\\",\\"data\\":\\"0x9e77b805000000000000000000000000eef3a4c47ec220ffb7635a63926a7bee0a8f337c0000000000000000000000000000000000000000a1e89b12424876d9b744b6790000000000000000000000000000000000000000000000000000000000000001\\",\\"accessList\\":null}, error={\\"name\\":\\"ProviderError\\",\\"_stack\\":\\"ProviderError: failed to estimate gas: message execution failed: exit 33, revert reason: Error(SPL", + "swapError": "VM Exception while processing transaction: revert SPL", "tickBefore": 0, } `;