Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Various DeFi scripts and examples

NotificationsYou must be signed in to change notification settings

0xMaka/w3py

Repository files navigation

The previous repository structure can be foundhere



Hi! Originally this repo started as a bunch ofscripts and examples, written for users while handling support queries as a contributor at Sushiswap. However the repository had grown to encompass many more protocols and areas of defi, as well as outgrowing its initial lack of structure.

To make it easier to find things that might be useful, as well to know which related scripts are worth skimming through. I have attempted to better organise into folders, adding an index with short descriptions.

Always love to hear which examples can been useful, and am often happy to take requests if you might be struggling with something.Can find me in the ethereum python discord with any questions.All the best on your journey. - Maka


folderscriptdescription
> aaveAave lending protocol
v3_supply_and_withdraw.pyApprove, supply and withdraw from a v3 aave pool.
> beraswapBerachain DEX
bera_swap.pySwap usingbatchSwap with theirERC20_DEX.
> flashbotsCall structures and direct calls to flashbots endpoints.
eth_send_bundle.pyBuilding and sending a classic bundle.
eth_send_private.pyUsing Flashbots endpoint to send a private transaction.
mev_send_bundle.pyBuilding and sending a MevShare bundle.
> generalOverrides, bloom filters, log topics and wider EVM
bloom_filter.pyFiltering thelogsBloom for more efficient searches.
multi2.pyUsing a popular mulicall contract, to batch static requests.
swap_topic.pyHow to encode and pull anEvent topic.
transfer_override.pyOverriding an accounts ERC20 balance, prior to aneth_call.
> raw_callsContract calls sending raw calldata
raw_approval.pySend a token approval using pre prepared calldata.
raw_deploy.pyDeploy a contract using pre prepared calldata.
raw_deposit.pyDeposit ETH to receive WETH using pre prepared calldata.
raw_transfer.pyMake an ERC20 transfer using pre prepared calldata.
> scrapbotsBasic bot flow
skym_bot/Monitor a v2 pair for imbalance, skim with contract if so.
flash_bot.pyA basic flashbot script, using flashbots py library.
voly.pyPolls a v2 pair for price, buys or sells, tracks if holding.
> signingOffchain signing, permits, EIP712
pysign.pyDeprectated signing pattern.
setMasterContractApproval.pyBuilding and signing an EIP712 digest.
universal_permit2_extended.pyOffchain permit for Universal router (long way).
universal_permit2_abstract.pyOffchain permit for Universal router (short way).
> sushiswapSushi specific
exact_input.pyTrident single hop swap.
get_kava_farms.pyGet a list of all farms from a chef.
get_rewards.pyCalculating rewards from a Minichef.
graph_call.pyOutdated: Exchange subgraph call (Pre needing a key).
route_processor.mdNotes Sushi's router processor.
route_processor.pySingle hop swap using Sushi route processor.
route_processor_multi.pyMulti hop swap using Sushi route processor.
swap_volume_since_midnight.pyOutdated: Use a subgraph to get volume day data.
trident_help_sheet.mdNotes on Sushi Trident.
trident_multicall.pyTrident multi hop swap.
xSwap.pyExtensive cross chain swap, encoding, off chain signing etc.
> syncswapHow to swap on Syncwap DEX.
sync_swap.pyBasic Syncswap router interaction.
sync_swap_with_permit.pyBasic Syncswap router interaction using a permit.
> uniswapv2Examples for Uniswap v2 and clones
mempool_filter.pyIPC filter the tx pool for swaps and decode them.
scale4whale.pyGet an amount required to buy a tokens total supply.
v2path_encode.mdStep through of the ABI encoding.
> uniswapv3Examples for Uniswap v3 and clones
v3exactOutput.pyUniswap v3 swap, multihop.
v3exactOutputSingle.pyUniswap v3 swap, single hop.
v3quoter_iterations.pyUniswap v3 quoter discrepancies, example calls to each.
> uni_routerUniswaps Universal router
universal_router_swap.mdNotes on Uniswaps Universal Router.
universal_router_swap.pyWrap and swap from Eth using Universal router..
universal_swap_from_token.pySwap from token using Universal router (uses dual tx permit).
universal_v2_swap.pySwap on a v2 pool using Universal router (dual tx permit).
> zkAnything ZK specific
check_balance.pySimple balance check, using the sdk.
transfer.pySimple eth transfer, using the sdk.

[8]ページ先頭

©2009-2025 Movatter.jp