Skip to content

Conversation

@lazynina
Copy link
Member

No description provided.

@lazynina lazynina marked this pull request as ready for review January 29, 2025 01:28
@lazynina lazynina requested a review from a team as a code owner January 29, 2025 01:28
// focus launches on mainnet, the FOCUS_FLOOR_PRICE_DESO_NANOS_MAINNET value needs to be updated
// based on the price of DESO at launch.
const FOCUS_FLOOR_PRICE_DESO_NANOS_TESTNET = 166666
const FOCUS_FLOOR_PRICE_DESO_NANOS_MAINNET = 166666 // TODO: UPDATE ME.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lazynina While you're here, let's finalize this value to the following :)

  • 40000

highestBidPrice := float64(0.0)
if lowerUsername == "focus" {
highestBidPrice = float64(FOCUS_FLOOR_PRICE_DESO_NANOS) / float64(lib.NanosPerUnit)
highestBidPrice = float64(GetFocusFloorPriceDESONanos(fes.Params.NetworkType == lib.NetworkType_TESTNET)) / float64(lib.NanosPerUnit)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I always prefer pulling out the == like this:

isTestnet := fes.Params.NetworkType == lib.NetworkType_TESTNET
highestBidPrice = float64(GetFocusFloorPriceDESONanos(isTestnet)) / float64(lib.NanosPerUnit)

highestBidPrice = float64(GetFocusFloorPriceDESONanos(fes.Params.NetworkType == lib.NetworkType_TESTNET)) / float64(lib.NanosPerUnit)
}
var lowestAskPrice, midPriceDeso float64
midPriceDeso, highestBidPrice, lowestAskPrice, err = fes.GetHighestBidAndLowestAskPriceFromPKIDs(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prefer:

isFocus := lowerUsername == "focus"
midPriceDeso, highestBidPrice, lowestAskPrice, err = fes.GetHighestBidAndLowestAskPriceFromPKIDs(
			pkid.PKID, &lib.ZeroPKID, utxoView, highestBidPrice)
			pkid.PKID, &lib.ZeroPKID, utxoView, highestBidPrice, isFocus)

@lazynina lazynina merged commit 12569e4 into main Jan 29, 2025
1 of 2 checks passed
@lazynina lazynina deleted the ln/get-quote-currency-price-enhancements branch January 29, 2025 04:35
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