Instrument Return Oracles
Oracles that feed in returns data of the underlying instrument serve a pivotal role in determining the redemption/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.
Perpetual Instruments
Last Oracle Rate
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 value 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.
Fixed Instruments
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.
Last updated