Comments (7)
works on usdt, but not working on custom tokens
from uniswap-python.
works on v2, but not on v3
from uniswap-python.
How to fix this , getting this on v2
exception:-
Could not identify the intended function with name swapExactETHForTokens
, positional arguments with type(s) int,(address,address),int,int
and keyword arguments with type(s) {}
.
Found 1 function(s) with the name swapExactETHForTokens
: ['swapExactETHForTokens(uint256,address[],address,uint256)']
Function invocation failed due to no matching argument types.
from uniswap-python.
def swap(self,public_key,private_key,from_address,to_address,amount,slippage,chain):
slippage=int(slippage)
public_key=self.w3.to_checksum_address(public_key)
uniswap = Uniswap(address=public_key, private_key=private_key, version=2,web3=self.w3,default_slippage=slippage)
print("amount is",amount)
#a=uniswap.get_price_input(from_address,to_address,int(amount))
a=uniswap.make_trade(from_address,to_address,int(amount/2),public_key,fee=10000)
tx = uniswap.w3.eth.wait_for_transaction_receipt(a, timeout=5)
return tx
Could not identify the intended function with name swapExactETHForTokens
, positional arguments with type(s) int,(address,address),address,int
and keyword arguments with type(s) {}
.
Found 1 function(s) with the name swapExactETHForTokens
: ['swapExactETHForTokens(uint256,address[],address,uint256)']
from uniswap-python.
please respond
from uniswap-python.
was a slippage issue, fixed it
but now im getting this error when i swap from the token to eth
Traceback (most recent call last):
File "f:\a.nithesh_clients\rff\volume\test.py", line 66, in
a=uniswap.make_trade(wasfb,ETH_ADDRESS,(int(token_balance)))
File "C:\Users\anith\AppData\Roaming\Python\Python310\site-packages\uniswap\decorators.py", line 38, in approved
return method(self, *args, **kwargs)
File "C:\Users\anith\AppData\Roaming\Python\Python310\site-packages\uniswap\uniswap.py", line 472, in make_trade
return self._token_to_eth_swap_input(
File "C:\Users\anith\AppData\Roaming\Python\Python310\site-packages\uniswap\uniswap.py", line 644, in _token_to_eth_swap_input
return self._build_and_send_tx(
File "C:\Users\anith\AppData\Roaming\Python\Python310\site-packages\uniswap\uniswap.py", line 1443, in _build_and_send_tx
transaction = function.build_transaction(tx_params)
File "C:\Users\anith\AppData\Roaming\Python\Python310\site-packages\web3\contract\contract.py", line 332, in build_transaction
return build_transaction_for_function(
File "C:\Users\anith\AppData\Roaming\Python\Python310\site-packages\web3\contract\utils.py", line 232, in build_transaction_for_function
prepared_transaction = fill_transaction_defaults(w3, prepared_transaction)
File "cytoolz\functoolz.pyx", line 249, in cytoolz.functoolz.curry.call
File "C:\Users\anith\AppData\Roaming\Python\Python310\site-packages\web3_utils\transactions.py", line 132, in fill_transaction_defaults
default_val = default_getter(w3, transaction)
File "C:\Users\anith\AppData\Roaming\Python\Python310\site-packages\web3_utils\transactions.py", line 72, in
"gas": lambda w3, tx: w3.eth.estimate_gas(tx),
File "C:\Users\anith\AppData\Roaming\Python\Python310\site-packages\web3\eth\eth.py", line 293, in estimate_gas
return self._estimate_gas(transaction, block_identifier)
File "C:\Users\anith\AppData\Roaming\Python\Python310\site-packages\web3\module.py", line 68, in caller
result = w3.manager.request_blocking(
File "C:\Users\anith\AppData\Roaming\Python\Python310\site-packages\web3\manager.py", line 232, in request_blocking
return self.formatted_response(
File "C:\Users\anith\AppData\Roaming\Python\Python310\site-packages\web3\manager.py", line 197, in formatted_response
apply_error_formatters(error_formatters, response)
File "C:\Users\anith\AppData\Roaming\Python\Python310\site-packages\web3\manager.py", line 72, in apply_error_formatters
formatted_resp = pipe(response, error_formatters)
File "cytoolz\functoolz.pyx", line 666, in cytoolz.functoolz.pipe
File "cytoolz\functoolz.pyx", line 641, in cytoolz.functoolz.c_pipe
File "C:\Users\anith\AppData\Roaming\Python\Python310\site-packages\web3_utils\contract_error_handling.py", line 131, in raise_contract_logic_error_on_revert
raise ContractLogicError(message, data=data)
web3.exceptions.ContractLogicError: execution reverted: UniswapV2: K
from uniswap-python.
fixed it with set fee to true
from uniswap-python.
Related Issues (20)
- Uniswap v4 support HOT 6
- Slippage limit does not seem to hold, or price impact is incorrect HOT 4
- uni的py库好像不支持avax HOT 1
- execution reverted on Sepolia HOT 2
- domain uniswap-python.com is not resolving HOT 4
- "execution reverted: Insufficient WETH9" on Polygon HOT 4
- Could not transact with/call contract function, is contract deployed correctly and chain synced? HOT 2
- execution reverted by new coin (even after liquidity added) HOT 2
- Exception has occurred: TypeError swapped quantity must be an integer HOT 1
- How can i get history statistic? HOT 3
- about historical data; HOT 1
- uniswap.make_trade_output() - Arguments Type HOT 1
- web3.exceptions.ContractLogicError: execution reverted: Unexpected error uniswapv3 EUROC USDC pair HOT 8
- More helpful error messages for `ContractLogicError: execution reverted`
- Getting price based on pool?
- How to fetch or calculate price of an asset? HOT 4
- Fails when swapping USDT=>WBNB HOT 1
- eth_sendTransaction does not exist/is not available after calling mint_liquidity method.
- How to use with the Base chain? HOT 11
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from uniswap-python.