Nothing
## ----ex1-5050, eval=TRUE------------------------------------------------------
# 50/50 Pool, Token 1 price doubles (100 -> 200)
library(impermanentlosscalc)
impermanent_loss(
prices_old = c(100, 10),
prices_new = c(200, 10),
weights = c(0.5, 0.5), # Standard 50/50 weights
investment = 1000,
fees = 0,
plot = FALSE
)
## ----ex2-multiasset, eval=TRUE------------------------------------------------
# 20/40/40 Pool, Token 1 price triples (10 -> 30).
library(impermanentlosscalc)
impermanent_loss(
prices_old = c(10, 10, 10),
prices_new = c(30, 10, 10),
weights = c(0.2, 0.4, 0.4), # Unequal weights for three assets
investment = 1000,
fees = 0,
plot = FALSE
)
## ----session-info, echo=FALSE-------------------------------------------------
sessionInfo()
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.