bowtieddevil / degenbot Goto Github PK
View Code? Open in Web Editor NEWPython classes to aid rapid development of Uniswap V2 & V3 and Curve V1 arbitrage bots on EVM-compatible blockchains
Home Page: https://www.degencode.com
License: MIT License
Python classes to aid rapid development of Uniswap V2 & V3 and Curve V1 arbitrage bots on EVM-compatible blockchains
Home Page: https://www.degencode.com
License: MIT License
As mentioned in twitter
Here is a Logger implementation that I use.
https://github.com/alehpineda/py_logger_demo
Use it as inspiration.
Includes a file timed rotation each midnight or a size file rotation as needed.
Just want to say thank you
No requirements.txt to install the relevant packages?
I tried to calculate the output amount, given an input amount for a specific pool via the function lp.calculate_tokens_out_from_tokens_in
the software remains deadlocked, how can I solve this?
`import web3
import degenbot
w3 = web3.Web3(web3.HTTPProvider("https://mainnet.infura.io/v3/xxxxx"))
degenbot.set_web3(w3)
lp=degenbot.V3LiquidityPool('0x3416cf6c708da44db2624d63ea0aaef7113527c6')
o=lp.calculate_tokens_out_from_tokens_in(token_in=lp.token1, token_in_quantity=1*10**18)
print(o)`
Thank you very much
Hi, awesome repo and i love your substack. Question tho, where are the contracts you use with the bot?
Dear sir,
I deployed a bot-executr contract on Arbitrum using your code. Currently, I want to extract the balance of the weth, however, I encountered this error.
ValueError: Execution reverted during call: 'execution reverted: WETH BALANCE REDUCTION'. This transaction will likely revert. If you wish to broadcast, include allow_revert:True
as a transaction parameter.
Here is the traction parameters:
tx_params = { "from": bot_account.address, # "from": executor_contract.address, "chainId": brownie.chain.id, "gas": TX_GAS_LIMIT, "nonce": bot_account.nonce, "maxPriorityFeePerGas":0, "value":0, }
Here is the payloads:
TX_GAS_LIMIT= 250_000_000
withdrawal_amount = int(0.2*10**18)
TOKEN_CONTRACT_ADDRESS = "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1" # WETH address
payload_signature = brownie.web3.keccak(text="transfer(address,uint256)")
payload_data = eth_abi.encode_abi(
["address", "uint256"],
[bot_account.address, withdrawal_amount])
payload = payload_signature[:4] + payload_data
# Get the hex value of the payload
payload_hex = '0x' + payload.hex()
# Submit the transaction, with the appropriate token to withdraw
tx = executor_contract.execute_payloads(
[(TOKEN_CONTRACT_ADDRESS, payload_hex, 0)],
tx_params
)`
I used brownie and connect the arb-chain network. I could not find the failure reason.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.