Skip to main content
Version: v0.18

Yield AMM

Yield AMM (YAMM) pools cater to the unique requirements of principal and yield token trading. Each refractable asset has a corresponding pool, comprising cAsset and active pAsset tokens as liquidity. As time progresses and new maturity levels are introduced (or old ones expire), the amm module automatically updates the related pAssets in the respective pools.

Preliminaries

The refractor exchange rate is the ratio of the total supply of pAsset to the cAsset amount in the Refractor vault.

This rate at time tt is denoted as ρ(t)\rho(t). If a user refracts a cAsset amount aa, they will receive ρ(t)a\rho(t)a of pAsset and an identical amount ρ(t)a\rho(t)a of yAsset.

The yield rate to maturity rr for a specific pAsset can be calculated using the formula

r=(1pρ(t))1t01,r=\left(\frac{1}{p \cdot \rho(t)}\right)^\frac{1}{t_0}-1,

where pp is the pAsset's market price (in terms of the cAsset) and t0t_0 is the pAsset's time to maturity.

Design

YAMM utilizes Balancer's constant weighted geometric mean formula, expressed as

j=0nxjwj=C ,\prod_{j=0}^ n x_j^{w_j} = C \ ,

where, for each j{0,1,...,n}j \in \{0, 1, . . . , n\}, xjx_j and wjw_j denote the balance and weight of token jj in the pool, respectively, and CC is a real number. Token 00 represents the cAsset while tokens 11, 22, \ldots, nn are the pool's pAssets.

In the YAMM model, weights vary over time. We also incorporate virtual balances and leverage parameters to ensure that the balance curves for the cAsset and any pAsset progressively flatten, mirroring the balance curve of the YieldSpace AMM. YAMM trading adheres to standard Balancer formulas.

To account for a token's time to maturity, we introduce the α\alpha parameter, computed as:

αj(t)=min{tajbjaj,1} .\alpha_j(t) = \min \left\{\frac{t - a_j}{b_j - a_j}, 1 \right\} \ .

In this formula, jj signifies each pAsset, aja_j and bjb_j denote the initial and maturity time of the pAsset, respectively, and tt represents the current time. Note that αj(aj)\alpha_j(a_j) equals 0 and αj(bj)\alpha_j(b_j) equals 1. For all t[bj,+)t\in [b_j,+\infty), αj(t)\alpha_j(t) is set to 1. The expression 1αj(t)1-\alpha_j(t) represents the scaled time to maturity of token jj, which varies from 0 to 1.

Leverage Parameters

The YAMM utilizes leverage parameters for each pAsset in the pool to enhance pricing precision for traders and replicate the YieldSpace curve. Denoted as kjk_j, these parameters are dynamic and time-dependent. For each j{1,2,,n}j\in\{1,2,\ldots,n\}, we define the leverage parameter as:

kj(t)={11αj(t)if αj(t)0.9850if αj(t)0.98k_j(t) = \left\{ \begin{array}{cl} \dfrac{1}{1-\alpha_j(t)} & \textnormal{if }\alpha_j(t) \leq 0.98 \\ 50 & \textnormal{if }\alpha_j(t) \geq 0.98 \end{array}\right.

To avoid numerical issues when α\alpha nears 11, it's essential to cap the leverage parameter kjk_j; we set this limit at 5050. It's worth noting that in practice, we enforce a configurable maximum parameter to limit the alpha parameter, not the fixed 0.980.98 value used here.

Lambda Parameter

The lambda parameter is another leverage parameter for the cAsset, denoted by λ\lambda. This parameter is constant for each pool and must meet the condition λ1\lambda \geq 1. A larger λ\lambda results in flatter curves and better trader prices, but less price discovery. We suggest a default λ=10\lambda = 10, although this can be configured per pool.

Parameter LL

Parameter LL gauges the pool's liquidity. At all times, LL should equal the number of LP tokens in circulation. We also recommend that the initial number of LP tokens assigned to the pool creator—or the initial liquidity provider—should equal the quantity of cAsset deposited when the pool is established. As such, LL's initial value is CC.

Virtual Adjustment Balances

To facilitate smooth transitions when adding or removing pAssets from the pool, we introduce virtual adjustment balances. These are amounts added to the YAMM pool's virtual balances, and are time-dependent functions. Generally zero, these balances deviate from zero when a new token is added to the pool or an existing one is removed. In these cases, the corresponding virtual adjustment balance will incrementally increase or decrease. Each pAsset in the pool has a corresponding virtual adjustment balance, denoted by D1(t),,Dn(t)D_1(t),\ldots,D_n(t).

Virtual adjustment balances are defined using parameter LL as follows. For each j{1,2,....,n}j\in\{1, 2, ...., n\} we define:

Dj(t)=dj(t)LD_j(t) = d_j(t) \cdot L

The function dj(t)d_j(t) is defined as:

  • When pAssetj_j is added to the pool:

    dj(t)=AATmin{tt0,T} ,for t[t0,t0+T] ,d_j(t)=A-\frac{A}{T}\cdot \min\{t-t_0,T\} \ , \textnormal{for }t\in [t_0, t_0+T]\ ,

    Here, t0t_0 is when the new pAsset is added to the pool, TT is the time during which the virtual adjustment balance gradually decreases to 00, and A=5A=5. In the implementation, AA corresponds to the configurable property introduction_virtual_balance_scaler. TT can be any appropriate time duration (e.g., a week, fortnight, month) that allows a gradual decay of the virtual adjustment balance. Note that at t0t_0, dj(t0)=Ad_j(t_0)=A and at t0+Tt_0+T, dj(t0+T)=0d_j(t_0+T)=0.

  • When pAssetj_j is removed from the pool, we denote the time of maturity of the pAsset by bb and the length of the asset removal period by TT (for instance, a week). We then define dj(t)d_j(t) as follows:

    dj(t)=10t+TbT ,for t[bT,] ,d_j(t)=10 \cdot \frac{t+T-b}{T}\ , \textnormal{for }t\in[b-T,\infty]\ ,

    Here, dj(bT)=0d_j(b-T)=0 and dj(b)=10d_j(b)=10. As mentioned in the introduction, we don't use a constant 1010 in the implementation. Instead, this constant can be configured through the expiration_virtual_balance_scaler property. It's important to note that tt can be as large as possible, meaning the virtual balance continues to increase even after the interval has ended. This process continues until the token balance is zero, at which point it is removed from the pool.

  • If the above conditions do not apply, then dj(t)=0d_j(t)=0 for all tt.

To manage the virtual adjustment balances, we store an object of the following type for introducing or removing tokens:

message VirtualBalancePoolToken {
uint64 pool_id = 1;
string denom = 2;
string target_virtual_balance = 3 [
(cosmos_proto.scalar) = "cosmos.Dec",
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
(gogoproto.nullable) = false
];
int64 start_unix_millis = 4;
int64 end_unix_millis = 5;
}

The target virtual balance represents the scaler parameter used in calculating djd_j. For introducing tokens it corresponds to the AA parameter, set as introduction_virtual_balance_scaler, while for expiring tokens it is set as expiration_virtual_balance_scaler.

Virtual Balances

The pool has virtual balances for trading, defined as follows. Let B0,B1,,BnB_0,B_1,\ldots,B_n represent the real balances of all tokens in the pool. The virtual balances V0,V1,,VnV_0,V_1,\ldots,V_n are defined by

V0=B0+(λ1)LV_0 = B_0 + (\lambda-1) \cdot L

and

Vj=Bj+(kj(t)1)L+Dj(t)V_j = B_j + (k_j(t)-1) \cdot L + D_j(t)

for j{1,2,...,n}j\in\{1, 2, ..., n\}.

Weights

The weights of different tokens vary over time. The refractor exchange rate at time tt is denoted by ρ(t)\rho(t). We define the weights wjw_j, j{0,1,...,n}j\in\{0, 1, ..., n\}, as follows:

w0=ρ(t)λw_0=\rho(t) \lambda

and

wj=kj(t)w_j = k_j(t)

for all j{1,2,....,n}j\in\{1, 2, ...., n\}. The weights are then scaled proportionally so that j=0nwj=1\displaystyle \sum_{j=0}^n w_j = 1.

Trading Fee

The YAMM is designed for trading among yield-bearing tokens, so it's logical that the trading fee isn't a fraction of the token amounts traded, but rather a percentage of the yield rate. The traditional constant fee rate can be problematic in this setting as it can cause a significant difference in the yield rate of the token if the yield is small or if the pAsset is nearing maturity. To define a meaningful trading fee, we'll create a fee that varies with time. Let rr denote the expected average monthly yield rate of the pAssets. If we have no information about the expected yield rate, we can set rr to a constant value of 0.01. For each j{1,2,,n}j \in\{1,2, \ldots, n\}, let τj\tau_j denote the period, in months, between the introduction and maturity of pAsset jj. This means τj\tau_j equals bjajb_j-a_j measured in months, where bjb_j and aja_j are the maturity's expiration and introduction times, respectively.

We'll also establish a parameter ν>0\nu>0, initially set to 1. Governance can later adjust this to raise or lower pool fees.

With these parameters in place, we define the fee for each pAsset j_j at time tt as:

ϕj(t)=(αj(t)0.000125+(1αj(t))0.002)12.84ν((1+r)τj1)\phi_j(t)=\left(\alpha_j(t) \cdot 0.000125+\left(1-\alpha_j(t)\right) \cdot 0.002\right) \cdot 12.84 \cdot \nu \cdot\left((1+r)^{\tau_j}-1\right)

The factor ((1+r)τj1)\left((1+r)^{\tau_j}-1\right) is the yield rate of pAssetj\mathrm{pAsset}_j from introduction to maturity. We can round the parameter τj\tau_j to the nearest integer to reduce computation.

Importantly, ϕj\phi_j doesn't depend on the pAsset's price—an intentional design choice to avoid manipulation.

For the cASSET, we define the fee as ϕ0(t)=0\phi_0(t)=0 for all tt. Now, for i,j{0,1,,n}i, j \in\{0,1, \ldots, n\}, the trading fee for trading assets ii and jj at time tt is:

ϕ=max{ϕi(t),ϕj(t)}.\phi=\max \left\{\phi_i(t), \phi_j(t)\right\} .

Pool Interactions

Since yamm pools are based on weighted pool designs, standard operations like swapping, depositing liquidity, and withdrawing liquidity all function as outlined in the weighted pools page.

Zero Impact Join

If a user wants to join a pool using only cASSETs, we need to use non-proportional join methods, which involve underlying swaps. But swaps during joining can cause high price impact. To solve this, we've developed a zero-impact join feature that lets users join a YAMM pool with just cASSETs, minimizing price impact.

The zero-impact join includes two steps:

  1. Refract a portion of the cASSET into pool maturities.
  2. Use the remaining cASSET and pASSETs to join the pool.

The user receives LP tokens and yASSETs from the initial refraction.

To refract the correct amount of cASSET for each maturity, we need to get the right proportion of each token to join the pool. If the pool contains n+1n+1 tokens with balances {B0,B1,...,Bn}\{B_0,B_1, ..., B_n\}, where B0B_0 is the cASSET balance and the others are pASSETs, we calculate the required cASSET amount to refract for each token to match the pASSET balance in the pool:

j>0Cj=Bjρe\forall_{j>0} C_j = \frac{B_j}{\rho_e}

Here, ρe\rho_e is the refractor's effective exchange rate, accounting for the protocol fee. The effective exchange rate can be calculated as ρe=(1ϕ)×exchangeRate\rho_e = (1-\phi) \times \text{exchangeRate}. After determining the amount of cASSET necessary to match the actual balances in the pool, we can calculate the total cASSET required using the following formula:

Ctotal=B0+j>0Cj=B1+j>0BjρeC_{total} = B_0 + \sum_{j>0}C_j = B_1 + \frac{\sum_{j>0}B_j}{\rho_e}

This allows us to establish the ratio associated with each pASSET:

j>0rj=CjCtotal=BjρeB1+j>0Bj\forall_{j>0} r_j = \frac{C_j}{C_{total}} = \frac{B_j}{\rho_e B_1 + \sum_{j>0}B_j}

In these equations, we assume jnj\leq n to iterate through the pool's tokens.

Using these ratios, we can calculate the amount of cASSET to refract for each maturity, represented as rj×Cinr_j \times C_{\text{in}}, where CinC_{\text{in}} is the user-supplied input cASSET amount.

YAsset Trading

YAMM pools are designed to facilitate trading between cASSET, pASSET, and yASSETs. However, the pool structure includes just cASSET and pASSET, which makes direct yASSET trades impossible via the weighted pool equations. To allow such trades, we employ flash loans and interact with the refractor module. Note that YAMM pools only support trading between yASSET and cASSET (or vice versa), while trades involving yASSET and pASSETs necessitate two-step batch swaps.

Buying yASSETs: The buying process for yASSETs follows these steps:

  1. Borrow a cASSET amount, cloanc_{loan}, from ammVault.
  2. Refract the cin+cloanc_{in}+c_{loan} amount.
  3. Trade all received pAssets for cAssets to repay the loan, and provide the yAsset to the user.

The loan amount needs precise computation to carry out these steps. Assuming that the Refractor module has a fee ratio of ϕR\phi_R and an exchange rate of ERE_R, let ρ=ϕR×ER\rho = \phi_R \times E_R denote the effective exchange rate of the refractor. Thus, the refracted pASSET would be ρ×(cin+cloan)\rho \times (c_{in}+c_{loan}). As outlined in the steps, we must sell this pAsset for cAsset to recover the loan amount.

We now define a few parameters and functions to simplify our calculations.

cloan=kBo(1(kBikBi+(1ϕ)ρ(cin+cloan))wiwo)c_{\mathrm{loan}}=k B_o\left(1-\left(\frac{k B_i}{k B_i+(1-\phi) \rho\left(c_{\mathrm{i} n}+c_{\mathrm{loan}}\right)}\right)^{\frac{w_i}{w_o}}\right)

In the formula above, i,oi, o stand for the pAsset and cAsset indices, respectively. We also define the function g(x)g(x) as below for added clarity.

g(x)=(kBikBi+(1ϕ)ρ(cin+x))wiwog(x)=\left(\frac{k B_i}{k B_i+(1-\phi) \rho\left(c_{\mathrm{i} n}+x\right)}\right)^{\frac{w_i}{w_o}}

We further define the function f(x)f(x) as:

f(x)=1kBox1+g(x)f(x)=\frac{1}{k B_o} x-1+g(x)

We now can apply newton method steps as:

x1=cinpAssetPriceyAssetPricexn+1=xnxnkBo+kBog(xn)1+kBog(xn)x_1 = c_in * \frac{pAssetPrice}{yAssetPrice} \\ x_{n+1}=x_n-\frac{x_n-k B_o+k B_o g\left(x_n\right)}{1+k B_o g^{\prime}\left(x_n\right)}

This Newton method applies for a maximum of 15 steps or stops early if the following condition is met:

xn+1xn<xn×1e10|x_{n+1}-x_{n}| < x_n\times 1e^{-10}

Recall that this method approximates the loan amount. However, for practical purposes, we need to ensure that we can repay the loan. To make allowances for any estimation errors, we propose a loan fee, which is adjusted by the BuyYGivenInLoanFeeRatio parameter. This fee is deducted from the cinc_{in} before applying the Newton method, and later added back to the amount being refracted. Consequently, we only need to replace cinc_{in} in the Newton method with cin×(1feeRatio)c_{in}\times (1-feeRatio). Nevertheless, when we want to perform the refraction, we use the actual cin+cloanc_{in}+c_{loan}.

Buying yASSET given out: This scenario indicates that we know the yASSET amount and we must calculate the required cASSET. Let's assume that the refractor converts an amount of cASSET into another amount using a function R\mathcal{R}. Given that the output amount is youty_{out} and C=cin+cloanC = c_{in}+c_{loan}, we have:

R(C)=youtR1(yout)=C\mathcal{R}(C) = y_{out} \\ \Leftrightarrow \mathcal{R}^{-1}(y_{out}) = C

With the quantity CC, we then refract this amount and acquire yr=pry_{r}=p_{r} amounts of yAsset and pAsset respectively. Due to rounding errors if yr<youty_r < y_{out} the opration fails but if yryouty_r \ge y_{out} we take the required output amount for the user and the remaining is taken as fee. The computation of cloanc_{loan} and cinc_{in} amounts can be done by trading prp_r for the cAsset. The output amount becomes cloanc_{loan}, and cin=Ccloanc_{in} = C - c_{loan}.

The challenge lies in figuring out the value of CC. Given the refractor equations with roundings and an exchange rate of EE, we formulate as follows:

(CC×ϕr)×E=youtyout is integer  (CC×ϕr)×EyoutC×ϕrC×ϕr  CC×ϕryoutEC(1ϕr)youtECyoutE×(1ϕr)\begin{align} & \lfloor \left( C-\lceil C \times \phi_r \rceil \right) \times E \rfloor = y_{out} \\ \underrightarrow{y_{out} \text{ is integer } \ } & \left( C-\lceil C \times \phi_r \rceil \right) \times E \ge y_{out} \\ \underrightarrow{\lceil C \times \phi_r \rceil \ge C \times \phi_r \ \ } & C- C \times \phi_r \ge \frac{y_{out}}{E} \\ \Rightarrow & C(1 -\phi_r) \ge \frac{y_{out}}{E} \\ \Rightarrow & C \ge \frac{y_{out}}{E \times (1 -\phi_r)} \end{align}

This set of equations helps us determine the value of CC, ensuring the trades can be executed efficiently.

The process can also be given as follows:

(CC×ϕr)×E=youtyout is integer  (CC×ϕr)×Eyout+1C×ϕr(C×ϕr+1)  CC×ϕr1youtE+1EC(1ϕr)youtE+1E+1CyoutE×(1ϕr)+1+EE×(1ϕr)C is integer  CyoutE×(1ϕr)+1+EE×(1ϕr)\begin{align} & \lfloor \left( C-\lceil C \times \phi_r \rceil \right) \times E \rfloor = y_{out} \\ \underrightarrow{y_{out} \text{ is integer } \ } & \left( C-\lceil C \times \phi_r \rceil \right) \times E \le y_{out} + 1 \\ \underrightarrow{\lceil C \times \phi_r \rceil \le (C \times \phi_r + 1) \ \ } & C- C \times \phi_r - 1 \le \frac{y_{out}}{E} + \frac{1}{E} \\ \Rightarrow & C(1 -\phi_r) \le \frac{y_{out}}{E} + \frac{1}{E} + 1\\ \Rightarrow & C \le \frac{y_{out}}{E \times (1 -\phi_r)} + \frac{1 + E }{E \times (1 -\phi_r)} \\ \underrightarrow{C \text{ is integer } \ } & C \le \left\lfloor \frac{y_{out}}{E \times (1 -\phi_r)} + \frac{1 + E }{E \times (1 -\phi_r)} \right\rfloor \end{align}

We can use the right-hand side of equation (11) as an estimate for CC, which also satisfies equation (5). Therefore, we get:

C=youtE×(1ϕr)+1+EE×(1ϕr)C = \left\lfloor \frac{y_{out}}{E \times (1 -\phi_r)} + \frac{1 + E }{E \times (1 -\phi_r)} \right\rfloor

Note that if rounding errors were not considered, we would have:

Cfloat=youtE×(1ϕr)C_{float} = \frac{y_{out}}{E \times (1 -\phi_r)}

Hence, the impact of considering rounding is accounted for the fraction 1+EE×(1ϕr)\frac{1 + E }{E \times (1 -\phi_r)}. If the refractor fee is less than 0.50.5 (which is reasonable), this value would be less than 2+2E2 + \frac{2}{E}. Assuming that the exchange rate is at least 1 (a reasonable assumption), the error would, at most, be 4. Given that cASSET has a 6-decimal place precision, this error translates to 4×1064\times 10^{-6} cASSET, a relatively insignificant value.

Selling yAssets: If a trader intends to sell a yAsset quantity aa to gain cAsset, the protocol must perform these steps:

  1. Borrow a suitable cloan c_{\text {loan }} quantity of cAsset.
  2. Trade the cloan c_{\text {loan }} cAsset amount to receive a quantity aa of pAsset.
  3. Redeem the aa amounts of pAsset and yAsset in the refractor module to get cAsset.
  4. Use the acquired cAsset amount to repay the loan. The remaining cAsset goes to the trader.

In this context, the loan amount does not necessitate complex calculations or estimates. Since we know the required pASSET amount from the trade in step 2, we can execute a swap given out. The AMM's core equations take care of computing the loan amount.

Selling yAssets given out: Let's consider a situation where the trader wants to receive a specific cAsset amount cout c_{\text {out }}, and we must compute the yAsset quantity aa that the trader needs to sell.

Let's consider ρ\rho as the effective refractor exchange rate (encompassing the fee). Given that refracting a cASSET amount cc results in a pAsset quantity of ρc\rho c, we get:

cout+cloan=aρ.c_{\mathrm{out}}+c_{\mathrm{loan}}=\frac{a}{\rho} .

Similarly, the cAsset amount cloan c_{\text {loan }} can be determined as:

cloan =kBi1ϕ((kBokBoa)wowi1).c_{\text {loan }}=\frac{k B_i}{1-\phi}\left(\left(\frac{k B_o}{k B_o-a}\right)^{\frac{w_o}{w_i}}-1\right) .

Here, ii refers to the cAsset index and oo refers to the pAsset index. Let's define g:R>0Rg: \mathbb{R}_{>0} \rightarrow \mathbb{R} as:

g(x)=kBi1ϕ((kBokBox)wowi1)g(x)=\frac{k B_i}{1-\phi}\left(\left(\frac{k B_o}{k B_o-x}\right)^{\frac{w_o}{w_i}}-1\right)

Therefore, cloan =g(a)c_{\text {loan }}=g(a) and

aρ=cout+cloan =cout+g(a).\frac{a}{\rho}=c_{\mathrm{out}}+c_{\text {loan }}=c_{\mathrm{out}}+g(a) .

This leads to:

cout+g(a)aρ=0.c_{\mathrm{out}}+g(a)-\frac{a}{\rho}=0 .

Applying Newton's method to find the value of aa. Let's define f:R>0Rf: \mathbb{R}{>0} \rightarrow \mathbb{R} as:

f(x)=cout+g(x)1ρx.f(x)=c{\mathrm{out}}+g(x)-\frac{1}{\rho} x.

We proceed with setting x1=cout yAssetPricex_1 = \frac{c_{\text {out }}}{yAssetPrice} and, for each nNn \in \mathbb{N}, we define:

xn+1=xnf(xn)f(xn).x_{n+1}=x_n-\frac{f\left(x_n\right)}{f^{\prime}\left(x_n\right)} .

Consequently,

xn+1=xnf(xn)f(xn)=xncout+g(xn)1ρxng(xn)1ρ.x_{n+1}=x_n-\frac{f\left(x_n\right)}{f^{\prime}\left(x_n\right)}=x_n-\frac{c_{\mathrm{out}}+g\left(x_n\right)-\frac{1}{\rho} x_n}{g^{\prime}\left(x_n\right)-\frac{1}{\rho}} .

Given that the yiny_{in} amount is computed iteratively using the Newton method, approximation errors are likely. These errors might cause the operation to fail if the merge output is insufficient to pay the loan amount. To prevent this, we compute a fee using fee=YammSellYGivenOutFeeRatiocoutfee=YammSellYGivenOutFeeRatio*c_{out}, and calculate the loan amount as if youty_{out} was equal to the 'actual youty_{out}' plus the fee. For the merge and swap processes, the 'actual youty_{out}' is used, and the fee is disregarded.

Refractor action computation: Note that all these yAsset trade types include a step of interaction with the refractor module. Given that the vault in this module is different from the AMM module vault, actual bank transfers are necessary to carry out these operations. In normal swaps, as previously described, we don't transfer any amount until the operation's end. At that point, we offset the input/output amounts and then execute the transfers. To maintain this convention here, in each yAsset trade, we don't execute the refract/redeem actions. Instead, we use the refractor API to compute the actions. These actions are aggregated together and executed at the end of the entire swap or batch swap operation.

YAMM Pool Configurations

In the YAMM pool design, we've introduced unique parameters not found in other Weighted pool types. Each pool stores these parameters in the following structure:


message YammConfiguration {
uint64 pool_id = 1;

string lambda = 2 [
(cosmos_proto.scalar) = "cosmos.Dec",
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
(gogoproto.nullable) = true
];

// duration (milliseconds) for virtual balance when adding new pAssets to yamm pools
string maturity_introduction_interval_millis = 3 [
(cosmos_proto.scalar) = "cosmos.Int",
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
(gogoproto.nullable) = true
];
string maturity_expiration_interval_millis = 4 [
(cosmos_proto.scalar) = "cosmos.Int",
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
(gogoproto.nullable) = true
];

string introduction_virtual_balance_scaler = 5 [
(cosmos_proto.scalar) = "cosmos.Dec",
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
(gogoproto.nullable) = true
];

string expiration_virtual_balance_scaler = 6 [
(cosmos_proto.scalar) = "cosmos.Dec",
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
(gogoproto.nullable) = true
];

// if the value is not set, will be read from module parameters
string buy_y_given_in_loan_fee_ratio = 7 [
(cosmos_proto.scalar) = "cosmos.Dec",
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
(gogoproto.nullable) = true
];

// if the value is not set, will be read from module parameters
string sell_y_given_out_fee_ratio = 8 [
(cosmos_proto.scalar) = "cosmos.Dec",
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
(gogoproto.nullable) = true
];

string max_alpha = 9 [
(cosmos_proto.scalar) = "cosmos.Dec",
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
(gogoproto.nullable) = true
];

string avg_monthly_yield_rate = 10 [
(cosmos_proto.scalar) = "cosmos.Dec",
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
(gogoproto.nullable) = true
];

string yield_fee_scaler = 11 [
(cosmos_proto.scalar) = "cosmos.Dec",
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
(gogoproto.nullable) = true
];
}
  • pool_id: YAMM pool ID.
  • lambda: Pool's λ\lambda parameter.
  • maturity_introduction_interval_millis: Duration (in milliseconds) of the virtual balance for new pAssets in YAMM pools.
  • maturity_expiration_interval_millis: Duration (in milliseconds) of the virtual balance for removed pAssets from YAMM pools.
  • introduction_virtual_balance_scaler: Scaler for the virtual balance of new pAssets.
  • expiration_virtual_balance_scaler: Scaler for the virtual balance of removed pAssets.
  • buy_y_given_in_loan_fee_ratio: Loan fee ratio for purchasing yASSET.
  • sell_y_given_out_fee_ratio: Fee ratio for selling yASSET.
  • max_alpha: Maximum number for clipping the α\alpha parameter.
  • avg_monthly_yield_rate: The rr parameter in trading fee equations.
  • yield_fee_scaler: The ν\nu parameter in trading fee equations.

If a parameter value is unset, it defaults to the module parameters.