Solana before Phantom
Three weeks of moving onto Solana in the spring of 2021: a farm migration on Raydium, a wallet that had to be abandoned, one secret that opened three different addresses, and the constant-product formula behind my first liquidity position.
Over the past three weeks I have moved a small part of my crypto onto Solana. On Ethereum, the average transaction cost about $20 in February, with a peak of $38 on 23 February, and a swap uses several times the gas of an average transaction [1]. On Solana it costs a fraction of a cent. The catch is that almost everything here is weeks or months old, including the wallets, and I have spent more time learning how keys and addresses work than trading. Phantom, the wallet most people here are waiting for, is still invite-only. These are my notes from the spring the tools were still being built.
A migration on my first week
Most of what I do here happens on Raydium, an automated market maker that also places its liquidity on the order book of Serum, the exchange FTX helped build on Solana [2]. In late March, the first time I connected properly, Raydium was in the middle of a migration: the farms I had read about were now “legacy farms”, and every position had to be unstaked and moved to new pools, because Raydium was moving from version 2 of Serum’s order book to version 3 and from a wrapped version of USDT to the native one [3]. In my first week on a new chain, the protocol I was using was moving under my feet.
One secret, three addresses
The wallet I started with was Solong, a browser extension. In early April a warning went round a Chinese-language crypto channel I follow: Solong users should restore their recovery phrase into Sollet, the web wallet built by the Serum team, and stop using Solong. I never found out exactly what was wrong, but I didn’t want to find out the hard way. So that weekend I installed Sollet, restored the same secret, and saw an address I didn’t recognise, with nothing in it.
It took me an hour to understand why. A recovery phrase is not one key but the root of a tree of keys, and a wallet chooses which branch to use by a derivation path [4]:
Here 44 means the BIP-44 standard, 501 is the number registered for Solana, and the last numbers pick the account. Sollet offers three paths in a drop-down, including one marked deprecated, and each one turns the same secret into a different address; the apostrophes mean “hardened” steps, the only kind the ed25519 keys Solana uses allow [5]. My SOL was sitting at the address Solong had used; Sollet was showing me another branch of the same tree.
The lesson was not really about Solana. A wallet app is only a view onto a key. The key is the phrase, and the phrase plus the path is the address. If I had written down only the address, or only trusted one app, I would have thought my coins were gone.
My first liquidity position
Once the wallet worked, I bought RAY and SOL on FTX, withdrew them to Sollet as Solana tokens, and put them into Raydium’s RAY-SOL pool, then staked the pool tokens in a farm. Paying for all of it took a few thousandths of a SOL. A transaction costs 5,000 lamports, or 0.000005 SOL, per signature; most of what I spent was the small deposit each new token account needs [6] [7].
That night I also asked myself the questions I should have asked first: what is an automated market maker, and what is slippage? A pool like this holds two tokens in amounts x and y and keeps their product constant:
If I sell Δx of the first token into the pool, it gives back however much of the second token keeps the product at k:
The marginal price is y/x, but a trade of any size gets a worse average price, and the gap grows with the size of the trade relative to the pool: that gap is slippage. For a small trade in a deep pool it is negligible. In a young ecosystem with shallow pools, it is the real cost of trading, much more than the fee.
What I’m taking from Solana’s spring
First, the key is the phrase, not the app. Write down the recovery phrase, know which derivation path a wallet uses, and never assume an empty screen means empty coins.
Second, young tools break. In three weeks, the main exchange migrated its farms and my wallet had to be abandoned. Neither lost me anything, but both would have if I had been careless with the phrase.
Third, cheap fees change who can take part. On Ethereum, my position was too small to be worth farming. On Solana, the fees are so low that the main cost is slippage, and that I can control by trading small.
Fourth, it is worth being early, and it is worth being careful about it. SOL has gone from about $1.50 at the start of January to around $27 this week [8], and new projects launch every week; Step Finance opens trading in its token on Serum on 24 April [9]. Most of them won’t last. I would rather learn how they work with small amounts now than with large ones later.
References
- Etherscan. Ethereum average transaction fee, daily, 2021. etherscan.io.
- Raydium. The Raydium protocol. Medium, 20 February 2021. raydium.medium.com.
- Raydium. Upgrading to Serum DEX3. Archived copy: 8 March 2021; Raydium app source, migrate.vue.
- BIP-44: multi-account hierarchy for deterministic wallets, github.com/bitcoin/bips; SLIP-44 registered coin types (Solana = 501), github.com/satoshilabs/slips.
- Project Serum. Sollet wallet source code, derivation paths on the restore screen, April 2021, LoginPage.js; SLIP-10, github.com/satoshilabs/slips.
- Solana. Fees. solana.com.
- CoinGecko. Yield farming on Solana. 3 May 2021. PDF.
- CoinMarketCap. Solana historical data. coinmarketcap.com.
- Step Finance. STEP token launch mechanics. Medium, 10 April 2021. stepfinance.medium.com.