Open apbendi opened 3 years ago
underlying()
method from our IReimbursementToken
interface is never calledunderlying
and maturity
methods, so do not comform to the full FYToken
interface, but this does not seem to be a problem as only maturity
is used in YieldSpacets
, g1
, and g2
are read from the factory during Pool construction. I'm not yet clear on (1) what these values should be, (2) should they be the same for all riToken
pools, and (3) should riToken
pools have the same values as regular fyToken
pools? If (3) is "no", we need a new YieldSpace factory with different parameters. If (2) is also "no", then that new factory needs to be modified so ts
, g1
, and g2
are inputs to the createPool
method instead of storage variablesPoolFactory.createPool
, but this is behind an auth
modifier, so seems you cannot permissionlessly create poolsPoolFactory.getPool
to locate the pool a user is looking forPool.mint
to add liquidity or Pool.mintWithBase
to add liquidity by only providing the base token and buying fyTokens
from the poolPool.burn
and Pool.burnForBase
to exit the poolPool.sellBasePreview
for a quote followed by Pool.sellBase
to sell base token for fyTokenPool.buyBasePreview
for a quote followed by Pool.buyBase
to sell fyToken for base tokenfyToken
varieties. The difference seems be analogous to Uniswap's "swap exact tokens for tokens" vs. "swap tokens for exact tokens"Assuming effective interest rate is calculated as follows, but let me know if this is incorrect:
// At maturity, the token is expected to be worth `percentToAccrue` more than it is now
const percentToAccrue = (maturityValue - currentValue) / currentValue;
// Number of seconds over which that value increase will occur
const timeRemaining = riToken.maturity - (new Date().getTime() / 1000);
// Convert that interest rate into an APR (pretty sure this gives APR, not APY,
// since there's no compounding considered here)
const effectiveInterestRateAPR = percentToAccrue * secondsPerYear / timeRemaining
If so, we get maturityValue
based on the riToken
target exchange rate, currentValue
by getting a quote from the pool (what quote inputs?), and the riToken's maturity is read from its contract
Investigate the YieldSpace v2 contracts.
Key things to understand:
High level frontend spec:
Bold elements are those most likely to touch the YieldSpace contracts