Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use pyth sdk + tests #113

Merged
merged 20 commits into from
Dec 13, 2022
Merged

Use pyth sdk + tests #113

merged 20 commits into from
Dec 13, 2022

Conversation

0xripleys
Copy link

@0xripleys 0xripleys commented Nov 21, 2022

  1. use PriceAccount and Product account from pyth-sdk-solana . removed some old code if there was a nicer way to do it with the sdk
  2. use get_price_no_older_than (link). This lets us use the pyth price even if pyth hasn't updated in the last 2 minutes.
  3. fix bpf tests
  4. add tests for the get_pyth_price function
  5. remove pyth.rs

partially addresses #111

@0xripleys 0xripleys changed the title 0xripleys use pyth client and allow grabbing a slightly stale pyth price use pyth client and allow grabbing a slightly stale pyth price Nov 21, 2022
@0xripleys 0xripleys changed the title use pyth client and allow grabbing a slightly stale pyth price Use pyth sdk + tests Nov 23, 2022
@codecov-commenter
Copy link

codecov-commenter commented Nov 24, 2022

Codecov Report

Merging #113 (83b5b9a) into upcoming (c602b70) will increase coverage by 0.51%.
The diff coverage is 93.87%.

@@             Coverage Diff              @@
##           upcoming     #113      +/-   ##
============================================
+ Coverage     78.83%   79.35%   +0.51%     
============================================
  Files            34       35       +1     
  Lines          9021     9115      +94     
============================================
+ Hits           7112     7233     +121     
+ Misses         1909     1882      -27     
Impacted Files Coverage Δ
token-lending/program/tests/flash_borrow_repay.rs 88.72% <0.00%> (ø)
token-lending/program/src/state/obligation.rs 92.91% <50.00%> (ø)
token-lending/program/src/processor.rs 71.91% <71.42%> (+0.64%) ⬆️
token-lending/program/src/oracles.rs 96.55% <96.55%> (ø)
token-lending/program/src/state/lending_market.rs 97.05% <100.00%> (ø)
token-lending/program/src/state/reserve.rs 93.17% <100.00%> (ø)
...nding/program/tests/borrow_obligation_liquidity.rs 98.41% <100.00%> (+0.10%) ⬆️
token-lending/program/tests/helpers/mod.rs 88.93% <100.00%> (+0.08%) ⬆️
token-lending/program/tests/init_reserve.rs 100.00% <100.00%> (ø)
...ken-lending/program/tests/obligation_end_to_end.rs 99.38% <100.00%> (+<0.01%) ⬆️
... and 3 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@0xripleys 0xripleys merged commit 92d38cf into upcoming Dec 13, 2022
@0xripleys 0xripleys deleted the 0xripleys_use_pyth_client branch January 25, 2023 10:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants