Skip to main content

· 21 min read
David Meister

Disclaimer: This post is about unaudited code under active development. Implementation details, names, security features, gas costs, etc. may change significantly.

Much of the recent work has been consolidation of the "VM" code to take it to where the Rain ecosystem needs it to be.

The v1.0 VM is everything you see in the latest audit.

The v1.0 system works fine as far as we know, there's no urgent need to stop using it if you are, but it is showing early signs of running into limits on several fronts.

This is just a blog post so here's only a high level summary, not comprehensive. Highly encourage you to checkout the latest branches in github and look around if you're interested.

· 20 min read
David Meister


  • Simple design to be understood by many people
  • Native support for historical tier logic
  • 1:N support for a single staking contract to have many different tier views on the same historical data
  • Non-interactive rewards, users should passively accrue value until they exit the system
  • Gas efficiency for both reads and writes
  • No admin keys required to manage or rescale rewards over time
  • Support third party tokens (but not necessarily "exotic" tokens, can be interactive)
  • Support "same token" rewards as "revenue share" style distributions

· 13 min read
David Meister


  • Mechanism by which users can trade tokens with each other
  • Optimised for long term distributions as well as general trading
  • Be very clear why this isn't just another curve based AMM
  • Works for ERC20 but has a clear path to NFT trading as a future upgrade

Current situation

We have a finite Sale contract where a sale can start, facilitating one-way buys where the seller defines a curve and a buyer accepts it. The sale ends and at this point is judged "success" or "fail". In the failure case all the purchases can be rolled back by buyers, in the success case all the proceeds are forwarded to the seller in a single transaction.