Rainlang is a pioneering project that's creating a new programming language for DeFi. We're looking for experienced developers who share our passions and want to be part of the early team working on one of the most unique things in DeFi.
Rainlang is defi’s native language, it’s an onchain language, parsed and interpreted by smart contracts.
It’s compatible with any EVM and permissionlessly extensible.
Raindex is a standalone desktop app built with Tauri, that allows anyone to write, deploy and manage token trading strategies, written in Rainlang.
Founded by three Australians who are now based in the UK and Tbilisi. The team is spread across the world, from the US to India.
All of us are driven by building things we care about.
We are looking for experienced Rust/Typescript developers who want to help create the tooling and applications for a new programming language.
You must be:
Experienced in developing applications/tools used in production
Today we’re excited to share the first release of our open source desktop app for our Rainlang powered DEX protocol, imaginatively named Raindex.
Raindex allows anyone to write, deploy and manage perpetual token trading strategies, written in Rainlang, on any EVM network.
We’ve also created an extension to Rainlang, available only on the Flare network, that allows any strategy writer to use the Flare Time Series Oracles (FTSOs) directly within their strategies.
The culmination of three years of dedicated development, the Raindex app gives you the flexibility and power usually associated with CEX trading or running bots, whilst retaining the attributes we’re all here for - it’s trustless, permissionless and decentralised. It empowers users to craft and execute Rainlang strategies without intermediaries, blending the best of both worlds.
How does this look in practice?
Express what you want by writing a strategy in Rainlang
Deposit your tokens into vaults and deploy your order
Sit back and relax - fillers compete for your order flow
This is a totally new kind of DEX, where traders can move past "one size fits all" AMM curves and be given total freedom in how they express their trades. It’s also completely onchain, which means users don’t need to put their funds in someone else’s hands or put their hot wallet private keys in a bot connected to the internet.
This is a community launch, so for now the contracts are unaudited. Use at your own risk and as always, please DYOR.
Finally, the Raindex app - a fully self-hosted way to write Rainlang and interact with the protocol with no intermediaries
We see Rainlang and Raindex going far and wide, but it’s early days and therefore our first users are early adopters. For now, what does a Raindex user look like?
They aren’t afraid of a learning curve and enjoy taking responsibility for their onchain activities if it means more security and utility
They are inherently creative, and they’ll think of ideas for this that we haven’t
They want to run trading or market making strategies over time, but don’t want to run any infra or bots of their own
They value decentralisation and want to do all of the above trustlessly and non-custodially
They join us in Telegram to share experiences so we can all learn and improve Rain together
Rainlang is the native language of DeFi. If you can write an Excel formula, we think you can learn to write Rainlang.
Rainlang is:
Parsed & interpreted onchain (by a smart contract)
Permissionlessly extensible (add your own words to the language)
Immutable (none of the contracts are upgradable or have admin keys)
using-words-from flare-sub-parser /* ensure that the cooldown time has elapsed since the last trade */ :ensure( greater-than-or-equal-to( block-timestamp() int-add(get("last-traded") 43200) /* 12 hrs in seconds */ ) ), /* getting a quote from the Flare FTSO */ max-output: 100e18, price: ftso-current-price-pair(‘USD’ ‘WFLR’ 3600), :set("last-traded" block-timestamp());
The above Raindex order buys $100 worth of WFLR every 12 hours, at the current price returned by the Flare Time Series Oracle (FTSO). If you don’t think you could’ve written it yourself, at the very least you can probably understand it and maybe even tweak it to suit your purposes.
What other kinds of strategies can you run? Pretty much anything you can imagine… That said, we have a few ideas:
Other flavours of Dollar cost averaging (DCA):
Stop loss
Dutch orders
Portfolio rebalancing
Market making and liquidity management
Trend tracking trading strategies
Flare deployment and the Flare Time Series Oracles (FTSOs)
As you may have noticed in the example above, we’re using the Flare FTSOs to make sure our order is always offering the up-to-date market price for FLR. This is a subparser available only on Flare and an example of new words can be added to Rainlang, totally permissionlessly. We’ll be further extending this subparser with new words for EMAs, bringing even more power to those writing strategies with Raindex.
Why is this cool? Flare offers a unique trust model for the oracles on their network as the data availability and integrity is provided by the validators themselves. Raindex exposes these oracles directly to traders, without needing devs.
The Flare FTSO words are not only available in Raindex, but anywhere Rainlang is being used. Anybody building DeFi products with Rainlang can use these words.
Today we merged the standalone version of the interpreter which ships as a mere
interface from the perspective of the calling contract. New words added and
significant changes to Flow usage and security model.
I've been working on converting all the interpreter work into an interface that
can support standalone interpreter contracts. This will bring several benefits:
Upgradeability by using newer interpreters in old contracts
Smaller code size for contracts that use interpreters
Ability to provide more opcodes in the interpreter contract
Ability to support third party interpreters that match the interface
Let’s start with something basic. The first game currency we want to build has just a max supply. We could write that without even using the expression engine.
Josh has been working on a brainscan v0.0 where we we show an expression, written into a simple contract, in this case ERC20 emissions which is powered by the Rain interpreter.
The expression is written in Rain script, a spreadsheet like expression writer. A simulation runs real time to tell you the rules for the wallet connected to the site and the expression is deployable using the Deploy Emissions ERC20 button when ready.
One of the ongoing experiments we've been working on in our collective is a Rain-powered asset designer and marketplace. At the moment it's a "game designer" but in reality this could be applied to any kind of marketplace-as-gamified-economy.
Due to popular demand, I've recorded a demo of how you could use the Game Designer POC to quickly create a system of game assets, where the economy itself could be considered a game.
This week I spent some time on a general purpose struct that defines token movements. In the near future this struct and associated logic will replace the EmissionsERC20 contract.
This is all a leadup to "adminless upgrades" for interpreters (previously known as VMs) that I'll try to get working "soon".
In short, this is the crux of the flow code in Solidity from this week.