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

Biconomy integration #277

Merged
merged 27 commits into from
Jul 2, 2024
Merged

Biconomy integration #277

merged 27 commits into from
Jul 2, 2024

Conversation

nerfZael
Copy link
Contributor

No description provided.

@nerfZael nerfZael requested review from dOrgJelli and cbrzn June 24, 2024 19:10
Copy link
Contributor

@dOrgJelli dOrgJelli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Incredible!

@agentcoinorg agentcoinorg deleted a comment from github-actions bot Jun 27, 2024
@agentcoinorg agentcoinorg deleted a comment from github-actions bot Jun 27, 2024
@agentcoinorg agentcoinorg deleted a comment from github-actions bot Jun 28, 2024
@agentcoinorg agentcoinorg deleted a comment from github-actions bot Jun 28, 2024
@nerfZael nerfZael marked this pull request as ready for review June 28, 2024 00:46
@agentcoinorg agentcoinorg deleted a comment from github-actions bot Jun 28, 2024
@agentcoinorg agentcoinorg deleted a comment from github-actions bot Jun 28, 2024
@agentcoinorg agentcoinorg deleted a comment from github-actions bot Jun 28, 2024
@agentcoinorg agentcoinorg deleted a comment from github-actions bot Jun 28, 2024
@nerfZael
Copy link
Contributor Author

/workflows/benchmarks agents/token/send,agents/token/test_swap.py 3

@agentcoinorg agentcoinorg deleted a comment from github-actions bot Jun 28, 2024
Copy link

github-actions bot commented Jun 28, 2024

Finished benchmarks
Download artifacts

Test Run Summary

  • Run from: ./autotx/tests/agents/token/send,./autotx/tests/agents/token/test_swap.py
  • Base path: autotx/tests/agents/token/
  • Iterations: 3
  • Total Cost: $0.26
  • Total Success Rate (%): ${\color{red} \LARGE \texttt {97.22} \large \texttt { (97/-3)} }$

Detailed Results

Test Name Success Rate (%) Passes Fails Avg Time Avg Cost
send/test_send.py::test_send_erc20 ${\color{none} \large \texttt {100} \normalsize \texttt {} }$ ${\color{none} \large \texttt {3}}$ ${\color{none} \large \texttt {0}}$ 20s $0.00
send/test_send.py::test_send_erc20_parallel ${\color{none} \large \texttt {100} \normalsize \texttt {} }$ ${\color{none} \large \texttt {3}}$ ${\color{none} \large \texttt {0}}$ 23s $0.01
send/test_send.py::test_send_eth_multiple ${\color{none} \large \texttt {100} \normalsize \texttt {} }$ ${\color{none} \large \texttt {3}}$ ${\color{none} \large \texttt {0}}$ 30s $0.01
send/test_send.py::test_send_native ${\color{none} \large \texttt {100} \normalsize \texttt {} }$ ${\color{none} \large \texttt {3}}$ ${\color{none} \large \texttt {0}}$ 14s $0.00
send/test_send.py::test_send_native_sequential ${\color{none} \large \texttt {100} \normalsize \texttt {} }$ ${\color{none} \large \texttt {3}}$ ${\color{none} \large \texttt {0}}$ 18s $0.01
test_swap.py::test_swap_complex_1 ${\color{red} \large \texttt {67} \normalsize \texttt {(-33)} }$ ${\color{red} \large \texttt {2}}$ ${\color{red} \large \texttt {1}}$ 34s $0.01
test_swap.py::test_swap_complex_2 ${\color{none} \large \texttt {100} \normalsize \texttt {} }$ ${\color{none} \large \texttt {3}}$ ${\color{none} \large \texttt {0}}$ 34s $0.01
test_swap.py::test_swap_multiple_1 ${\color{none} \large \texttt {100} \normalsize \texttt {} }$ ${\color{none} \large \texttt {3}}$ ${\color{none} \large \texttt {0}}$ 33s $0.03
test_swap.py::test_swap_multiple_2 ${\color{none} \large \texttt {100} \normalsize \texttt {} }$ ${\color{none} \large \texttt {3}}$ ${\color{none} \large \texttt {0}}$ 27s $0.00
test_swap.py::test_swap_native ${\color{none} \large \texttt {100} \normalsize \texttt {} }$ ${\color{none} \large \texttt {3}}$ ${\color{none} \large \texttt {0}}$ 22s $0.00
test_swap.py::test_swap_triple ${\color{none} \large \texttt {100} \normalsize \texttt {} }$ ${\color{none} \large \texttt {3}}$ ${\color{none} \large \texttt {0}}$ 41s $0.00
test_swap.py::test_swap_with_non_default_token ${\color{none} \large \texttt {100} \normalsize \texttt {} }$ ${\color{none} \large \texttt {3}}$ ${\color{none} \large \texttt {0}}$ 26s $0.00

Total run time: 16.15 minutes

@nerfZael
Copy link
Contributor Author

/workflows/benchmarks agents/token/test_swap_and_send.py 3

Copy link

github-actions bot commented Jun 28, 2024

Finished benchmarks
Download artifacts

Test Run Summary

  • Run from: ./autotx/tests/agents/token/test_swap_and_send.py
  • Base path: autotx/tests/agents/token/test_swap_and_send.py::
  • Iterations: 3
  • Total Cost: $0.54
  • Total Success Rate (%): ${\color{red} \LARGE \texttt {66.67} \large \texttt { (67/-33)} }$

Detailed Results

Test Name Success Rate (%) Passes Fails Avg Time Avg Cost
test_send_and_swap_complex ${\color{red} \large \texttt {0} \normalsize \texttt {(-100)} }$ ${\color{red} \large \texttt {0}}$ ${\color{red} \large \texttt {3}}$ 59s $0.10
test_send_and_swap_simple ${\color{red} \large \texttt {67} \normalsize \texttt {(-33)} }$ ${\color{red} \large \texttt {2}}$ ${\color{red} \large \texttt {1}}$ 39s $0.05
test_swap_and_send_complex ${\color{none} \large \texttt {100} \normalsize \texttt {} }$ ${\color{none} \large \texttt {3}}$ ${\color{none} \large \texttt {0}}$ 42s $0.02
test_swap_and_send_simple ${\color{none} \large \texttt {100} \normalsize \texttt {} }$ ${\color{none} \large \texttt {3}}$ ${\color{none} \large \texttt {0}}$ 29s $0.01

Total run time: 8.44 minutes

@nerfZael
Copy link
Contributor Author

/workflows/benchmarks agents/token/research 3

@agentcoinorg agentcoinorg deleted a comment from github-actions bot Jun 28, 2024
Copy link

github-actions bot commented Jun 28, 2024

Finished benchmarks
Download artifacts

Test Run Summary

  • Run from: ./autotx/tests/agents/token/research
  • Base path: autotx/tests/agents/token/research/test_
  • Iterations: 3
  • Total Cost: $7.45
  • Total Success Rate (%): ${\color{red} \LARGE \texttt {69.44} \large \texttt { (69/-21)} }$

Detailed Results

Test Name Success Rate (%) Passes Fails Avg Time Avg Cost
advanced.py::test_research_and_swap_many_tokens_subjective_complex ${\color{red} \large \texttt {0} \normalsize \texttt {(-10)} }$ ${\color{red} \large \texttt {0}}$ ${\color{red} \large \texttt {3}}$ 8.39m $0.00
advanced.py::test_research_and_swap_many_tokens_subjective_simple ${\color{red} \large \texttt {33} \normalsize \texttt {(-57)} }$ ${\color{red} \large \texttt {1}}$ ${\color{red} \large \texttt {2}}$ 1.20m $0.42
research.py::test_get_top_5_memecoins ${\color{lightgreen} \large \texttt {100} \normalsize \texttt {(+10)} }$ ${\color{lightgreen} \large \texttt {3}}$ ${\color{lightgreen} \large \texttt {0}}$ 38s $0.28
research.py::test_get_top_5_memecoins_in_optimism ${\color{none} \large \texttt {100} \normalsize \texttt {} }$ ${\color{none} \large \texttt {3}}$ ${\color{none} \large \texttt {0}}$ 36s $0.21
research.py::test_get_top_5_most_traded_tokens_from_l1 ${\color{none} \large \texttt {100} \normalsize \texttt {} }$ ${\color{none} \large \texttt {3}}$ ${\color{none} \large \texttt {0}}$ 46s $0.21
research.py::test_get_top_5_tokens_from_base ${\color{none} \large \texttt {100} \normalsize \texttt {} }$ ${\color{none} \large \texttt {3}}$ ${\color{none} \large \texttt {0}}$ 32s $0.18
research.py::test_price_change_information ${\color{none} \large \texttt {100} \normalsize \texttt {} }$ ${\color{none} \large \texttt {3}}$ ${\color{none} \large \texttt {0}}$ 19s $0.03
research_and_swap.py::test_research_and_buy_multiple ${\color{none} \large \texttt {100} \normalsize \texttt {} }$ ${\color{none} \large \texttt {3}}$ ${\color{none} \large \texttt {0}}$ 1.29m $0.43
research_and_swap.py::test_research_and_buy_one ${\color{none} \large \texttt {100} \normalsize \texttt {} }$ ${\color{none} \large \texttt {3}}$ ${\color{none} \large \texttt {0}}$ 32s $0.13
research_swap_and_send.py::test_research_buy_multiple_send_multiple ${\color{red} \large \texttt {0} \normalsize \texttt {(-100)} }$ ${\color{red} \large \texttt {0}}$ ${\color{red} \large \texttt {3}}$ 1.14m $0.24
research_swap_and_send.py::test_research_buy_one_send_multiple ${\color{none} \large \texttt {100} \normalsize \texttt {} }$ ${\color{none} \large \texttt {3}}$ ${\color{none} \large \texttt {0}}$ 48s $0.18
research_swap_and_send.py::test_research_buy_one_send_one ${\color{red} \large \texttt {0} \normalsize \texttt {(-100)} }$ ${\color{red} \large \texttt {0}}$ ${\color{red} \large \texttt {3}}$ 41s $0.16

Total run time: 50.72 minutes

@agentcoinorg agentcoinorg deleted a comment from github-actions bot Jun 28, 2024
@nerfZael nerfZael merged commit d6e34d6 into dev Jul 2, 2024
1 check passed
@@ -41,5 +42,5 @@ def fetch_tokens_list() -> None:
f.write(content)


def run() -> None:
fetch_tokens_list()
async def run() -> None:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there any reason to make this async? this is expected to be run through the script poetry run load-token; I just tried it and got the error

autotx-py3.10cesar@dandy:~/dev/polywrap/auto-tx$ poetry run load-tokens
<coroutine object run at 0x7e0b30163d10>
sys:1: RuntimeWarning: coroutine 'run' was never awaited
RuntimeWarning: Enable tracemalloc to get the object allocation traceback

def on_intents_prepared(self, intents: list[Intent]) -> None:
pass

@abstractmethod
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: for abstract methods, I would recommend to raise an exception so if it is not implemented it will throw (even tho i think the build-check script will complain about this)

}));

app.post("/api/v1/account/transactions", handleError(async (req: Request, res: Response, next: NextFunction) => {
const chainId = parseInt(req.query.chainId as string);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: should we validate that chainId is indeed present in the query object?

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

Successfully merging this pull request may close these issues.

3 participants