-
Notifications
You must be signed in to change notification settings - Fork 28
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
Astrovault swap adapter #141
Astrovault swap adapter #141
Conversation
let mut msgs = vec![transfer_funds_back_msg]; | ||
|
||
// ADDED: Also create the return of cashback funds msg if available | ||
if let Some(cashback_addr) = ASTROVAULT_CASHBACK_ADDRESS.may_load(deps.storage)? { |
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.
Question to learn: could we give this back to the user in some way? What is the purpose of sending it back to the cashback_addr here?
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.
We are sending it back to the router address so it does not get lost on the adapter contract.
If the user wallet address is available on the adapter we can send it to them, but I'm not seeing this info being sent by the entrypoint contract. Is there a way to get this info on the adapter during the execution of the swap?
We can also send it to the entrypoint contract but then we would need to add some code to the entrypoint contract also to handle the send of cashback to the user during the post-swap-validation.
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.
Yeah the entrypoint has access to such a user address, but heard that this would all require adding more logic and likely not worth it for now, thanks for the clarification!
) -> ContractResult<SimulateSmartSwapExactAssetInResponse> { | ||
let asset_out = simulate_smart_swap_exact_asset_in(deps, ask_denom, routes.clone())?; | ||
|
||
// TODO: Implement spot price calculation for smart swaps |
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 still seems like an open TODO, should be able to do a weighted calculation of the spot prices to get the total route spot price output, lmk if need any support here
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.
left a comment on the outstanding todo
…weighted spot price calc)
Added a commit to enable that left TODO. commit: 84b789c |
both of these checks are already validated in the entrypoint contract, removing to reduce gas
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.
fantastic, approving
This PR adds Astrovault swap venue (DEX) adapter to work with Skip.