Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python-only onboarding fails at source_client.eth.transfer_token with ERC20: transfer amount exceeds balance #222

Open
drtruber opened this issue Dec 28, 2023 · 0 comments

Comments

@drtruber
Copy link

drtruber commented Dec 28, 2023

I'm trying to do onboarding and initial account funding using dydx-v3-python client only, without connecting external wallet (such as Metamask) to dydx website for initial deposit.

I'm stuck with the following snippet from integration_tests/test_integration.py:

    # Fund the new user with ETH and USDC.
    fund_eth_hash = source_client.eth.transfer_eth(
        to_address=ethereum_address,
        human_amount=0.001,
    )
    fund_usdc_hash = source_client.eth.transfer_token(
        to_address=ethereum_address,
        human_amount=2,
    )
    print('Waiting for funds...')
    source_client.eth.wait_for_tx(fund_eth_hash)
    source_client.eth.wait_for_tx(fund_usdc_hash)
    print('...done.')

First transaction succeeds, and the second (transfer_token) always fails with error: Fail with error 'ERC20: transfer amount exceeds balance'

Source ethereum address definitely has enough balance, and I tried to play with both amounts, but the second transaction always fails

Please advise what I'm doing incorrectly, or maybe there is an issue with the code, since test_integration.py was last updated more than 2 years ago

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant