From 94303300f6d524477d96f9ac288ede8c8e2a686f Mon Sep 17 00:00:00 2001 From: ts0yu <120932697+ts0yu@users.noreply.github.com> Date: Sat, 21 Sep 2024 18:36:28 +0000 Subject: [PATCH] feat: add template strategy example --- Cargo.toml | 2 +- examples/template_strategy.rs | 83 +++++++++++++++++++++++++++++++++++ src/artifacts/Fetcher.json | 1 - src/lib.rs | 10 ----- 4 files changed, 84 insertions(+), 12 deletions(-) create mode 100644 examples/template_strategy.rs delete mode 100644 src/artifacts/Fetcher.json diff --git a/Cargo.toml b/Cargo.toml index cded306..9b85f59 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -21,7 +21,7 @@ alloy-sol-macro = "0.8.0" alloy-sol-types = "0.8.0" serde = { version = "1.0", features = ["derive"] } clap = { version = "4.5.16", features = ["derive"] } -tokio = { version = "1.39.2", features = ["macros"] } +tokio = { version = "1.39.2", features = ["macros", "rt-multi-thread"] } alloy = { version = "0.3.0", features = ["full", "node-bindings", "json"] } alloy-chains = "0.1.29" alloy-transport-http = "0.3.0" diff --git a/examples/template_strategy.rs b/examples/template_strategy.rs new file mode 100644 index 0000000..e58d026 --- /dev/null +++ b/examples/template_strategy.rs @@ -0,0 +1,83 @@ +use alloy::primitives::{Address, Bytes, Signed, Uint, I256}; +use arena_core::{ + arena::{Arena, ArenaBuilder}, + config::Config, + engine::{ + arbitrageur::FixedArbitrageur, + inspector::{EmptyInspector, Inspector}, + Engine, + }, + feed::OrnsteinUhlenbeck, + strategy::Strategy, + AnvilProvider, Signal, +}; +use async_trait::async_trait; + +struct StrategyMock; + +#[async_trait] +impl Strategy for StrategyMock { + async fn init( + &self, + provider: AnvilProvider, + _signal: Signal, + _inspector: &mut Box>, + engine: Engine, + ) { + // provide a fixed amount of liquidity upon runtime initialization to the pool across the full tick range. + engine + .modify_liquidity( + I256::try_from(10000000).unwrap(), + Signed::try_from(-887272).unwrap(), + Signed::try_from(887272).unwrap(), + Bytes::new(), + provider, + ) + .await + .unwrap(); + } + async fn process( + &self, + _provider: AnvilProvider, + _signal: Signal, + _inspector: &mut Box>, + _engine: Engine, + ) { + } +} + +#[tokio::main] +async fn main() { + let builder: ArenaBuilder<_> = ArenaBuilder::new(); + + let mut arena: Arena<_> = builder + .with_strategy(Box::new(StrategyMock)) + .with_feed(Box::new(OrnsteinUhlenbeck::new(1.0, 0.1, 1.0, 0.1, 0.1))) + .with_inspector(Box::new(EmptyInspector {})) + .with_arbitrageur(Box::new(FixedArbitrageur { + depth: Signed::try_from(10000).unwrap(), + })) + .build(); + + arena + .run(Config::new( + // timesteps to run for + 10, + // manager fee + Uint::from(0), + // pool tick spacing + Signed::try_from(2).unwrap(), + // hook data + Bytes::new(), + // sqrtpricex96 + Uint::from(79228162514264337593543950336_u128), + // pool fee + Uint::from(0), + // initial price + Uint::from(1), + // hook contract + Address::ZERO, + )) + .await + .unwrap(); +} diff --git a/src/artifacts/Fetcher.json b/src/artifacts/Fetcher.json deleted file mode 100644 index f92916e..0000000 --- a/src/artifacts/Fetcher.json +++ /dev/null @@ -1 +0,0 @@ -{"abi":[{"type":"function","name":"POOLS_SLOT","inputs":[],"outputs":[{"name":"","type":"bytes32","internalType":"bytes32"}],"stateMutability":"view"},{"type":"function","name":"TICKS_OFFSET","inputs":[],"outputs":[{"name":"","type":"uint256","internalType":"uint256"}],"stateMutability":"view"},{"type":"function","name":"getSlot0","inputs":[{"name":"manager","type":"address","internalType":"contract IPoolManager"},{"name":"poolId","type":"bytes32","internalType":"PoolId"}],"outputs":[{"name":"sqrtPriceX96","type":"uint160","internalType":"uint160"},{"name":"tick","type":"int24","internalType":"int24"},{"name":"protocolFee","type":"uint24","internalType":"uint24"},{"name":"lpFee","type":"uint24","internalType":"uint24"}],"stateMutability":"view"},{"type":"function","name":"getTickInfo","inputs":[{"name":"manager","type":"address","internalType":"contract IPoolManager"},{"name":"poolId","type":"bytes32","internalType":"PoolId"},{"name":"tick","type":"int24","internalType":"int24"}],"outputs":[{"name":"liquidityGross","type":"uint128","internalType":"uint128"},{"name":"liquidityNet","type":"int128","internalType":"int128"},{"name":"feeGrowthOutside0X128","type":"uint256","internalType":"uint256"},{"name":"feeGrowthOutside1X128","type":"uint256","internalType":"uint256"}],"stateMutability":"view"},{"type":"function","name":"toId","inputs":[{"name":"poolKey","type":"tuple","internalType":"struct PoolKey","components":[{"name":"currency0","type":"address","internalType":"Currency"},{"name":"currency1","type":"address","internalType":"Currency"},{"name":"fee","type":"uint24","internalType":"uint24"},{"name":"tickSpacing","type":"int24","internalType":"int24"},{"name":"hooks","type":"address","internalType":"contract IHooks"}]}],"outputs":[{"name":"poolId","type":"bytes32","internalType":"PoolId"}],"stateMutability":"pure"}],"bytecode":{"object":"0x6080604052348015600f57600080fd5b506105c98061001f6000396000f3fe608060405234801561001057600080fd5b50600436106100575760003560e01c806332c961d91461005c57806357eb1da714610084578063769323e31461008c578063b08d3fe214610094578063e631bcbf146100d4575b600080fd5b61007161006a36600461039e565b60a0902090565b6040519081526020015b60405180910390f35b610071600681565b610071600481565b6100a76100a236600461043e565b61011f565b604080516001600160801b039095168552600f9390930b602085015291830152606082015260800161007b565b6100e76100e236600461047c565b6101dd565b604080516001600160a01b03909516855260029390930b602085015262ffffff9182169284019290925216606082015260800161007b565b60008060008060006101318787610295565b604051631afeb18d60e11b815260048101829052600360248201529091506000906001600160a01b038a16906335fd631a90604401600060405180830381865afa158015610183573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526101ab91908101906104a8565b602081015160408201516060909201516001600160801b0382169c60809290921d9b5091995090975095505050505050565b60008060008060006101ee866102eb565b604051631e2eaeaf60e01b8152600481018290529091506000906001600160a01b03891690631e2eaeaf90602401602060405180830381865afa158015610239573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061025d9190610559565b90506001600160a01b03811695508060a01c60020b945062ffffff8160b81c16935062ffffff8160d01c169250505092959194509250565b6000806102a1846102eb565b905060006102b0600483610572565b60408051600287900b602082015290810182905290915060600160405160208183030381529060405280519060200120925050505b92915050565b60405160009061030b908390600690602001918252602082015260400190565b604051602081830303815290604052805190602001209050919050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff8111828210171561036757610367610328565b604052919050565b6001600160a01b038116811461038457600080fd5b50565b8035600281900b811461039957600080fd5b919050565b600060a08284031280156103b157600080fd5b5060405160a0810167ffffffffffffffff811182821017156103d5576103d5610328565b60405282356103e38161036f565b815260208301356103f38161036f565b6020820152604083013562ffffff8116811461040e57600080fd5b604082015261041f60608401610387565b606082015260808301356104328161036f565b60808201529392505050565b60008060006060848603121561045357600080fd5b833561045e8161036f565b92506020840135915061047360408501610387565b90509250925092565b6000806040838503121561048f57600080fd5b823561049a8161036f565b946020939093013593505050565b6000602082840312156104ba57600080fd5b815167ffffffffffffffff8111156104d157600080fd5b8201601f810184136104e257600080fd5b805167ffffffffffffffff8111156104fc576104fc610328565b8060051b61050c6020820161033e565b9182526020818401810192908101908784111561052857600080fd5b6020850194505b8385101561054e5784518083526020958601959093509091019061052f565b979650505050505050565b60006020828403121561056b57600080fd5b5051919050565b808201808211156102e557634e487b7160e01b600052601160045260246000fdfea26469706673582212206cda2f5debfef0eb5b0a90537a2fc11f4d074cfbee990c256493c4fbe0ba3b0364736f6c634300081a0033","sourceMap":"446:2777:19:-:0;;;;;;;;;;;;;;;;;;;","linkReferences":{}},"deployedBytecode":{"object":"0x608060405234801561001057600080fd5b50600436106100575760003560e01c806332c961d91461005c57806357eb1da714610084578063769323e31461008c578063b08d3fe214610094578063e631bcbf146100d4575b600080fd5b61007161006a36600461039e565b60a0902090565b6040519081526020015b60405180910390f35b610071600681565b610071600481565b6100a76100a236600461043e565b61011f565b604080516001600160801b039095168552600f9390930b602085015291830152606082015260800161007b565b6100e76100e236600461047c565b6101dd565b604080516001600160a01b03909516855260029390930b602085015262ffffff9182169284019290925216606082015260800161007b565b60008060008060006101318787610295565b604051631afeb18d60e11b815260048101829052600360248201529091506000906001600160a01b038a16906335fd631a90604401600060405180830381865afa158015610183573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526101ab91908101906104a8565b602081015160408201516060909201516001600160801b0382169c60809290921d9b5091995090975095505050505050565b60008060008060006101ee866102eb565b604051631e2eaeaf60e01b8152600481018290529091506000906001600160a01b03891690631e2eaeaf90602401602060405180830381865afa158015610239573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061025d9190610559565b90506001600160a01b03811695508060a01c60020b945062ffffff8160b81c16935062ffffff8160d01c169250505092959194509250565b6000806102a1846102eb565b905060006102b0600483610572565b60408051600287900b602082015290810182905290915060600160405160208183030381529060405280519060200120925050505b92915050565b60405160009061030b908390600690602001918252602082015260400190565b604051602081830303815290604052805190602001209050919050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff8111828210171561036757610367610328565b604052919050565b6001600160a01b038116811461038457600080fd5b50565b8035600281900b811461039957600080fd5b919050565b600060a08284031280156103b157600080fd5b5060405160a0810167ffffffffffffffff811182821017156103d5576103d5610328565b60405282356103e38161036f565b815260208301356103f38161036f565b6020820152604083013562ffffff8116811461040e57600080fd5b604082015261041f60608401610387565b606082015260808301356104328161036f565b60808201529392505050565b60008060006060848603121561045357600080fd5b833561045e8161036f565b92506020840135915061047360408501610387565b90509250925092565b6000806040838503121561048f57600080fd5b823561049a8161036f565b946020939093013593505050565b6000602082840312156104ba57600080fd5b815167ffffffffffffffff8111156104d157600080fd5b8201601f810184136104e257600080fd5b805167ffffffffffffffff8111156104fc576104fc610328565b8060051b61050c6020820161033e565b9182526020818401810192908101908784111561052857600080fd5b6020850194505b8385101561054e5784518083526020958601959093509091019061052f565b979650505050505050565b60006020828403121561056b57600080fd5b5051919050565b808201808211156102e557634e487b7160e01b600052601160045260246000fdfea26469706673582212206cda2f5debfef0eb5b0a90537a2fc11f4d074cfbee990c256493c4fbe0ba3b0364736f6c634300081a0033","sourceMap":"446:2777:19:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;744:181;;;;;;:::i;:::-;898:10;879:30;;;744:181;;;;2076:25:20;;;2064:2;2049:18;744:181:19;;;;;;;;469:56;;522:1;469:56;;531:40;;570:1;531:40;;931:799;;;;;;:::i;:::-;;:::i;:::-;;;;-1:-1:-1;;;;;3234:47:20;;;3216:66;;3329:2;3318:22;;;;3313:2;3298:18;;3291:50;3357:18;;;3350:34;3415:2;3400:18;;3393:34;3203:3;3188:19;931:799:19;2987:446:20;1736:996:19;;;;;;:::i;:::-;;:::i;:::-;;;;-1:-1:-1;;;;;4120:32:20;;;4102:51;;4200:1;4189:21;;;;4184:2;4169:18;;4162:49;4259:8;4247:21;;;4227:18;;;4220:49;;;;4305:21;4300:2;4285:18;;4278:49;4089:3;4074:19;1736:996:19;3879:454:20;931:799:19;1061:22;1097:19;1130:29;1173;1227:12;1242:30;1259:6;1267:4;1242:16;:30::i;:::-;1358:25;;-1:-1:-1;;;1358:25:19;;;;;4520::20;;;1381:1:19;4561:18:20;;;4554:34;1227:45:19;;-1:-1:-1;1334:21:19;;-1:-1:-1;;;;;1358:16:19;;;;;4493:18:20;;1358:25:19;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;1358:25:19;;;;;;;;;;;;:::i;:::-;1465:2;1455:13;;1449:20;1652:2;1642:13;;1636:20;1710:2;1700:13;;;1694:20;-1:-1:-1;;;;;1548:50:19;;;1502:3;1498:19;;;;;-1:-1:-1;1636:20:19;;-1:-1:-1;1694:20:19;;-1:-1:-1;931:799:19;-1:-1:-1;;;;;;931:799:19:o;1736:996::-;1838:20;1860:10;1872:18;1892:12;1977:17;1997:25;2015:6;1997:17;:25::i;:::-;2048:27;;-1:-1:-1;;;2048:27:19;;;;;2076:25:20;;;1977:45:19;;-1:-1:-1;2033:12:19;;-1:-1:-1;;;;;2048:16:19;;;;;2049:18:20;;2048:27:19;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;2033:42;;-1:-1:-1;;;;;2401:4:19;2397:53;2381:69;;2530:4;2525:3;2521:14;2518:1;2507:29;2499:37;;2620:8;2613:4;2608:3;2604:14;2600:29;2585:44;;2707:8;2700:4;2695:3;2691:14;2687:29;2678:38;;2328:398;;1736:996;;;;;;;:::o;2738:483::-;2814:7;2890:17;2910:25;2928:6;2910:17;:25::i;:::-;2890:45;-1:-1:-1;3004:24:19;3039:33;570:1;2890:45;3039:33;:::i;:::-;3165:48;;;3182:12;;;;3165:48;;;6201:19:20;6236:12;;;6229:28;;;3031:42:19;;-1:-1:-1;6273:12:20;;3165:48:19;;;;;;;;;;;;3155:59;;;;;;3148:66;;;;2738:483;;;;;:::o;578:160::-;679:51;;643:7;;679:51;;710:6;;522:1;;679:51;;6201:19:20;;;6245:2;6236:12;;6229:28;6282:2;6273:12;;6046:245;679:51:19;;;;;;;;;;;;;669:62;;;;;;662:69;;578:160;;;:::o;14:127:20:-;75:10;70:3;66:20;63:1;56:31;106:4;103:1;96:15;130:4;127:1;120:15;146:275;217:2;211:9;282:2;263:13;;-1:-1:-1;;259:27:20;247:40;;317:18;302:34;;338:22;;;299:62;296:88;;;364:18;;:::i;:::-;400:2;393:22;146:275;;-1:-1:-1;146:275:20:o;426:153::-;-1:-1:-1;;;;;523:31:20;;513:42;;503:70;;569:1;566;559:12;503:70;426:153;:::o;584:160::-;650:20;;710:1;699:20;;;689:31;;679:59;;734:1;731;724:12;679:59;584:160;;;:::o;749:1149::-;833:6;893:3;881:9;872:7;868:23;864:33;909:2;906:22;;;924:1;921;914:12;906:22;-1:-1:-1;993:2:20;987:9;1035:3;1023:16;;1069:18;1054:34;;1090:22;;;1051:62;1048:88;;;1116:18;;:::i;:::-;1152:2;1145:22;1189:23;;1221:53;1189:23;1221:53;:::i;:::-;1283:21;;1356:2;1341:18;;1328:32;1369:55;1328:32;1369:55;:::i;:::-;1452:2;1440:15;;1433:32;1517:2;1502:18;;1489:32;1565:8;1552:22;;1540:35;;1530:63;;1589:1;1586;1579:12;1530:63;1621:2;1609:15;;1602:32;1667:36;1699:2;1684:18;;1667:36;:::i;:::-;1662:2;1654:6;1650:15;1643:61;1756:3;1745:9;1741:19;1728:33;1770:55;1817:7;1770:55;:::i;:::-;1853:3;1841:16;;1834:33;1845:6;749:1149;-1:-1:-1;;;749:1149:20:o;2476:506::-;2598:6;2606;2614;2667:2;2655:9;2646:7;2642:23;2638:32;2635:52;;;2683:1;2680;2673:12;2635:52;2722:9;2709:23;2741:53;2788:5;2741:53;:::i;:::-;2813:5;-1:-1:-1;2891:2:20;2876:18;;2863:32;;-1:-1:-1;2940:36:20;2972:2;2957:18;;2940:36;:::i;:::-;2930:46;;2476:506;;;;;:::o;3438:436::-;3553:6;3561;3614:2;3602:9;3593:7;3589:23;3585:32;3582:52;;;3630:1;3627;3620:12;3582:52;3669:9;3656:23;3688:53;3735:5;3688:53;:::i;:::-;3760:5;3838:2;3823:18;;;;3810:32;;-1:-1:-1;;;3438:436:20:o;4599:980::-;4694:6;4747:2;4735:9;4726:7;4722:23;4718:32;4715:52;;;4763:1;4760;4753:12;4715:52;4796:9;4790:16;4829:18;4821:6;4818:30;4815:50;;;4861:1;4858;4851:12;4815:50;4884:22;;4937:4;4929:13;;4925:27;-1:-1:-1;4915:55:20;;4966:1;4963;4956:12;4915:55;4999:2;4993:9;5025:18;5017:6;5014:30;5011:56;;;5047:18;;:::i;:::-;5093:6;5090:1;5086:14;5120:28;5144:2;5140;5136:11;5120:28;:::i;:::-;5182:19;;;5226:2;5256:11;;;5252:20;;;5217:12;;;;5284:19;;;5281:39;;;5316:1;5313;5306:12;5281:39;5348:2;5344;5340:11;5329:22;;5360:189;5376:6;5371:3;5368:15;5360:189;;;5466:10;;5489:18;;;5536:2;5393:12;;;;5466:10;;-1:-1:-1;5527:12:20;;;;5360:189;;;5568:5;4599:980;-1:-1:-1;;;;;;;4599:980:20:o;5584:230::-;5654:6;5707:2;5695:9;5686:7;5682:23;5678:32;5675:52;;;5723:1;5720;5713:12;5675:52;-1:-1:-1;5768:16:20;;5584:230;-1:-1:-1;5584:230:20:o;5819:222::-;5884:9;;;5905:10;;;5902:133;;;5957:10;5952:3;5948:20;5945:1;5938:31;5992:4;5989:1;5982:15;6020:4;6017:1;6010:15","linkReferences":{}},"methodIdentifiers":{"POOLS_SLOT()":"57eb1da7","TICKS_OFFSET()":"769323e3","getSlot0(address,bytes32)":"e631bcbf","getTickInfo(address,bytes32,int24)":"b08d3fe2","toId((address,address,uint24,int24,address))":"32c961d9"},"rawMetadata":"{\"compiler\":{\"version\":\"0.8.26+commit.8a97fa7a\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"name\":\"POOLS_SLOT\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"TICKS_OFFSET\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IPoolManager\",\"name\":\"manager\",\"type\":\"address\"},{\"internalType\":\"PoolId\",\"name\":\"poolId\",\"type\":\"bytes32\"}],\"name\":\"getSlot0\",\"outputs\":[{\"internalType\":\"uint160\",\"name\":\"sqrtPriceX96\",\"type\":\"uint160\"},{\"internalType\":\"int24\",\"name\":\"tick\",\"type\":\"int24\"},{\"internalType\":\"uint24\",\"name\":\"protocolFee\",\"type\":\"uint24\"},{\"internalType\":\"uint24\",\"name\":\"lpFee\",\"type\":\"uint24\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IPoolManager\",\"name\":\"manager\",\"type\":\"address\"},{\"internalType\":\"PoolId\",\"name\":\"poolId\",\"type\":\"bytes32\"},{\"internalType\":\"int24\",\"name\":\"tick\",\"type\":\"int24\"}],\"name\":\"getTickInfo\",\"outputs\":[{\"internalType\":\"uint128\",\"name\":\"liquidityGross\",\"type\":\"uint128\"},{\"internalType\":\"int128\",\"name\":\"liquidityNet\",\"type\":\"int128\"},{\"internalType\":\"uint256\",\"name\":\"feeGrowthOutside0X128\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"feeGrowthOutside1X128\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"Currency\",\"name\":\"currency0\",\"type\":\"address\"},{\"internalType\":\"Currency\",\"name\":\"currency1\",\"type\":\"address\"},{\"internalType\":\"uint24\",\"name\":\"fee\",\"type\":\"uint24\"},{\"internalType\":\"int24\",\"name\":\"tickSpacing\",\"type\":\"int24\"},{\"internalType\":\"contract IHooks\",\"name\":\"hooks\",\"type\":\"address\"}],\"internalType\":\"struct PoolKey\",\"name\":\"poolKey\",\"type\":\"tuple\"}],\"name\":\"toId\",\"outputs\":[{\"internalType\":\"PoolId\",\"name\":\"poolId\",\"type\":\"bytes32\"}],\"stateMutability\":\"pure\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/Fetcher.sol\":\"Fetcher\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[\":@ensdomains/=lib/v4-core/node_modules/@ensdomains/\",\":@openzeppelin/=lib/v4-core/lib/openzeppelin-contracts/\",\":@openzeppelin/contracts/=lib/v4-core/lib/openzeppelin-contracts/contracts/\",\":ds-test/=lib/solmate/lib/ds-test/src/\",\":erc4626-tests/=lib/v4-core/lib/openzeppelin-contracts/lib/erc4626-tests/\",\":forge-gas-snapshot/=lib/v4-core/lib/forge-gas-snapshot/src/\",\":forge-std/=lib/forge-std/src/\",\":hardhat/=lib/v4-core/node_modules/hardhat/\",\":openzeppelin-contracts/=lib/v4-core/lib/openzeppelin-contracts/\",\":solmate/=lib/solmate/src/\",\":v4-core/=lib/v4-core/src/\"]},\"sources\":{\"lib/v4-core/src/interfaces/IExtsload.sol\":{\"keccak256\":\"0x80b53ca4907d6f0088c3b931f2b72cad1dc4615a95094d96bd0fb8dff8d5ba43\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://375c69148622aab7a3537d5fd37d373a8e9731022c8d87bdaee46233b0a99fe1\",\"dweb:/ipfs/QmXFjdoYRxsA5B1kyuxEXgNf3FBoL1zPvy26Qy8EtpdFRN\"]},\"lib/v4-core/src/interfaces/IExttload.sol\":{\"keccak256\":\"0xc6b68283ebd8d1c789df536756726eed51c589134bb20821b236a0d22a135937\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://294394f72dfc219689209f4130d85601dfd0d63c8d47578050d312db70f9b6c8\",\"dweb:/ipfs/QmTDMQ3oxCGHgEBU48a3Lp4S1rRjc8vVCxkhE5ZNej1bsY\"]},\"lib/v4-core/src/interfaces/IHooks.sol\":{\"keccak256\":\"0xdbaf1db938b70f77eb4ddbad5b8d2a1fc648c7d65ca2a312aba16cc013c85df0\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://4ad2d9c85116a2e51281dd40577c798d6d5968be1f8908f43ba152849809deaa\",\"dweb:/ipfs/QmZP4kk9KJzoxv81EgsTfHnJeU8YUxX3yWZudJHbxQjpa8\"]},\"lib/v4-core/src/interfaces/IPoolManager.sol\":{\"keccak256\":\"0x4e07d93993f6ba033c8b5e5b0a3473659aeffe9af0cf8316a879a55ebd696d7a\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://50add8378d59b89b1dc106ea248641caaedd3ac45d62754babe55c526b87c9ad\",\"dweb:/ipfs/QmQUrvy8ZDDdTRTr17msqynVECP3rQFBVBUmFcpFvjAmQx\"]},\"lib/v4-core/src/interfaces/IProtocolFeeController.sol\":{\"keccak256\":\"0xc2d7f3605da9767e36cf25d4d4fa9b95663a6659e26ce28cf29b8b88acb79a4c\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://c7a43cda35b8a9254ed3e46cfd8649361f09121d17ef554bd3d190b9a8d57cc6\",\"dweb:/ipfs/QmRBDQoqCWddH5hY1JdxMyYtY8jMZhWAwtuFJBc3r8V31G\"]},\"lib/v4-core/src/interfaces/IProtocolFees.sol\":{\"keccak256\":\"0x68700020df618c5715737e57630876ec22ccde2d31191a5608babb9f140ed297\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://56b7bb6786f48fff8c9d04e9054955b8cf3d9f5bf819ccda7be192ad2004a27f\",\"dweb:/ipfs/QmZKmUvcYnyihEFySD6SY9osMkP8M1Y7a4kPxLQycEyThw\"]},\"lib/v4-core/src/interfaces/external/IERC20Minimal.sol\":{\"keccak256\":\"0xc1c23330c1511ecfd45c67a683962b4e2555b82f1dacd40cc8b46ae5a6e250e7\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://5ce10b7970482a65f9e9a365b810eeb154a5d4a8229a26653028d84b9622a410\",\"dweb:/ipfs/QmTSwXxZ2FTkM5duBZgbpFs8SRVDR5NPAnW4YimeDhb1s8\"]},\"lib/v4-core/src/interfaces/external/IERC6909Claims.sol\":{\"keccak256\":\"0xa586f345739e52b0488a0fe40b6e375cce67fdd25758408b0efcb5133ad96a48\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://e8c557b7e52abdbbd82e415a1acc27921446a7fd090b7d4877e52be72619547f\",\"dweb:/ipfs/QmXE2KNPbXmGX8BQF3ei6zhzRTnhoTQg39XmqMnkhbr6QK\"]},\"lib/v4-core/src/libraries/CustomRevert.sol\":{\"keccak256\":\"0x70a444afeb27564398dbdf7553651ee2cae14c03c923b6f8972040c8f460ebe3\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://9d7b05390bac9b29188725c8a84edac43cd05571da27b33a0b1e36d9500ecaa6\",\"dweb:/ipfs/QmdYDLwTfFgePDEwFMUqGTj8SNNXXq4JQJnrgomJgcZFvP\"]},\"lib/v4-core/src/libraries/FixedPoint128.sol\":{\"keccak256\":\"0xc7e80dc41f28887d0d915a75c0b2783ae659e5384dd1a3ed1251a42e058d8835\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://2df62bf1d9d4349236fd0bc7a96b3a3be95f4c049603e4a20c8473cca9402b4d\",\"dweb:/ipfs/QmVR5dmMkoypmhaBeBj8cGegHpJycbofUDg59dHm42i9MT\"]},\"lib/v4-core/src/libraries/FullMath.sol\":{\"keccak256\":\"0x4fc73a00817193fd3cac1cc03d8167d21af97d75f1815a070ee31a90c702b4c2\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://c3b2d66d36b1ad56b1ab6e2eb8a816740877b40b461c93f125e88621c8378e52\",\"dweb:/ipfs/QmPGvMZzKQvNiWKd8aRzzdW7oAizwrMgcMtnaworDkVHFC\"]},\"lib/v4-core/src/libraries/LiquidityMath.sol\":{\"keccak256\":\"0x4a04b9383e2fb943c2c3ae7d0c9071b58dd97b6dac0a409fe1c79c3ca897bbcf\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://0b33cf0ff936f62aa7f3b82922fa0ac52ac24471561e87fbf7ab8372607f6dfc\",\"dweb:/ipfs/Qmcr6omwzJjQPu6HQ8E9vFXaTgrtqfb2KbfxbuQavfUzFa\"]},\"lib/v4-core/src/libraries/Position.sol\":{\"keccak256\":\"0x0309a650890f1cd93e2b4b1e9a40032d5feb8c6a0ccc24be24373bfd7590ff80\",\"license\":\"BUSL-1.1\",\"urls\":[\"bzz-raw://63aae574b22048f1453da8f9142374e334683bb3a069c2312f73e6b857842bce\",\"dweb:/ipfs/QmcJZK3kU4jsWfJKBpRq2kaouutEDHcytgMX8ZaGeBsbgu\"]},\"lib/v4-core/src/libraries/SafeCast.sol\":{\"keccak256\":\"0xbccc4f8d5d467d162d7f0ab5a7f22bcccf05ae07577b9728c9e3030c63977e60\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://0003ea7a515ba709a3fdeaa19e7930c1f883b3b4fbdbf389d4f2f85b25eb72b4\",\"dweb:/ipfs/QmYs8uNcYRGuGUbeBfF27fhArNaQ5Y9iMCTMfgic5d39fM\"]},\"lib/v4-core/src/types/BalanceDelta.sol\":{\"keccak256\":\"0xa719c8fe51e0a9524280178f19f6851bcc3b3b60e73618f3d60905d35ae5569f\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://7436928dc9de35c6c7c5c636cb51adaf295cfd590da83b19a004ae33cbec9ef9\",\"dweb:/ipfs/QmRJ9yZkUpzk4433GX3LgVVL8jwpbSYSUwXcucKisf3v4H\"]},\"lib/v4-core/src/types/BeforeSwapDelta.sol\":{\"keccak256\":\"0x2a774312d91285313d569da1a718c909655da5432310417692097a1d4dc83a78\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://a2c7a0379955cff9c17ab9e61f95e42909aa5947c22740f86ce940d09856f782\",\"dweb:/ipfs/QmaAuo8UBYXsGrVuKh8iRoAAdqwtg1jDq515cW1ZRP5m9K\"]},\"lib/v4-core/src/types/Currency.sol\":{\"keccak256\":\"0xc77e2d4d380be1887078b1d21e2381fe4e9138dce8c7efbf9050aa7d65d75d4c\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://b85a1edba4be624be660d69badac1e3641d83190893839fa30260eef316d00c8\",\"dweb:/ipfs/QmPaEaeNkhy5F4X9dwzyDzVU3H67P5ZhpeijDS7wscaSd9\"]},\"lib/v4-core/src/types/PoolId.sol\":{\"keccak256\":\"0x6946552d4f78712c769df47a9187aa0add8737bb6d06ef04b63a33a3c0ff59f8\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://637851aaa9e06ff59b517e6da17dad3476968c0bc62e141158f76526a8f9c79f\",\"dweb:/ipfs/QmVUxPCRCBE23XQdCrroeUuFqNTtq2LvJaDYmp43QGNsMB\"]},\"lib/v4-core/src/types/PoolKey.sol\":{\"keccak256\":\"0x10a2ff74d87d105f52c6c10f0c6ea0548c12a75dfb979abab8a8b7d647305162\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://a0680665f799067c0f0238e864e363c265ff23188dfe6ae1c4738f7d0a281ccf\",\"dweb:/ipfs/QmRCkZhaPknrV9cHkUiU3HVyMYYT3UaD8RfptHi4qB62zY\"]},\"src/Fetcher.sol\":{\"keccak256\":\"0x9394c00e4d95e21d5fc6dcb65e241dcf047b75bae83427853a33bf6011fb262a\",\"urls\":[\"bzz-raw://4fe8afa784a6ed6ad10ddefaa083d25e01fc78650218d2884bf789af69ce24f2\",\"dweb:/ipfs/Qmbt1v3zZMzKBhZJG42jpov59SxZjfaB9PwzwPMScEz5Yw\"]}},\"version\":1}","metadata":{"compiler":{"version":"0.8.26+commit.8a97fa7a"},"language":"Solidity","output":{"abi":[{"inputs":[],"stateMutability":"view","type":"function","name":"POOLS_SLOT","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}]},{"inputs":[],"stateMutability":"view","type":"function","name":"TICKS_OFFSET","outputs":[{"internalType":"uint256","name":"","type":"uint256"}]},{"inputs":[{"internalType":"contract IPoolManager","name":"manager","type":"address"},{"internalType":"PoolId","name":"poolId","type":"bytes32"}],"stateMutability":"view","type":"function","name":"getSlot0","outputs":[{"internalType":"uint160","name":"sqrtPriceX96","type":"uint160"},{"internalType":"int24","name":"tick","type":"int24"},{"internalType":"uint24","name":"protocolFee","type":"uint24"},{"internalType":"uint24","name":"lpFee","type":"uint24"}]},{"inputs":[{"internalType":"contract IPoolManager","name":"manager","type":"address"},{"internalType":"PoolId","name":"poolId","type":"bytes32"},{"internalType":"int24","name":"tick","type":"int24"}],"stateMutability":"view","type":"function","name":"getTickInfo","outputs":[{"internalType":"uint128","name":"liquidityGross","type":"uint128"},{"internalType":"int128","name":"liquidityNet","type":"int128"},{"internalType":"uint256","name":"feeGrowthOutside0X128","type":"uint256"},{"internalType":"uint256","name":"feeGrowthOutside1X128","type":"uint256"}]},{"inputs":[{"internalType":"struct PoolKey","name":"poolKey","type":"tuple","components":[{"internalType":"Currency","name":"currency0","type":"address"},{"internalType":"Currency","name":"currency1","type":"address"},{"internalType":"uint24","name":"fee","type":"uint24"},{"internalType":"int24","name":"tickSpacing","type":"int24"},{"internalType":"contract IHooks","name":"hooks","type":"address"}]}],"stateMutability":"pure","type":"function","name":"toId","outputs":[{"internalType":"PoolId","name":"poolId","type":"bytes32"}]}],"devdoc":{"kind":"dev","methods":{},"version":1},"userdoc":{"kind":"user","methods":{},"version":1}},"settings":{"remappings":["@ensdomains/=lib/v4-core/node_modules/@ensdomains/","@openzeppelin/=lib/v4-core/lib/openzeppelin-contracts/","@openzeppelin/contracts/=lib/v4-core/lib/openzeppelin-contracts/contracts/","ds-test/=lib/solmate/lib/ds-test/src/","erc4626-tests/=lib/v4-core/lib/openzeppelin-contracts/lib/erc4626-tests/","forge-gas-snapshot/=lib/v4-core/lib/forge-gas-snapshot/src/","forge-std/=lib/forge-std/src/","hardhat/=lib/v4-core/node_modules/hardhat/","openzeppelin-contracts/=lib/v4-core/lib/openzeppelin-contracts/","solmate/=lib/solmate/src/","v4-core/=lib/v4-core/src/"],"optimizer":{"enabled":true,"runs":200},"metadata":{"bytecodeHash":"ipfs"},"compilationTarget":{"src/Fetcher.sol":"Fetcher"},"evmVersion":"paris","libraries":{}},"sources":{"lib/v4-core/src/interfaces/IExtsload.sol":{"keccak256":"0x80b53ca4907d6f0088c3b931f2b72cad1dc4615a95094d96bd0fb8dff8d5ba43","urls":["bzz-raw://375c69148622aab7a3537d5fd37d373a8e9731022c8d87bdaee46233b0a99fe1","dweb:/ipfs/QmXFjdoYRxsA5B1kyuxEXgNf3FBoL1zPvy26Qy8EtpdFRN"],"license":"MIT"},"lib/v4-core/src/interfaces/IExttload.sol":{"keccak256":"0xc6b68283ebd8d1c789df536756726eed51c589134bb20821b236a0d22a135937","urls":["bzz-raw://294394f72dfc219689209f4130d85601dfd0d63c8d47578050d312db70f9b6c8","dweb:/ipfs/QmTDMQ3oxCGHgEBU48a3Lp4S1rRjc8vVCxkhE5ZNej1bsY"],"license":"MIT"},"lib/v4-core/src/interfaces/IHooks.sol":{"keccak256":"0xdbaf1db938b70f77eb4ddbad5b8d2a1fc648c7d65ca2a312aba16cc013c85df0","urls":["bzz-raw://4ad2d9c85116a2e51281dd40577c798d6d5968be1f8908f43ba152849809deaa","dweb:/ipfs/QmZP4kk9KJzoxv81EgsTfHnJeU8YUxX3yWZudJHbxQjpa8"],"license":"MIT"},"lib/v4-core/src/interfaces/IPoolManager.sol":{"keccak256":"0x4e07d93993f6ba033c8b5e5b0a3473659aeffe9af0cf8316a879a55ebd696d7a","urls":["bzz-raw://50add8378d59b89b1dc106ea248641caaedd3ac45d62754babe55c526b87c9ad","dweb:/ipfs/QmQUrvy8ZDDdTRTr17msqynVECP3rQFBVBUmFcpFvjAmQx"],"license":"MIT"},"lib/v4-core/src/interfaces/IProtocolFeeController.sol":{"keccak256":"0xc2d7f3605da9767e36cf25d4d4fa9b95663a6659e26ce28cf29b8b88acb79a4c","urls":["bzz-raw://c7a43cda35b8a9254ed3e46cfd8649361f09121d17ef554bd3d190b9a8d57cc6","dweb:/ipfs/QmRBDQoqCWddH5hY1JdxMyYtY8jMZhWAwtuFJBc3r8V31G"],"license":"MIT"},"lib/v4-core/src/interfaces/IProtocolFees.sol":{"keccak256":"0x68700020df618c5715737e57630876ec22ccde2d31191a5608babb9f140ed297","urls":["bzz-raw://56b7bb6786f48fff8c9d04e9054955b8cf3d9f5bf819ccda7be192ad2004a27f","dweb:/ipfs/QmZKmUvcYnyihEFySD6SY9osMkP8M1Y7a4kPxLQycEyThw"],"license":"MIT"},"lib/v4-core/src/interfaces/external/IERC20Minimal.sol":{"keccak256":"0xc1c23330c1511ecfd45c67a683962b4e2555b82f1dacd40cc8b46ae5a6e250e7","urls":["bzz-raw://5ce10b7970482a65f9e9a365b810eeb154a5d4a8229a26653028d84b9622a410","dweb:/ipfs/QmTSwXxZ2FTkM5duBZgbpFs8SRVDR5NPAnW4YimeDhb1s8"],"license":"GPL-2.0-or-later"},"lib/v4-core/src/interfaces/external/IERC6909Claims.sol":{"keccak256":"0xa586f345739e52b0488a0fe40b6e375cce67fdd25758408b0efcb5133ad96a48","urls":["bzz-raw://e8c557b7e52abdbbd82e415a1acc27921446a7fd090b7d4877e52be72619547f","dweb:/ipfs/QmXE2KNPbXmGX8BQF3ei6zhzRTnhoTQg39XmqMnkhbr6QK"],"license":"MIT"},"lib/v4-core/src/libraries/CustomRevert.sol":{"keccak256":"0x70a444afeb27564398dbdf7553651ee2cae14c03c923b6f8972040c8f460ebe3","urls":["bzz-raw://9d7b05390bac9b29188725c8a84edac43cd05571da27b33a0b1e36d9500ecaa6","dweb:/ipfs/QmdYDLwTfFgePDEwFMUqGTj8SNNXXq4JQJnrgomJgcZFvP"],"license":"MIT"},"lib/v4-core/src/libraries/FixedPoint128.sol":{"keccak256":"0xc7e80dc41f28887d0d915a75c0b2783ae659e5384dd1a3ed1251a42e058d8835","urls":["bzz-raw://2df62bf1d9d4349236fd0bc7a96b3a3be95f4c049603e4a20c8473cca9402b4d","dweb:/ipfs/QmVR5dmMkoypmhaBeBj8cGegHpJycbofUDg59dHm42i9MT"],"license":"GPL-2.0-or-later"},"lib/v4-core/src/libraries/FullMath.sol":{"keccak256":"0x4fc73a00817193fd3cac1cc03d8167d21af97d75f1815a070ee31a90c702b4c2","urls":["bzz-raw://c3b2d66d36b1ad56b1ab6e2eb8a816740877b40b461c93f125e88621c8378e52","dweb:/ipfs/QmPGvMZzKQvNiWKd8aRzzdW7oAizwrMgcMtnaworDkVHFC"],"license":"MIT"},"lib/v4-core/src/libraries/LiquidityMath.sol":{"keccak256":"0x4a04b9383e2fb943c2c3ae7d0c9071b58dd97b6dac0a409fe1c79c3ca897bbcf","urls":["bzz-raw://0b33cf0ff936f62aa7f3b82922fa0ac52ac24471561e87fbf7ab8372607f6dfc","dweb:/ipfs/Qmcr6omwzJjQPu6HQ8E9vFXaTgrtqfb2KbfxbuQavfUzFa"],"license":"GPL-2.0-or-later"},"lib/v4-core/src/libraries/Position.sol":{"keccak256":"0x0309a650890f1cd93e2b4b1e9a40032d5feb8c6a0ccc24be24373bfd7590ff80","urls":["bzz-raw://63aae574b22048f1453da8f9142374e334683bb3a069c2312f73e6b857842bce","dweb:/ipfs/QmcJZK3kU4jsWfJKBpRq2kaouutEDHcytgMX8ZaGeBsbgu"],"license":"BUSL-1.1"},"lib/v4-core/src/libraries/SafeCast.sol":{"keccak256":"0xbccc4f8d5d467d162d7f0ab5a7f22bcccf05ae07577b9728c9e3030c63977e60","urls":["bzz-raw://0003ea7a515ba709a3fdeaa19e7930c1f883b3b4fbdbf389d4f2f85b25eb72b4","dweb:/ipfs/QmYs8uNcYRGuGUbeBfF27fhArNaQ5Y9iMCTMfgic5d39fM"],"license":"GPL-2.0-or-later"},"lib/v4-core/src/types/BalanceDelta.sol":{"keccak256":"0xa719c8fe51e0a9524280178f19f6851bcc3b3b60e73618f3d60905d35ae5569f","urls":["bzz-raw://7436928dc9de35c6c7c5c636cb51adaf295cfd590da83b19a004ae33cbec9ef9","dweb:/ipfs/QmRJ9yZkUpzk4433GX3LgVVL8jwpbSYSUwXcucKisf3v4H"],"license":"MIT"},"lib/v4-core/src/types/BeforeSwapDelta.sol":{"keccak256":"0x2a774312d91285313d569da1a718c909655da5432310417692097a1d4dc83a78","urls":["bzz-raw://a2c7a0379955cff9c17ab9e61f95e42909aa5947c22740f86ce940d09856f782","dweb:/ipfs/QmaAuo8UBYXsGrVuKh8iRoAAdqwtg1jDq515cW1ZRP5m9K"],"license":"MIT"},"lib/v4-core/src/types/Currency.sol":{"keccak256":"0xc77e2d4d380be1887078b1d21e2381fe4e9138dce8c7efbf9050aa7d65d75d4c","urls":["bzz-raw://b85a1edba4be624be660d69badac1e3641d83190893839fa30260eef316d00c8","dweb:/ipfs/QmPaEaeNkhy5F4X9dwzyDzVU3H67P5ZhpeijDS7wscaSd9"],"license":"MIT"},"lib/v4-core/src/types/PoolId.sol":{"keccak256":"0x6946552d4f78712c769df47a9187aa0add8737bb6d06ef04b63a33a3c0ff59f8","urls":["bzz-raw://637851aaa9e06ff59b517e6da17dad3476968c0bc62e141158f76526a8f9c79f","dweb:/ipfs/QmVUxPCRCBE23XQdCrroeUuFqNTtq2LvJaDYmp43QGNsMB"],"license":"MIT"},"lib/v4-core/src/types/PoolKey.sol":{"keccak256":"0x10a2ff74d87d105f52c6c10f0c6ea0548c12a75dfb979abab8a8b7d647305162","urls":["bzz-raw://a0680665f799067c0f0238e864e363c265ff23188dfe6ae1c4738f7d0a281ccf","dweb:/ipfs/QmRCkZhaPknrV9cHkUiU3HVyMYYT3UaD8RfptHi4qB62zY"],"license":"MIT"},"src/Fetcher.sol":{"keccak256":"0x9394c00e4d95e21d5fc6dcb65e241dcf047b75bae83427853a33bf6011fb262a","urls":["bzz-raw://4fe8afa784a6ed6ad10ddefaa083d25e01fc78650218d2884bf789af69ce24f2","dweb:/ipfs/Qmbt1v3zZMzKBhZJG42jpov59SxZjfaB9PwzwPMScEz5Yw"],"license":null}},"version":1},"id":19} \ No newline at end of file diff --git a/src/lib.rs b/src/lib.rs index f122217..fb69ed3 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -54,16 +54,6 @@ pub type AnvilProvider = FillProvider< >; mod types { - pub mod fetcher { - use alloy_sol_macro::sol; - sol! { - #[sol(rpc)] - #[derive(Debug)] - Fetcher, - "src/artifacts/Fetcher.json" - } - } - pub mod controller { use alloy_sol_macro::sol; sol! {