Git Product home page Git Product logo

degenbot's People

Contributors

alehpineda avatar bowtieddevil avatar gnewby avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

degenbot's Issues

Deadlock

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

Extract WETH error in the bot executor contract

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.