Inspiration

This project has an interesting backstory: it is exactly what I needed to save my previous startup. But let's go back in time: I was just done raising a small pre seed round from bitcoin angel investors. Denominated in Bitcoin, ofc (numbers go up, right?). Well, bitcoin dropped 50%. I remember postponing the management of the treasury. So now We built what I needed 6 months ago: a self-rebalancing non custodial wallet, that takes care of your personal portfolio or company treasury (to financially shield your stash from Bitcoin's volatility).

What it does

This wallet hides all the complexities of managing your portfolio behind a nice UX/UI. The user chooses the portfolio split (eg 70/30 LUSDT - LBTC), the rebalancing frequency (daily, weekly,...) and then you're good to go. Enjoy the rebalancing without filling all the orders and calculating the percentages manually. So you can actually focus about building stuff instead of day trading the company's treasury :).

How we built it (check "project media" for the diagram)

Let's break down SimplySave in its three components:

1) The Client This is the actual wallet that the user uses. The client has the essential function of compiling the smart contract, to check that it will perform the rebalance that its actually claiming to do. The client has also the power of taking out the funds invested at any time and to check the current balance of the assets.

2) The Server Think of the server as a "dumb orchestrator". The server's key is authorized by the smart contract to only perform rebalancing transactions. The smart contract's strict limits ensure this.

3) The Dex Building a dex that could accomodate the exotic conditions set by the contract was the real engineering challenge. Inputs and outputs of the rebalancing transactions must follow a determined flow, to not mess with the smart contract safety policies.

Challenges we ran into

Building stuff at the bleeding edge of Simplicity comes with a heavy price: no documentation, no infrastructure and no cryptography to make the blinded assets work with a smart contract. On top of that we had to make custom wasm bindings to make the nice UI work.

Accomplishments that we're proud of

We managed to overcome all the challenges we faced:

1) The blinded assets problem was avoided by using unblinded assets (at least for the mvp)

2) The wasm bindings for LWK were built from scratch

3) The dex (spoke about it in the what it does section)

What we learned

Elements and simplicity are really cool, and can allow for really complex spending schemes. We also learnt how to build transactions with inputs (external UTXOs) coming from different wallets, for the dex.

What's next for SimplySave

  • Finishing the last touches and making it production ready
  • Making an SDK to make it easy for liquid based wallets to integrate it
  • Liquidity partner for the dex part
  • Rebalancing multi-asset portfolios (xaut/usdt/btc)
  • Server interacting with blinded assets and values

Built With

  • next.js
  • rust
  • simplicity
  • wasm
Share this project:

Updates