Skip to content

Commit

Permalink
program: init switchboard on demand (#1154)
Browse files Browse the repository at this point in the history

Co-authored-by: Mitch Gildenberg <[email protected]>
Co-authored-by: mgild <[email protected]>
Co-authored-by: Chris Heaney <[email protected]>
  • Loading branch information
4 people authored Jul 25, 2024
1 parent d7fa406 commit c4a4891
Show file tree
Hide file tree
Showing 24 changed files with 5,923 additions and 28 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Features

- program: add switchboard on demand integration ([#1154](https://github.com/drift-labs/protocol-v2/pull/1154))

### Fixes

### Breaking
Expand Down
11 changes: 11 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ exclude = [
[profile.release]
lto = "fat"
codegen-units = 1
overflow-checks = true

[profile.release.build-override]
opt-level = 3
Expand Down
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"license": "ISC",
"devDependencies": {
"@coral-xyz/anchor": "0.29.0",
"@coral-xyz/anchor-30": "npm:@coral-xyz/[email protected]",
"@project-serum/common": "0.0.1-beta.3",
"@project-serum/serum": "^0.13.38",
"@pythnetwork/client": "^2.5.1",
Expand All @@ -26,13 +27,14 @@
"dependencies": {
"@ellipsis-labs/phoenix-sdk": "1.4.2",
"@pythnetwork/pyth-solana-receiver": "^0.8.0",
"@switchboard-xyz/on-demand": "^1.2.10",
"anchor-bankrun": "^0.3.0",
"chai-bn": "^0.2.2",
"csvtojson": "^2.0.10",
"json2csv": "^5.0.7",
"rpc-websockets": "7.5.1",
"solana-bankrun": "^0.3.0",
"zstddec": "^0.1.0",
"rpc-websockets": "7.5.1"
"zstddec": "^0.1.0"
},
"scripts": {
"generate-docs": "typedoc",
Expand Down
1 change: 1 addition & 0 deletions programs/drift/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ drift-macros = { git = "https://github.com/drift-labs/drift-macros.git", rev = "
switchboard = { path = "../switchboard", features = ["no-entrypoint"] }
openbook-v2-light = { path = "../openbook_v2", features = ["no-entrypoint"] }
ahash = "=0.8.6"
switchboard-on-demand = { path = "../switchboard-on-demand", features = ["no-entrypoint"] }
byteorder = "1.4.3"

[dev-dependencies]
Expand Down
5 changes: 5 additions & 0 deletions programs/drift/src/ids.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ pub mod switchboard_program {
declare_id!("SW1TCH7qEPTdLsDHRgPuMQjbQxKdH2aBStViMFnt64f");
}

pub mod switchboard_on_demand {
use solana_program::declare_id;
declare_id!("SBondMDrcV3K4kxZR1HNVT7osZxAHVHgYXL5Ze1oMUv");
}

pub mod bonk_oracle {
use solana_program::declare_id;
#[cfg(feature = "mainnet-beta")]
Expand Down
10 changes: 10 additions & 0 deletions programs/drift/src/instructions/admin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ use crate::state::fulfillment_params::phoenix::PhoenixV1FulfillmentConfig;
use crate::state::fulfillment_params::serum::SerumContext;
use crate::state::fulfillment_params::serum::SerumV3FulfillmentConfig;
use crate::state::insurance_fund_stake::ProtocolIfSharesTransferConfig;
use crate::state::oracle::get_sb_on_demand_price;
use crate::state::oracle::{
get_oracle_price, get_prelaunch_price, get_pyth_price, get_switchboard_price,
HistoricalIndexData, HistoricalOracleData, OraclePriceData, OracleSource, PrelaunchOracle,
Expand Down Expand Up @@ -771,6 +772,15 @@ pub fn handle_initialize_perp_market(
} = get_pyth_price(&ctx.accounts.oracle, clock_slot, 1, true)?;
(oracle_price, oracle_delay, QUOTE_PRECISION_I64)
}
OracleSource::SwitchboardOnDemand => {
let OraclePriceData {
price: oracle_price,
delay: oracle_delay,
..
} = get_sb_on_demand_price(&ctx.accounts.oracle, clock_slot)?;

(oracle_price, oracle_delay, oracle_price)
}
};

validate_margin(
Expand Down
55 changes: 55 additions & 0 deletions programs/drift/src/state/oracle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ use crate::math::casting::Cast;
use crate::math::constants::{PRICE_PRECISION, PRICE_PRECISION_I64, PRICE_PRECISION_U64};
use crate::math::safe_math::SafeMath;
use switchboard::{AggregatorAccountData, SwitchboardDecimal};
use switchboard_on_demand::{PullFeedAccountData, SB_ON_DEMAND_PRECISION};

use crate::error::ErrorCode::{InvalidOracle, UnableToLoadOracle};
use crate::math::safe_unwrap::SafeUnwrap;
Expand Down Expand Up @@ -120,6 +121,7 @@ pub enum OracleSource {
Pyth1KPull,
Pyth1MPull,
PythStableCoinPull,
SwitchboardOnDemand,
}

#[derive(Default, Clone, Copy, Debug)]
Expand Down Expand Up @@ -152,6 +154,7 @@ pub fn get_oracle_price(
OracleSource::Pyth1M => get_pyth_price(price_oracle, clock_slot, 1000000, false),
OracleSource::PythStableCoin => get_pyth_stable_coin_price(price_oracle, clock_slot, false),
OracleSource::Switchboard => get_switchboard_price(price_oracle, clock_slot),
OracleSource::SwitchboardOnDemand => get_sb_on_demand_price(price_oracle, clock_slot),
OracleSource::QuoteAsset => Ok(OraclePriceData {
price: PRICE_PRECISION_I64,
confidence: 1,
Expand Down Expand Up @@ -307,6 +310,46 @@ pub fn get_switchboard_price(
})
}

pub fn get_sb_on_demand_price(
price_oracle: &AccountInfo,
clock_slot: u64,
) -> DriftResult<OraclePriceData> {
let pull_feed_account_info: Ref<PullFeedAccountData> =
load_ref(price_oracle).or(Err(ErrorCode::UnableToLoadOracle))?;

let price = convert_sb_i128(
&pull_feed_account_info
.value()
.ok_or(ErrorCode::UnableToLoadOracle)?,
)?
.cast::<i64>()?;

let confidence = convert_sb_i128(
&pull_feed_account_info
.range()
.ok_or(ErrorCode::UnableToLoadOracle)?,
)?
.cast::<i64>()?
.unsigned_abs();

let delay = clock_slot.cast::<i64>()?.safe_sub(
pull_feed_account_info
.result
.result_slot()
.ok_or(ErrorCode::UnableToLoadOracle)?
.cast()?,
)?;

let has_sufficient_number_of_data_points = true;

Ok(OraclePriceData {
price,
confidence,
delay,
has_sufficient_number_of_data_points,
})
}

/// Given a decimal number represented as a mantissa (the digits) plus an
/// original_precision (10.pow(some number of decimals)), scale the
/// mantissa/digits to make sense with a new_precision.
Expand All @@ -323,6 +366,18 @@ fn convert_switchboard_decimal(switchboard_decimal: &SwitchboardDecimal) -> Drif
}
}

/// Given a decimal number represented as a mantissa (the digits) plus an
/// original_precision (10.pow(some number of decimals)), scale the
/// mantissa/digits to make sense with a new_precision.
fn convert_sb_i128(switchboard_i128: &i128) -> DriftResult<i128> {
let switchboard_precision = 10_u128.pow(SB_ON_DEMAND_PRECISION);
if switchboard_precision > PRICE_PRECISION {
switchboard_i128.safe_div((switchboard_precision / PRICE_PRECISION) as i128)
} else {
switchboard_i128.safe_mul((PRICE_PRECISION / switchboard_precision) as i128)
}
}

pub fn get_prelaunch_price(price_oracle: &AccountInfo, slot: u64) -> DriftResult<OraclePriceData> {
let oracle: Ref<PrelaunchOracle> = load_ref(price_oracle).or(Err(UnableToLoadOracle))?;

Expand Down
35 changes: 35 additions & 0 deletions programs/drift/src/state/oracle/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,3 +91,38 @@ fn pyth_pull_1m() {
let twap = amm.get_oracle_twap(&bonk_market_account_info, 0).unwrap();
assert_eq!(twap, Some(33576300));
}

#[test]
fn switchboard_on_demand() {
let oracle_price_key =
Pubkey::from_str("EZLBfnznMYKjFmaWYMEdhwnkiQF1WiP9jjTY6M8HpmGE").unwrap();
let oracle_market_str = String::from("xBtsxArX2yhvXnVmrAAKlTDlax20lYV3Jxmuqu6ttNm9jCNXuI6eeBTDmRAAAAAAAAAAAAAAAAAAjEqO4Us2LgkAAAAAAAAA4+UTCQLD6cJ5F3iXafGuBd4Vz1BGWL6v7tLFmKlJs7cUw5kQAAAAAAAAAAAAAAAAAIxKjuFL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ut decoded_bytes = base64::decode(oracle_market_str).unwrap();
let oracle_market_bytes = decoded_bytes.as_mut_slice();
let mut lamports = 0;
let sb_program = crate::ids::switchboard_on_demand::id();
let sol_oracle_info = create_account_info(
&oracle_price_key,
true,
&mut lamports,
oracle_market_bytes,
&sb_program,
);

let oracle_price_data = get_oracle_price(
&OracleSource::SwitchboardOnDemand,
&sol_oracle_info,
278512416,
)
.unwrap();
assert_eq!(oracle_price_data.price, 169350629);

let amm = AMM {
oracle_source: OracleSource::SwitchboardOnDemand,
..AMM::default()
};

let twap = amm.get_oracle_twap(&sol_oracle_info, 0).unwrap();
assert_eq!(twap, Some(169350629));
}
22 changes: 22 additions & 0 deletions programs/drift/src/state/oracle_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,19 @@ impl<'a> OracleMap<'a> {
},
);

continue;
} else if account_info.owner == &switchboard_on_demand::id() {
let account_info = account_info_iter.next().safe_unwrap()?;
let pubkey = account_info.key();

oracles.insert(
pubkey,
AccountInfoAndOracleSource {
account_info: account_info.clone(),
oracle_source: OracleSource::SwitchboardOnDemand,
},
);

continue;
}

Expand Down Expand Up @@ -396,6 +409,15 @@ impl<'a> OracleMap<'a> {
oracle_source: OracleSource::Switchboard,
},
);
} else if account_info.owner == &switchboard_on_demand::id() {
let pubkey = account_info.key();
oracles.insert(
pubkey,
AccountInfoAndOracleSource {
account_info: account_info.clone(),
oracle_source: OracleSource::SwitchboardOnDemand,
},
);
} else if account_info.key() != Pubkey::default() {
return Err(ErrorCode::InvalidOracle);
}
Expand Down
16 changes: 10 additions & 6 deletions programs/drift/src/state/perp_market.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ use crate::math::stats;
use crate::state::events::OrderActionExplanation;

use crate::state::oracle::{
get_prelaunch_price, get_switchboard_price, HistoricalOracleData, OracleSource,
get_prelaunch_price, get_sb_on_demand_price, get_switchboard_price, HistoricalOracleData,
OracleSource,
};
use crate::state::spot_market::{AssetTier, SpotBalance, SpotBalanceType};
use crate::state::traits::{MarketIndexOffset, Size};
Expand Down Expand Up @@ -616,16 +617,16 @@ pub struct InsuranceClaim {
/// The amount of revenue last settled
/// Positive if funds left the perp market,
/// negative if funds were pulled into the perp market
/// precision: QUOTE_PRECISION
/// precision: QUOTE_PRECISION
pub revenue_withdraw_since_last_settle: i64,
/// The max amount of revenue that can be withdrawn per period
/// precision: QUOTE_PRECISION
/// precision: QUOTE_PRECISION
pub max_revenue_withdraw_per_period: u64,
/// The max amount of insurance that perp market can use to resolve bankruptcy and pnl deficits
/// precision: QUOTE_PRECISION
/// precision: QUOTE_PRECISION
pub quote_max_insurance: u64,
/// The amount of insurance that has been used to resolve bankruptcy and pnl deficits
/// precision: QUOTE_PRECISION
/// precision: QUOTE_PRECISION
pub quote_settled_insurance: u64,
/// The last time revenue was settled in/out of market
pub last_revenue_withdraw_ts: i64,
Expand Down Expand Up @@ -871,7 +872,7 @@ pub struct AMM {
/// the update intensity of AMM formulaic updates (adjusting k). 0-100
pub curve_update_intensity: u8,
/// the jit intensity of AMM. larger intensity means larger participation in jit. 0 means no jit participation.
/// (0, 100] is intensity for protocol-owned AMM. (100, 200] is intensity for user LP-owned AMM.
/// (0, 100] is intensity for protocol-owned AMM. (100, 200] is intensity for user LP-owned AMM.
pub amm_jit_intensity: u8,
/// the oracle provider information. used to decode/scale the oracle public key
pub oracle_source: OracleSource,
Expand Down Expand Up @@ -1298,6 +1299,9 @@ impl AMM {
OracleSource::Pyth1K => Ok(Some(self.get_pyth_twap(price_oracle, 1000, false)?)),
OracleSource::Pyth1M => Ok(Some(self.get_pyth_twap(price_oracle, 1000000, false)?)),
OracleSource::Switchboard => Ok(Some(get_switchboard_price(price_oracle, slot)?.price)),
OracleSource::SwitchboardOnDemand => {
Ok(Some(get_sb_on_demand_price(price_oracle, slot)?.price))
}
OracleSource::QuoteAsset => {
msg!("Can't get oracle twap for quote asset");
Err(ErrorCode::DefaultError)
Expand Down
25 changes: 25 additions & 0 deletions programs/switchboard-on-demand/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
[package]
name = "switchboard-on-demand"
version = "0.1.0"
edition = "2021"

[lib]
crate-type = ["cdylib", "lib"]
name = "switchboard_on_demand"

[features]
no-entrypoint = []
no-idl = []
cpi = ["no-entrypoint"]
default = ["mainnet-beta"]
mainnet-beta=[]
anchor-test= []

[dependencies]
anchor-lang = "0.29.0"
bytemuck = { version = "1.4.0" }
solana-program = "1.16"

[dev-dependencies]
base64 = "0.13.0"

Loading

0 comments on commit c4a4891

Please sign in to comment.