Skip to content

Commit

Permalink
Merge pull request #572 from helium/bugfix/pyth
Browse files Browse the repository at this point in the history
Bugfix hexboosting confidence on pyth
  • Loading branch information
ChewingGlass authored Feb 5, 2024
2 parents a739266 + c5e25df commit fbb128a
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

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

8 changes: 7 additions & 1 deletion packages/helium-admin-cli/src/create-boost-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ export async function run(args: any = process.argv) {
required: true,
describe: "The authority to reclaim rent",
},
startAuthority: {
type: "string",
required: true,
describe: "The authority to start hexes",
},
boostPrice: {
required: true,
type: "number",
Expand Down Expand Up @@ -98,7 +103,8 @@ export async function run(args: any = process.argv) {
priceOracle: new PublicKey(argv.priceOracle),
rentReclaimAuthority: new PublicKey(argv.rentReclaimAuthority),
authority: subDaoAuth,
subDao
subDao,
startAuthority: new PublicKey(argv.startAuthority)
})
.instruction(),
];
Expand Down
2 changes: 1 addition & 1 deletion programs/hexboosting/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "hexboosting"
version = "0.0.2"
version = "0.0.3"
description = "Created with Anchor"
edition = "2021"

Expand Down
2 changes: 1 addition & 1 deletion programs/hexboosting/src/instructions/boost_v0.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ pub fn handler(ctx: Context<BoostV0>, args: BoostArgsV0) -> Result<()> {
// https://docs.pyth.network/pythnet-price-feeds/best-practices
let mobile_price_with_conf = mobile_price
.price
.checked_add(i64::try_from(mobile_price.conf.checked_mul(2).unwrap()).unwrap())
.checked_sub(i64::try_from(mobile_price.conf.checked_mul(2).unwrap()).unwrap())
.unwrap();
// Exponent is a negative number, likely -8
// Since the price is multiplied by an extra 10^8, and we're dividing by that price, need to also multiply
Expand Down

0 comments on commit fbb128a

Please # to comment.