USD-Pegged Expert Rates via Price Oracle
Background
XLM price volatility makes it hard for experts to quote stable hourly rates. Experts should be able to set rates in USD and have the contract convert at the current XLM/USD rate.
Goal
Integrate a Soroban-compatible price oracle to fetch the current XLM/USD rate at session start and lock it for the session duration.
Acceptance Criteria
ExpertProfile.rate_currency field: XLM or USD.
start_session fetches oracle price if rate_currency == USD and stores locked_xlm_rate.
- Streaming math uses
locked_xlm_rate for duration of session.
- Oracle call fails gracefully with
Error::OraclePriceUnavailable (falls back to direct XLM rate).
Key Files
contracts/src/lib.rs, contracts/src/oracles.rs
USD-Pegged Expert Rates via Price Oracle
Background
XLM price volatility makes it hard for experts to quote stable hourly rates. Experts should be able to set rates in USD and have the contract convert at the current XLM/USD rate.
Goal
Integrate a Soroban-compatible price oracle to fetch the current XLM/USD rate at session start and lock it for the session duration.
Acceptance Criteria
ExpertProfile.rate_currencyfield:XLMorUSD.start_sessionfetches oracle price ifrate_currency == USDand storeslocked_xlm_rate.locked_xlm_ratefor duration of session.Error::OraclePriceUnavailable(falls back to direct XLM rate).Key Files
contracts/src/lib.rs,contracts/src/oracles.rs