Yam 3 – a supply elastic money with a treasury

More Info

Dap: https://yam.finance/
Medium: https://medium.com/@yamfinance
Twitter: https://twitter.com/YamFinance
Discord: https://discord.com/invite/nKKhBbk

Addresses

YAM 3 token address:

https://etherscan.io/token/0x0aacfbec6a24756c20d41914f2caba817c0d8521

yUSD token tracker:

yUSD is also named yyCRV or YAM-yyDAI+yUSDC+yUSDT+yTUSD

yUSD: https://etherscan.io/token/0x5dbcf33d8c2e976c6b560249878e6f1491bca25c

yUSD token adress:

yUSD is also named yyCRV or YAM-yyDAI+yUSDC+yUSDT+yTUSD

yUSD: https://etherscan.io/address/0x5dbcf33d8c2e976c6b560249878e6f1491bca25c

Uniswap Pool YAM - yUSD:

https://etherscan.io/address/0xb93cc05334093c6b3b8bfd29933bb8d5c031cabc

Analytic:

https://uniswap.info/pair/0xb93cc05334093c6b3b8bfd29933bb8d5c031cabc

Other Pools with YAM Pairs:
https://uniswap.info/token/0x0aacfbec6a24756c20d41914f2caba817c0d8521

Buy or sell on Uniswap

https://app.uniswap.org/#/swap?inputCurrency=0x0aacfbec6a24756c20d41914f2caba817c0d8521&outputCurrency=0x5dbcf33d8c2e976c6b560249878e6f1491bca25c

Add liquidty

https://app.uniswap.org/#/add/0x0aacfbec6a24756c20d41914f2caba817c0d8521/0x5dbcf33d8c2e976c6b560249878e6f1491bca25c

Insurance streaming is the way to go

First

I'm a long-term member of Nexus Mutual for around one year and this is pretty long for crypto these days. I'm not involved in the governance/community and things I describe may be underway.

The creation of yInsureNFT from yearn and the possibility to buy/sell cover on an open market is a development in the right direction.

I also do write this with yieldfarming.insure in mind because they are fresh and want to move forward. I do not hold or farm $safe right now.

To stream money, not send, is the nature of crypto.

The idea of sending money in large chunks is outdated. I assume that in the future money is not sent, but continuously streamed. I strongly see blockchain technology itself as a medium and every medium has some sort of natural properties and will eventually diverge to this properties. The natural way for the medium blockchain is that money is streamed, not sent.

Nexus Mutual cover model is not cryptonized

So if you look at Nexus Mutual, you have to buy a cover for a certain time, and when you don't need the cover anymore because you decide to move one, you just have to keep it. At least everyone can make a claim holding an insurance for a protocol. If you make a claim no proof having actual money in the protocol is required.

Yinsure.finance did change that: With yNFT you can sell the claim if you don't use it anymore.

Money streamed leads to insurance streamed

But we want a stream insurance model anyway, that's what the costumer in me wants. I'm imaging the following product:

If I have the need for a cover for a protocol, I give the insurance trusted access to my account, and they just stream the needed payment to them. If my risk level changes on that protocol the stream is adjusted the payment accordingly. Depending on my risk tolerate level and my funding I can set a percent of cover and adjust this anytime.

Final goal is to auto-balancing insurance cover for all my holdings

If this works, it's effortless to create the product I really want: A auto-balancing cover for all the protocols and values on my ethereum address which I can manually adjust anytime without to make any payment, just streamed.

Disscuss here

https://twitter.com/martinkrung/status/1305900781724471296?s=20

Links:

Nexus Mutual https://nexusmutual.io
yNFT: https://yinsure.finance/
yNFT Stats: https://stats.finance/yinsure
Farming $safe: https://yieldfarming.insure

Liquidity in crypto has a market anomaly by pricing long-term liquidity equal as short-term liquidity and this leads to opportunistic liquidity.

Liquidity in traditional finance

In traditional finance illiquid liquidity is more valuable than liquid liquidity: If you deposit your money for a longer and fixed period, you will receive more interest than if you only keep it as cash in our bank account. For traditional banks this is key, because if people could withdraw their complete money anytime, a bank as a liquidity dependent institution, can go bankrupt very quickly.

Miss-pricing of long-term liquidity vs short-term liquidity

These rules also apply to crypto but have been neglected until now: Most liquidity dependend protocols act like liquidity for a day is the same as liquidity for month and do not reward long-term liquidity over short-term liquidity.
If you deposit your money into a protocol for a week you get the same ratio from the fee, as you will deposit for a month. So cost the move liquidity from one protocol to another is just the transaction cost.

Opportunistic liquidity

Together with the fact that liquidity has the same value regardless of where it is located, this leads to opportunistic liquidity.

Because opportunistic liquidity has only the transaction cost to move from one protocol to another protocol, and except security risk, no other risk. The liquidity can just flow back to the old protocol if not successful. Liquidity wars will only stop if protocols start pricing long-term liquidity higher than short-term liquidity. Leaving with your liquidity and coming back has a price tag then and as a result movement of liquidity will be reduced greatly.

Possible solutions

I see this solutions to give long-term liquidity a higher value than short-term liquidity:

  1. A lock-up period free to choose to immobilize liquidity gets a higer reward (like in legacy banking)
  2. Extra reward for long term provider increasing over time, some form of compounding
  3. Short-term liquidity provider pay long-term liquidity provider on leaving

Real world

Sushiswap vs Uniswap

Sushiswap, a Uninswap fork, startet on August 26 2020 and did implement a basic form of migration mining. Opportunistic liquidity inflow had a value of almost 1.2 Billion $ at the peak. The main dev did cash out the treasurey on September 5 and ruined the project.

https://medium.com/sushiswap/the-sushiswap-project-c4049ea9941e

More about the sushi chef ruining the project: https://twitter.com/ameensol/status/1302395863709351936?s=20

curve.fi vs swerve.fi

Ongoing! (8.9.2020)
https://twitter.com/lawmaster/status/1303221190593581056?s=20

Feedback?

I would like to hear any feedback on this, please use my tweet: https://twitter.com/martinkrung/status/1303307557226917890?s=20

Or drop me a mail at contact@cryptonative.ch or DM me on twitter.

More to read:

Vampire attack, a attack on liquidty dependent protocols
Migration Mining/Vampire Mining

Average liquidity coin age (ALCA) and liquidity coindays destroyed SMA (LCDDSMA) – a new metric for stickiness of liquidity in a liquidity pool

How to measure liquidity flow

Liquidity is flowing into AMM pools and is flowing out again. How to measure this flow?

Average liquidity coin age (ALCA)

To represent the stickiness of liquidity in one pool I came up with average liquidity coin age. Coin age metric is well-known for full block chains, but I never did see this calculated for AMM Pools. To make this simple, we use days to measure the duration of this.

1 liquidity coin for 30 days = 30 LCA
2 liquidity coin for 10 days = 20 LCA

Average LCA would be 25 LCA for this pool.

Liquidity coindays destroyed SMA for outflow measurement

Another metric is liquidity coindays destroyed. This metric would measure the outflow more accurate. On every withdraw the coin age value of this withdraw is measured and a simple moving average calculated over 1day/1week.

Example:

Withdraw for 1 liquidity coin which has stayed in the pool for 30 days will result in 30 LCAD
Withdraw for 2 liquidity coin which has stayed in the pool for 10 days will result in 20 LCAD

Now calculate a sum of all LCAD over a timeframe of 30 days and divide this with 30 you will get Liquidity coindays destroyed moving average.

Feeback over Twitter please: https://twitter.com/martinkrung/status/1301177253687185412?s=20

References:

Cell – an autonomous evolutionary primitive for a new finance

Trying to fall into sleep yesterday a had another spark of insight into the future of finance and crypto. After almost 10 years of spending time researching crypto stuff, my brain just keeps spitting out this stuff.

Normally coins are passive matter, they can't move for themself, they are being moved from A to B from outside. If you look on an algo trading system, the algo is trading the coins or the connected pairs. With crypto this can be very different.

Will write this down in the futur (Next 10 years). It's quite complex and I don't think it's possible to implement this with the stage of crypto right now.

Vampire Attack – an attack on liquidity dependent protocols

Vampire Attack (Vampire Mining) - an attack on liquidity dependent protocols

Here we have dark scenario for liquidity dependent projects called the vampire attack. In the interest of keeping DeFi projects secure and behaving as intended, liquidity lock-up or sufficient time-based rewards for locking up liquidity provider should be implemented. This attack uses migration mining.

Simple Vampire Attack

  1. Clone a project A (from its smart contracts to even its front-end). Project A has no token yet, but earns fees on token volume.
  2. Implement migration mining from project A to project B. Simply, give $b to people who migrate liquidity from A to B.
  3. Implement governance and start sharing revenue to tokenholders holding $b.
  4. Attack will be successful if Project A is drained of sufficient liquidity.

Advanced Vampire Attack

A combination of migration mining, leverage shorting Project A's tokens ($a) and going leverage long Project B's tokens ($b).

  1. Capital accumulation: sell $vampire over a bonding curve end get $usd into treasury.
  2. With 1/2 of the treasury you go to a lending market and lend as much $a as you can.
  3. With the other part you buy $b and put it into lending to leverage long (buying more $b)
  4. Implement migration mining from project A to project B. Simply, give $vampire to those who migrate liquidity from A to B. In parallel start selling $a to lower the price. With a portion, leverage up by lending more $a on a lending market and sell this too. With the other portion, buy more $b from project B.
  5. People start migrating liquidity from project A to B to earn $vampire. The price of $a is expected to crash (because without liquidity, the project is worthless and has no revenue). Expect the price of $b to start rising.
  6. Now buy back the now worthless $a, pay off the incurred debt, and get your initial $usd with leverage back and put it into the treasury.
  7. Distribute the $usd and $b to the people having $vampire

A Vampire Attack is a simple "hack" but has wide implications:

  • The era of free liquidity flow is over. Liquidity migration itself has to be rewarded as migration mining.

  • Projects will have to pay for liquidity lock-up rather than contend with free floating liquidity

  • Liquidity owners can become protocol owners with no or little risk

  • Shorting/Longing entire projects are now possible with this strategy (Advanced Vampire Attack)

  • Advanced Vampire Attacks share characteristics with flash loan attacks but is slower

  • Private owned projects who are liquidity dependent have a high risk of vampire attacks

  • Every liquidity dependent project needs lock-up periods or a form of compounding rewards for long-term liquidity provider

Executive Summary for non crypto people

Imagine two traditional banks (A and B) which have similar services.

B is very new and has no liquidity. So B decides to distribute shares and a reward for the liquidity you bring in. B knows that A is dependent on liquidity, as is every bank. So B takes out a loan somewhere, buys shares of A (with leverage) and sells these on the market.

Then B tells every customer of A that it has a plan to suck out A's liquidity, distribute its own shares, and offer a reward as incentivization. If successful, people will start to migrate liquidity from A to B. (Incoming liquidity would have a lock-up period and you would receive more shares the longer you lock-up)

A cannot stop liquidity outflow because customers can do this electronically without permission. This results in A going bust and the value of A's shares drops to zero. To finalize the scheme, B pays back the now worthless shares from A and distributes the profits as rewards for its own shareholders.

Tweet from 2020-08-25 about the vampire attack: https://twitter.com/martinkrung/status/1298363320270032897?s=20
Many thanks to Daniel Hwang for corrections.

Migration Mining (MM) – a new form of incentive for crypto projects to get liquidity into a liquidity dependent protocol

Migration Mining (MM), a new mining variant

Migration Mining (MM) - a new form of incentive for crypto projects to get liquidity into a liquidity dependent protocol.

Executive Summary

Migration minings (MM) goal is to suck liquidity from project A to B. It has 6 main purposes:

  1. Minimal cost for project B to get a lot of liquidity rewarded by project token B
  2. Lock-up migrated liquidity in project B for an extended time
  3. Have a clear target group with existing liquidity provider on project A
  4. Make migration more easy, because it only needs 1 tx (and no waiting time for get several tx to get mined)
  5. Allow small pool owner to migrate with minimal cost, because migrate is rewarded by project token B and payed by others.
  6. Meme Power, because its something new! Migration mining woke - Liquidity mining broke!

User story for migration with migration mining

User visits migration page of target project B and will see a list of liquidity token he/she owns from project A. Now he/she selects one or several token and makes an approval tx to every liquidity token from A and can individually set a lock-up period from 60-360 days.

Reward in project token B is calculated and shown. He/she makes an approval tx to liquidity token and makes a tx to set the lock-up period. Then he/she waits until migration is completed.

Under the hood

  1. User approves liquidity token from A with one tx
  2. User set a lock-up period with another tx
  3. Somebody calls migrate for the contract and pays for the gas, (this person gets project token B for paying eth needed for the migration)
  4. migrate:
    • withdraw liquidity from project A -> get liquidity from project A
    • supply liquidity to project B -> put liquidity to project B with a lock-up period
    • send dust of unused liquidity back to owner
    • send reward token to owner

migration mining adds a lot of complexity to migration

  1. rewards in project token B should be based on $ value

    • for $ stablecoin pools this is easy to calculate (2x the stablecoin)
    • for eth pools an oracle is needed
    • for other pools without $ stablecoin or eth at least 1 oracle is needed
  2. To prevent migration washing a lock-up period must be applied for a time range from 60 to 360 days. This also has the very important side effect not only to migrate liquidity but also to hold!

  3. To prevent people adding liquidity to project A for migration mining to project B a whitelist/snapshot has to be done (But how? And why should project B care about this?)

  4. How to make this fair? Is it a fixed pool of project token B to distribute or is bound on migrated value? How long do we allow migration mining? Maximal duration is the minimum lock-up period. If we pay people calling migrate and pay them in project token B how do we adjust changing gas price?

Risk

  • It opens up a liquidity war with project A (And ad lot of additional stress for ethereum)
  • If successfull, other projects will make migration mining too and this time project B may lose liquidity
  • How does-lock up work? This has to be implemented in project B and adds complexity and additional risk to the protocol.

Further thoughts

  • If standard liquidity mining is done, an incentivize lock-up period may be a good idea anyway, if reward is adjusted accordingly!

  • To do this right, it's a lot of work, needs audit and UX has to be slik!

    by martin krung 2020-08-23

Simple migration, as impemented by https://1inch.exchange

https://twitter.com/1inchExchange/status/1297182579829936128?s=20

Code here: https://github.com/CryptoManiacsZone/1inchProtocol/blob/feature/mooniswap-migration/contracts/OneSplitMooniswapMigration.sol

User story for simple migration

User visits migration page of target project B and will see a list of liquidity token he/she owns from project A. Now he/she selects one or several token and makes an approve tx to every liquidity token from A. Then he/she waits until migration is completed.

Under the hood

  1. User approve liquidity token from A with one tx
  2. Somebody calls migrate for the contract and pays for the gas
  3. migrate:
    • withdraw liquidity from project A -> get liquidity from project A
    • supply liquidity to project B -> put liquidity to project B
    • send dust of unused liquidity back to owner

Head Issuance – Seigniorage to the people

This article is unfinished and very raw. I'am currently working on a paper about this. (2020-11-20)

Head Issuance - Seigniorage and money is distributed directly to everyone. Think helicopter money only, no other money distribution! Seigniorage to the people!

Helicopter money

Helicopter money is the distribution of money to everyone to get inflation back. If an economy is stuck with a deflationary scenario this should be a solution for central bank to restart the economy by creating inflation and to speed up velocity of cash.

Helicopter money has been discussed widely as a solution of last resort, but not implemented anywhere. Some countries distributed cash in the COVID-19 pandemia, notably the US. This cash was coming from the government, not directly from the printing press.

Head Issuance

Head Issuance is a similar concept like helicopter money. Head issuance is a far more radical approach. Money distribution will be solely over people. This way seigniorage will be distributed fairly. By raising or lower the monthly distribution inflation can be controlled. People will still bring the excess money to commercial banks, and the banking system will work the same way they do now.

Head issuance can be viewed as a move back to the roots of money: Before coins of precious metals have been used, natural things like shell or cacao beans have been used as neutral means of exchange. Distribution of natural money was decentralized innately, no central entity head control over it.

Later, with the start of constitution of governmental bodies, these entities started to create standardized coins and push the acceptance of these coins by paying and taxing people in these currencies.

These institutions could only create money in a centralized way because money had to be physical and there was no other way to distribute.

Digitalization of money and the development of blockchain and programmable money created the opportunity to distribute these currencies over the internet in a trust less way. New concepts of money distribution are finally possible.

-- raw stuff --

At first, as money mostly a relativly rar and uniform good was choosen like shell money, cocoa beans.

To make it fungible mostly a relativly rar and uniform good was choosen like shell money, cocoa beans [1] and later silver and gold. Shell money did produce themself, so collecting was all it needed. Cocoa beans needed to be farmed by people. Precious metal needed minting and a form of distribution.

The power to create coins always was in the hand of the powerfull. Minting has been done by lings, landlords and and later by nations. Precious metal needed minting and a form of distribution. As long as money consisted of precious metals and other rare money-like things, the money creation profit was small. This difference in value between the bare gold and the minted coin is called seigniorage.

This profit change with the introduction of fiat money, you print a $100 paper bill for 0.15 and and get a seigniorage of $99.85. Today this profit is given to the goverment.

Until the invention of Computer and Computer networks money was bound to physical things.

It therefore had to be produced centrally and put into circulation.

https://www.wikiwand.com/de/Vollgeld-System

Glossar

https://www.snb.ch/de/mmr/reference/quartbul_1998_4/source/quartbul_1998_4.de.pdf

https://onlinelibrary.wiley.com/doi/abs/10.1111/1467-6435.00038#:~:text=On%20the%20one%20hand%2C%20monetary,in%20order%20to%20raise%20seigniorage.&text=Thus%2C%20the%20way%20central%20bank,can%20influence%20fiscal%20behavior%20considerably.

https://www.investopedia.com/terms/s/seigniorage.asp

https://www.investopedia.com/terms/f/fiatmoney.asp

Seigniorage: https://www.wikiwand.com/en/Seigniorage

https://en.wikipedia.org/wiki/Shell_money
https://www.nbbmuseum.be/en/2013/03/kakao.htm

How to wrap ETH to WETH (on testnet or even mainnet)

How to wrap ETH to WETH on testnet

Look for the corresponding contract in this article:

https://blog.0xproject.com/canonical-weth-a9aa7d0279dd?gi=ad5edae916c4

For Rinkeby its: https://rinkeby.etherscan.io/address/0xc778417e063141139fce010982780140aa0cd5ab

Go to the Contract > Write Contract and to connect your wallet, click on "Connect on Web3"

Go to function "5. deposit" and write the amount of ETH you would like to wrap to WETH, Click "Write" and wait until your tx is mined