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

Autopilot to pass custom memo in the forwarding IBC packet #1170

Open
arlai-mk opened this issue Mar 30, 2024 · 0 comments
Open

Autopilot to pass custom memo in the forwarding IBC packet #1170

arlai-mk opened this issue Mar 30, 2024 · 0 comments

Comments

@arlai-mk
Copy link

arlai-mk commented Mar 30, 2024

Background

When we use autopilot's "ibc_receiver" prop in stakeibc's LiquidStake action (so that the newly minted stAsset can be forwarded to another IBC chain), a static memo is passed in the resulting MsgTransfer message: "autopilot-liquid-stake-and-forward"
https://github.com/Stride-Labs/stride/blob/v21.0.0/x/autopilot/keeper/liquidstake.go#L138

Chains like Osmosis have IBC hooks that would allow automated swap (for instance, stATOM to ATOM), and they require a specially crafted memo within the IBC packet.
If we wanted to automate swapping after liquid staking, we would need to be able to craft a memo that would be passed to the next hop (a bit like the "next" field of the packet-forward-middleware).

This would be very useful, especially if combined with LSMLiquidStake in Autopilot as described here: #1169.
It would unlock the ability to immediately redeem staked ATOM into ATOM on the Cosmos Hub in two transactions:

  • TX # 1: Tokenize Shares from already staked ATOM
  • TX # 2:
  1. IBC to Stride with the action LSMLiquidStake, IBC receiver on Osmosis, custom IBC memo
  2. Stride automatically mints stATOM
  3. Stride automatically sends it to Osmosis, with the custom memo to convert to ATOM
  4. Osmosis automatically swaps stATOM for ATOM (query from the custom memo)
  5. Osmosis automatically sends ATOM to Cosmos Hub

Suggested Design

I would like to suggest:

Acceptance Criteria

This should be pretty straightforward, but if you agree that this could be a nice-to-have feature, please let me know and I'll create a PR for it.

Thank you.

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

No branches or pull requests

1 participant