-
Notifications
You must be signed in to change notification settings - Fork 15
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: get_altcoin_quote endpoint #58
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code looks good to me, I don't see any reason it would fail. However, I think we need to be very careful because an issue with it could cause a lot of damage (if someone can generate signatures allowing him to buy domains for 0 STRK for example). Because we rely on the AVNU API, I would like if you could change the configuration to allow us to add some security margin. Instead of just having a token_support with generic data, I would like something like this:
[altcoins]
private_key = "123"
# Ethereum (ETH) is not enabled for the moment as it is already supported by default buy.
# [altcoins.ETH]
# address = "0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7"
# min_price = 1
# max_price = 1
# decimals = 18
# max_quote_validity = 3600 # in seconds for ETH
[altcoins.STRK]
address = "0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d"
min_price = 500
max_price = 5000
decimals = 18
max_quote_validity = 300 # it moves faster so we reduce the quote validity
[altcoins.USDC]
address = "0x053c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8"
min_price = 2000
max_price = 10000
decimals = 6 # not sure really
max_quote_validity = 600
[altcoins.USDT]
address = "0x068f5c6a61780768455de69077e07e89787839bf8166decfbf92b645209c0fb8"
min_price = 2000
max_price = 10000
decimals = 18
max_quote_validity = 600
Finally, could you please move the endpoints out of the avnu folder, because it is not really an avnu feature (we could use another source for pricing) and it is not the path chosen in the axum macro.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a question
Close #57