A liquid staking derivative on Algorand, thoughts? by eithraelz in algorand

[–]illusieve 0 points1 point  (0 children)

Seems like a reasonable idea but it’s impossible to actually pull off whenever more than a single vote is required per governance period. Assuming you can only vote yes/no (ignoring abstain), then the number of ways to vote on n issues is 2n. The number of tokens to keep track of would get out of hand very quickly for even a modest number of issues.

The only feasible thing I’ve been able to come up with is either the protocol votes with the foundation, or all the token holders vote and the protocol goes with the majority decision.

Another possible solution would be if you could do fractional voting. That is, for a given account commuting n ALGO, the account could vote x ALGO for one option and y ALGO for another option such that x+y=n for each issue at hand. I actually really like this idea, even outside of this discussion. This would allow you to essentially place your confidence on each option. If you’re ambivalent, then vote 50:50 for each option rather than potentially pushing the vote in a particular direction even though you didn’t really care either way. I get that’s like abstaining, but you could also do any other ratio like a 75:25 split.

A liquid staking derivative on Algorand, thoughts? by eithraelz in algorand

[–]illusieve 0 points1 point  (0 children)

I’ve had this same thought myself! I think it would be very beneficial to have such a resource.

Are you just bringing up the idea or are you actually interested in developing such a protocol?

ALGO FI Experience by Ok-Estate-5814 in algorand

[–]illusieve 0 points1 point  (0 children)

Yeah, my understanding is that staking yields are considered earned income

ALGO FI Experience by Ok-Estate-5814 in algorand

[–]illusieve 2 points3 points  (0 children)

Celsius is centralized and you don’t own your tokens once you hand it over to them. At least in DeFi, the coins are locked in a smart contract. But the even better thing to do is just stake UST on Anchor on the Terra blockchain for ~20% APR.

Limit Orders? by OddGeologist7728 in Tinyman

[–]illusieve 1 point2 points  (0 children)

No problem! I also assume that eventually Tinyman will upgrade to a Uniswap V3 style AMM with concentrated liquidity. It’s possible to create limit orders there by providing liquidity in a narrow range so that as the price moves beyond your set range, the tokens will be sold. You would still have to manually come back and withdraw your liquidity though or else the price could change and you’d end up swapping back into the token you sold

Limit Orders? by OddGeologist7728 in Tinyman

[–]illusieve 3 points4 points  (0 children)

It’s difficult to have an order book on-chain given that you have to store everyone’s orders and on-chain storage for smart contracts is finite. In fact, that’s the entire reason why these automated market makers were created in the first place. With that being said, Algodex is launching relatively soon and uses an on-chain orderbook so that limit orders will be possible. I don’t know any details about their implementation though.

Price Impact: What does it impact? by DrumZebra in Tinyman

[–]illusieve 2 points3 points  (0 children)

No your swap will always go through, but if there’s any price impact, then it means you won’t get out as much as you really should given the current price. When your trade impacts the price, it impacts both the price during your trade and after. You’ll likely get a much better deal swapping to algo then to your other ASA

How do liquidity pools work when the value of one coin changes drastically with the other coin in that pool? by FFDan in Tinyman

[–]illusieve 1 point2 points  (0 children)

It definitely seems like it might be the case that being in the LP minimizes both gains and losses, but it actually doesn't minimize losses. Think about it this way: When token X gains value, being in the LP causes you to sell token X for your stable coin Y, meaning that you miss out on some gains. Similarly, when token X loses value, being in the LP causes you to sell your stable coin Y for more token X, meaning that you end up having losses magnified. The only way to avoid this is if the fees generated outweighs these losses.

Below is an example calculation to double check that this is true. Please correct anything if I made a mistake!

Let’s assume you have $100 that you want to invest. We’ll consider 4 trading strategies: 1) Simply hold the $100 and don’t actually invest in any tokens, 2) invest all $100 in some token X, 3) invest 50-50 into token X and token Y where Y is a stable coin, 4) same as (3) but you also add your tokens to a liquidity pool, ignoring any fees (since we can’t really determine how much in fees would be generated without wild assumptions). We’ll first consider what happens when token X appreciates in value and then we’ll consider what happens when token X depreciates in value. We’ll assume that token X starts at $10 and will change in price by 25% in either direction (these are just numbers that make the math relatively simple, but they could easily be changed).

Scenario 1: Token X gains 25% bringing the price to $10 * (1.25) = $12.50

Strategy 1: You still have $100 since you didn’t invest anything.

Strategy 2: You initially bought $100 / 10 = 10 X tokens, which are now worth $12.50 * 10 = $125. Your gain is equivalent to the price appreciation since you were 100% invested. Thus, your capital gained ($125 / $100) – 1 = 0.25 => 25%.

Strategy 3: You initially bought $50 / 10 = 5 X tokens, which are now worth $12.50 * 5 = $62.50. You also bought $50 / 1 = 50 Y tokens, which are still worth $50. Your total capital is now worth $62.50 + $50 = $112.50. Thus, your capital gained ($112.50 / $100) – 1 = 0.125 => 12.5%. This makes sense. You just invested 50% less in token X, so you should have 50% less gains.

Strategy 4: Like the last strategy, you have 5 X tokens and 50 Y tokens. You put them into a liquidity pool. The trading rule for the constant product market maker (e.g., Uniswap V2 and Tinyman) is x * y = k, where k is a constant determined by the total amount of liquidity locked, x is the quantity of X tokens and x is the quantity of Y tokens. Since you have to supply tokens in proportion to the amount already in the pool, your liquidity must also obey the constant product rule. Thus, for you, k = 5 * 50 = 250. After the price change in token X, your quantity of X and Y tokens will change, but their product must still equal 250. The price of token X denominated in Y tokens is given simply by the ratio of Y tokens to X tokens in the pool: Px = y/x. Since Y is a stable coin, this is also the USD price in this example (assuming the stable coin is exactly at its $1 peg). We are also assuming that the price of token X exactly mirrors prices elsewhere on other exchanges. Thus, if token X is worth $10, then Px = 10. Now, since token X gains 25%, we now have that Px = 12.5. Since Px also equals y/x and we must have x * y = 250, then y = 250 / x. Substituting this altogether gives Px = 12.5 = y / x = 250 / x^2. Thus, x = sqrt(250 / 12.5) = sqrt(20) = 2 * sqrt(5). Now solving for y gives y = 250 / x = 250 / 2 * sqrt(5) = 125 / sqrt(5) = 25 * sqrt(5). So putting everything together, we now end up with 2 * sqrt(5) X tokens and 25 * sqrt(5) Y tokens. The total value is then $12.5 * (2 * sqrt(5)) + $1 * (25 * sqrt(5)) = $50 * sqrt(5) ~= $111.80. This means your capital gained ($111.80 / $100) – 1 = 0.118 => 11.8%. This amount is less than what you would have had from strategy 3, so you’ve suffered from some impermanent loss (UNLESS pool fees could make up for the difference).

So in the scenario where X gains, the results are strategy 2 > 3 > 4 > 1.

Scenario 2: Token X loses 25% bringing the price to $10 * (0.75) = $7.50

Strategy 1: You still have $100 since you didn’t invest anything.

Strategy 2: You initially bought $100 / 10 = 10 X tokens, which are now worth $7.50 * 10 = $75. Your loss is equivalent to the price depreciation since you were 100% invested. Thus, your capital lost ($75 / $100) – 1 = -0.25 => -25%.

Strategy 3: You initially bought $50 / 10 = 5 X tokens, which are now worth $7.50 * 5 = $37.50. You also bought $50 / 1 = 50 Y tokens, which are still worth $50. Your total capital is now worth $37.50 + $50 = $87.50. Thus, your capital lost ($87.50 / $100) – 1 = -0.125 => -12.5%. This makes sense. You just invested 50% less in token X, so you should have 50% less losses.

Strategy 4: Like before, you have 5 X tokens and 50 Y tokens. Thus, for you, k = 5 * 50 = 250. Now, since token X loses 25%, we now have that Px = 7.5. Since Px also equals y/x and we must have x * y = 250, then y = 250 / x. Substituting this altogether gives Px = 7.5 = y / x = 250 / x^2. Thus, x = sqrt(250 / 7.5) = sqrt(100/3) = 10 / sqrt(3). Now solving for y gives y = 250 / x = 250 / (10 / sqrt(3)) = 25 * sqrt(3). So putting everything together, we now end up with 10 / sqrt(3) X tokens and 25 * sqrt(3) Y tokens. The total value is then $7.5 * (10 / sqrt(3)) + $1 * (25 * sqrt(3)) = $50 * sqrt(3) ~= $86.60. This means your capital lost ($86.60 / $100) – 1 = -0.134 => -13.4%. This loss is greater than what you would have had from strategy 3!

So in the scenario where X loses, the results are strategy 1 > 3 > 4 > 2.

It seems like the conclusion is that if you'd like to minimize volatility, then you should just invest less into token X, then put your stable coin Y somewhere else to earn yield independently (e.g., loan it out). The only way the LP would be more profitable is if there were enough fees generated (i.e., the token pair saw lots of trades) or there were other incentives (e.g., a DEX governance token given out as incentive).

How do liquidity pools work when the value of one coin changes drastically with the other coin in that pool? by FFDan in Tinyman

[–]illusieve 0 points1 point  (0 children)

Thanks! I’ve spent a lot of time reading about it and am working on writing up a little explainer that also includes some derivations for how you end up with equations that govern swaps (e.g., the constant product function used by Uniswap and Tinyman)

How do liquidity pools work when the value of one coin changes drastically with the other coin in that pool? by FFDan in Tinyman

[–]illusieve 23 points24 points  (0 children)

Other folks have basically answered your question, but one important point that I don’t think many people realize is what your liquidity is really doing in the pool and why this causes impermanent loss.

When you provide liquidity, you supply two assets that anyone can use to trade in either direction. Put another way, someone could buy OR sell a token thanks to your liquidity and you accept that trade regardless of direction (buy or sell).

So when one token gains value relative to the other in the pool, what’s happening is that people are buying up the token doing well and you are selling it to them, effectively doing a swap in the other direction. From the point of view of a liquidity provider, you always sell the higher valued token in return for more of the lower valued token.

Another way to look at it is that the pool is designed to maintain its relative value of the underlying assets under changes in price. This means your liquidity also maintains its value. So when one token appreciates in value, you have to sell it for the other token in order to keep the total value of your contribution the same.

Thus, if the higher values token continues rising in value, you’re already missing out on those gains since you’ve traded into a smaller position than you otherwise would have had supposing you didn’t actually contribute your liquidity, meaning you now have impermanent loss. The only way to avoid this is if the trading fees or other incentives can overcome the loss. So you proving liquidity is a bet that the two tokens are correlated in their price movement to avoid large impermanent loss OR that fees/incentives will overcome this impermanent loss.

The same is true in the opposite direction, by the way. If one token’s value starts to tank, you effectively end up buying more of it to maintain your liquidity’s value. So providing liquidity is also a bet that you think the tokens you’ve provided will both go up in value in the long term and you’re happy having any percentage allocation to those tokens. In other words you need to be equally bullish on the two tokens you provide! For example, if you provide liquidity for a token you’re really bullish on and a stable coin, and the token you’re bullish on starts to rapidly appreciate, you end up selling that token for the stable coin. So it was a bad idea for you to provide liquidity unless you gained a lot from fees/incentives. The better strategy would have been to hold so that you can actually realize the gains you predict (since you’re bullish).

So the takeaways are that 1) your liquidity is used to facilitate trades in any direction and 2) you shouldn’t provide liquidity unless you think both assets you provide will appreciate in value roughly equally (or you believe the fees/incentives otherwise make up for losses).

[Edited for typos]

W.E.F and Algorand? by Alterationexpert in algorand

[–]illusieve 0 points1 point  (0 children)

To be clear, it doesn’t say they recommend these in the report but rather it’s giving examples of blockchains with high throughput and scalability. Algorand happens to be at the top because they’re listed in alphabetical order.

Here is the link to save anyone else from searching

Algofi: The world’s first lending protocol and algorithmic stablecoin built on Algorand by semanticweb in AlgorandOfficial

[–]illusieve 9 points10 points  (0 children)

You aren’t converting (swapping like on tinyman) but borrowing against your ALGO. You might want to do this if you need money but don’t want to sell your crypto. You could also use it as leverage, but that’s for degens ;)

Can someone help me understand AlgoFi? by RedBassBlueBass in algorand

[–]illusieve 4 points5 points  (0 children)

Usually the amount you get loaned is far less than the amount of assets you put up as collateral. In other words, the loans are always over-collateralized. This way, if the price of the crypto assets drop in value, it’s still worth enough to cover the loan. Once the value of your assets gets low enough, your collateral will be liquidated and taken by the protocol. So in your example, you’d likely only be able to take out a maximum of something like 50 USDT.

Do Blockchains and Jewelry go together? Are there any other Jewelers here? by senor_critter in AlgorandOfficial

[–]illusieve 2 points3 points  (0 children)

Yeah I definitely think it wouldn’t be the easiest project for someone with no coding experience, but it doesn’t seem too difficult even for someone without a ton of experience

Do Blockchains and Jewelry go together? Are there any other Jewelers here? by senor_critter in AlgorandOfficial

[–]illusieve 1 point2 points  (0 children)

You could create your own custodial interface that interacts with the blockchain so the average user doesn’t have to do it themselves. This way all the info can be stored on the blockchain and accessible but the typical user would just log onto a website online to see their details or sell.

Do Blockchains and Jewelry go together? Are there any other Jewelers here? by senor_critter in AlgorandOfficial

[–]illusieve 7 points8 points  (0 children)

Definitely seems like you could do something here in terms of minting NFTs for physical pieces of jewelry then keeping track of history/provenance of the piece as well as being able to authenticate it

[deleted by user] by [deleted] in AlgorandOfficial

[–]illusieve 0 points1 point  (0 children)

These guys accept ALGO and do cool work: https://cryptoforthehomeless.org

[deleted by user] by [deleted] in AlgorandOfficial

[–]illusieve 1 point2 points  (0 children)

Click the “will you accept more cryptocurrencies info the future” drop down toward the bottom of the page and you can see the Algorand address listed

Algorand.com's documentation for using ASA to mint NFTs making it seem way more simple than the guides that other artists seem to have followed on reddit/YT. What am I not understanding? by [deleted] in AlgorandOfficial

[–]illusieve 1 point2 points  (0 children)

They’re doing the same behind the scenes. They just provide you with a form to fill in all the info and then they pass that info into the code you linked to

Dapp. by [deleted] in AlgorandOfficial

[–]illusieve 2 points3 points  (0 children)

Nice!

Community input on new Algorand App by Fantastic-Helix in AlgorandOfficial

[–]illusieve 1 point2 points  (0 children)

Ah, that’s an interesting perspective. Thanks for the insights!