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

feat: arbitrage-agent #11

Merged
merged 16 commits into from
Oct 10, 2023
Merged

feat: arbitrage-agent #11

merged 16 commits into from
Oct 10, 2023

Conversation

Autoparallel
Copy link
Contributor

@Autoparallel Autoparallel commented Sep 19, 2023

Merge after #21

Aiming to close #1.

Currently:

  • Arbitrage math
  • Arbitrageur agent

journal/arbitrage_math.md Outdated Show resolved Hide resolved
journal/arbitrage_math.md Outdated Show resolved Hide resolved
journal/arbitrage_math.md Outdated Show resolved Hide resolved
journal/arbitrage_math.md Outdated Show resolved Hide resolved
journal/arbitrage_math.md Outdated Show resolved Hide resolved
@Autoparallel Autoparallel marked this pull request as ready for review September 20, 2023 20:18
function swap(address token, uint256 amount) external;
}

interface TokenLike {
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we inherent an erc standard here instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah we could replace TokenLike with ERC20 probably. @Alexangelj ?

box-contracts/src/AtomicArbitrage.sol Show resolved Hide resolved
box-simulation/src/agents/arbitrageur.rs Show resolved Hide resolved
Copy link
Contributor

@Alexangelj Alexangelj left a comment

Choose a reason for hiding this comment

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

I have a few comments:

  • I don't see any tests, could we have tests made when we have big functionality like this?
  • The agent is responsible for its own smart contract, executing logic against the smart contract, and hooking into the sim. These are all things I think my box-core can eventually be responsible for, but for now this works and it's simple
  • Really hate committing bindings

On the bindings, sort of unrelated to this pr and dont expect us to make this for this pr but an idea I just thought of:

  • builder pattern for a smart contract (i.e. exchange) in rust, where we have a method "add_function" and it will add the respective abi to the restultant smart contract object. Then we don't need the bindings all the time, we just explicitly define the abi for a method (could use alloy-core maybe for that), then add it via the builder pattern. We still get self.exchange.status() or whatever method without worrying about bindings.

@Autoparallel Autoparallel marked this pull request as draft September 27, 2023 16:31
@Autoparallel Autoparallel marked this pull request as ready for review October 4, 2023 19:13
@Autoparallel Autoparallel requested a review from 0xJepsen October 4, 2023 19:13
Copy link
Contributor

@0xJepsen 0xJepsen left a comment

Choose a reason for hiding this comment

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

I think we should merge this in and itterate

Copy link
Contributor

@Alexangelj Alexangelj left a comment

Choose a reason for hiding this comment

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

This looks like its branched off @clemlak 's branch, can we change the target to that branch or block this from being merged until that's in first?

@Autoparallel
Copy link
Contributor Author

@Alexangelj seems like Clement's branch got in and now this one is updated. Should be good to go.

@Alexangelj
Copy link
Contributor

Need review from @kinrezC

@kinrezC kinrezC merged commit 9e790d5 into main Oct 10, 2023
@kinrezC kinrezC deleted the colin/feat/arbitrage-agent branch October 10, 2023 15:19
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.

Arbitrageur Math + Agent
4 participants