Inspiration

We (used to) have to do the same tedious process every day:

  1. deposit staking rewards (e.g. REGEN)
  2. Swap half to other currency for equal pool share
  3. Join pool
  4. Bond LP tokens

What it does

First, we aimed for a fully auto-compounding smart contract, but soon figured it was not possible without Comsos' soon-to-come Interchain accounts.

So we opted to go as far as we could and implement a semi-automatic wizard seamlessly into the osmosis UI.

It offers two modes:

All-in

Take whatever you have of both curriencies, swap (if necessary) so that liquidity is balanced.

Select input

You select a certain amount of a specific currency, and it will swap half of it to create balanced liquidity (there's also a toggle that allows using available balance of the other currency to reduce or skip swap).

In both modes after establishing balanced liquidity, it will then automatically join pool & bond resulting LP tokens.

How we built it

I forked the osmosis-frontend repo and implemented it while trying to stay close to the existing codebase & building the UI in a way that looks & feels like Osmosis.

Then I tried mocking up UI and using existing osmosis functions to perform on-chain actions. When that resulted in a working PoC, I took the time to fully rework UX and flow to accomodate most Personas/Intentions I could think of, and to make the process as seamless as possible.

I also made sure relevant choices are persisted in LocalStorage so that the UX is even better

Challenges we ran into

As mentioned, we failed to implement our initial vision as it requires Cosmos' interchain accounts, which are not ready yet.

It also took some time to find my way around the osmosis codebase.

Accomplishments that we're proud of

Good UX and integration with Osmosis UI, good fault-tolerance & a quick semi-automated process. Smart IBC balances detection.

I loved the UX after redesigning & the going the last mile of saving relevant choices in LocalStorage took the seamless feeling of smart automation to another level.

I also added some improvements & utils to the Osmosis code, and feel confident to contribute outside of a hackathon context.

What we learned

  • Agoric & IBC is waaay harder than it sounds
  • the functionality we dream of is not there yet, but coming soon
  • adapting an existing project is fun

What's next for Osmosis auto-compound

  • Get PR merged into osmosis-frontend
  • When Interchain accounts are ready - go all the way!

How to try it out

  1. Open the deployed app link
  2. Connect your Keplr wallet
  3. Deposit some assets to osmosis via "assets" tab
  4. Open a pool's page
  5. Click the "Autobond" button on the top
+ 2 more
Share this project:

Updates