Skip to content

Commit 9eae066

Browse files
authored
Switch pull oracles (#231)
Adds support for switch pull oracles (aka sb-on-demand) when configuring a bank.
1 parent 2e8830d commit 9eae066

File tree

13 files changed

+472
-16
lines changed

13 files changed

+472
-16
lines changed

Cargo.lock

Lines changed: 120 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ anchor-client = { git = "https://github.com/mrgnlabs/anchor.git", rev = "fdcf299
3131
pyth-sdk-solana = "=0.10.1"
3232
pyth-solana-receiver-sdk = "0.3.0"
3333
switchboard-solana = "0.29.0"
34+
switchboard-on-demand = "0.1.13"
3435
borsh = "0.10.3"
3536

3637
[profile.release]

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,3 +71,14 @@ Run `./scripts/verify_mainnet.sh`
7171
Integration tests for the on-chain marginfi programs are located under
7272
`/programs/marginfi/tests`. To run the tests, use `cargo test-bpf`. Be sure to
7373
use an x86 toolchain when compiling and running the tests.
74+
75+
Run the full test suite with `.scripts/test-program.sh <program_to_test>`
76+
* e.g. `.scripts/test-program.sh all --sane`
77+
78+
Run a single test:
79+
`.scripts/test-program.sh <program_to_test> <name_of_test>`
80+
* e.g. `.scripts/test-program.sh marginfi configure_bank_success --verbose`
81+
82+
## Footguns
83+
84+
Debugging `I80F48`s by `msg!("val: {:?}", some_val_I80F48);` can cause silent build issues leading to `Program is not deployed`. Convert these values to string before printing them.

programs/marginfi/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ anchor-spl = { workspace = true }
3535
pyth-sdk-solana = { workspace = true }
3636
pyth-solana-receiver-sdk = { workspace = true }
3737
switchboard-solana = { workspace = true }
38+
switchboard-on-demand = { workspace = true }
3839
borsh = "0.10.3"
3940

4041
bytemuck = "1.9.1"

0 commit comments

Comments
 (0)