You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+74-1Lines changed: 74 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -159,6 +159,51 @@ WBTC-WETH (V3, 0.30%)
159
159
}
160
160
```
161
161
162
+
## Uniswap V4 Liquidity Pools
163
+
Uniswap V4 introduces hooks and a new pool manager architecture. The `UniswapV4Pool` class provides access to V4 pools with support for the new features.
The `AnvilFork` class is used to launch a fork with `anvil` from the [Foundry](https://github.com/foundry-rs/foundry) toolkit. The object provides a `w3` attribute, connected to an IPC socket, which can be used to communicate with the fork like a typical RPC.
164
209
@@ -233,7 +278,8 @@ Users wanting fine-grained control over **all** client options may pass them thr
233
278
anvil_opts=['--optimism']
234
279
)
235
280
236
-
# Launch with a non-default hardfork, which may be necessary for accurate simulation on a historical block.
281
+
# Launch with a non-default hardfork, which may be necessary for accurate simulation on a
282
+
# historical block.
237
283
>>> fork = degenbot.AnvilFork(
238
284
fork_url='http://localhost:8545',
239
285
fork_block=12_980_000,
@@ -324,4 +370,31 @@ ArbitrageCalculationResult(
324
370
),
325
371
state_block=22676748
326
372
)
373
+
```
374
+
375
+
## Chainlink Price Feeds
376
+
Chainlink price feeds provide reliable oracle data for various assets. The `ChainlinkPriceContract` class simplifies access to these feeds.
377
+
378
+
```
379
+
# Load the price feed for ETH/USD
380
+
>>> price_feed = degenbot.ChainlinkPriceContract(
381
+
... '0x5f4eC3Df9cbd43714FE2740f5E3616155c5b8419'
382
+
... )
383
+
384
+
>>> price_feed.price
385
+
2836.68731709
386
+
387
+
# Check the decimals used by the price feed
388
+
>>> price_feed.decimals
389
+
8
390
+
391
+
# Call an arbitrary function `latestRoundData` on the underlying contract
0 commit comments