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

refactor: support multiple concurrent arb pairs & SQS API key #3

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

p0mvn
Copy link
Member

@p0mvn p0mvn commented Jul 5, 2024

  • add ability for running concurrent arb checks for multiple pais (see configuration in main.go)
  • add SQS API key via env var to avoid rate limiting

@p0mvn p0mvn requested a review from mattverse July 5, 2024 06:31
Copy link
Member

@mattverse mattverse left a comment

Choose a reason for hiding this comment

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

Nice! LGTM.

Only major question I had was on the sqs API Key, please feel free to merge whenever you feel comfortable

src/constants.go Outdated Show resolved Hide resolved
@@ -0,0 +1 @@
package osmosis
Copy link
Member

Choose a reason for hiding this comment

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

I'm assuming we will be using this in future PRs

@@ -59,7 +61,27 @@ type Pool struct {

func getOsmosisPriceAndRoute(tokenInDenom, tokenOutDenom string, tokenInAmount int64) (float64, []poolmanagertypes.SwapAmountInSplitRoute, error) {
url := fmt.Sprintf("%s?tokenIn=%d%s&tokenOutDenom=%s&humanDenoms=false", osmosisQuoteAPI, tokenInAmount, tokenInDenom, tokenOutDenom)
resp, err := http.Get(url)

// Define the headers
Copy link
Member

Choose a reason for hiding this comment

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

Can we make it so that we try to get the SQS OSMOSIS API KEY from env, if doesnt exist just to a get without the sqs api key? (for those who does not have access to sqs api key but still wants to use the arb bot)

@mattverse
Copy link
Member

@p0mvn I'll take on this PR and get it merged 👍

@p0mvn
Copy link
Member Author

p0mvn commented Jul 15, 2024

@p0mvn I'll take on this PR and get it merged 👍

Yes, please! Sorry, I haven't had the chance to come back to this yet

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.

2 participants