Instrument Return Oracles
Last updated
Last updated
Oracles that feed in returns data of the underlying instrument serve a pivotal role in determining the /issuance price of longZCB
tokens. It is important that these data feeds are resistant to manipulations within a block (i.e flash loans to increase/decrease the price of longZCB
) to prevent attacks and drainage.
lastRate
is the last recorded exchange rate between an instrument's underlying(i.e USDC) vs its shares. For perpetual instruments, the exchange rate between the instrument's shares and its underlying reflects the socialized profit & loss of the instrument.lastOracleRate
could be manipulated over short time frames (such as via flash loans) to display a rate that does not reflect the true returns generated by the instrument at a particular time.
These limitations make the lastRate
insecure as a price oracle by which to longZCB tokens. Given that RAMM allows users to issue/redeem longZCB at this valued price, we need to ensure that the exchange rate oracle used to value can't be manipulated.
As such, RAMM uses the lastOracleRate, a time linear interpolation of the lastRate and the lastOracleRate, to value longZCB tokens.
For fixed term fixed rate instruments, the balance of the instrument contract when they are resolved at maturity determines the redemption price of longZCB
/shortZCB
tokens. These can't be manipulated via flash loans as the written logic requires the redemption price to be computed at least a block after the instrument has been resolved.