-
Notifications
You must be signed in to change notification settings - Fork 111
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
Merge feature-branch RFQ fixedpoint commits into main #1155
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This commit introduces the `BigInt.String` method, which can be used to safely (without overflow) export a `BigInt` to RPC or JSON.
This commit introduces a type alias for a fixed-point type where the coefficient is a `big.Int`.
This commit introduces a `big.Int` fixed-point constant representing the number of milli-satoshis in one BTC.
This commit updates the RFQ price oracle's `QueryRateTick` endpoint to return asset-to-BTC conversion rates as fixed-point numbers.
This commit replaces the BuyRequest.BipPrice field with SuggestedAssetRate, changing a `uint64` price to an asset-to-BTC rate represented as a fixed-point number.
This commit replaces the BuyAccept.AskPrice field with AssetRate, changing a `uint64` price to an asset-to-BTC rate represented as a fixed-point number.
This commit changes the PeerAcceptedBuyQuote.AskPrice field from a `uint64` to a fixed-point representation for the asset-to-BTC rate. It also updates the invoice milli-sat calculation to use the newly introduced fixed-point field.
This commit modifies the AssetSalePolicy struct to carry the asset-to-BTC rate instead of a "price". It also updates the policy check equations to use the new rate field.
This commit replaces the SellRequest.AskPrice field with SuggestedAssetRate, changing a `uint64` price to an asset-to-BTC rate represented as a fixed-point number.
This commit replaces the SellAccept.BidPrice field with AssetRate, changing a `uint64` price to an asset-to-BTC rate represented as a fixed-point number.
This test ensures that converting an asset amount to fixed-point values with different scales produces the same result when used in `UnitsToMilliSatoshi`. The test confirms that the absence of a decimal display value (scale) does not affect the final result.
Add a unit test demonstrating how a price oracle returns a TAP asset-to-BTC rate and how that rate is used to convert an asset amount into msats.
Part 1: RFQ uses fixed-points
This commit modifies the AssetPurchasePolicy struct to carry the asset-to-BTC rate instead of a "price". It also updates the policy check equations to use the new rate field.
Introduce `BigInt.Bytes` and `BigInt.FromBytes` methods for encoding and decoding `BigInt` in RFQ wire messages.
This will be used for serializing fixed-points in wire messages.
This commit updates the RFQ request wire message, renaming the `SuggestedRateTick` field to `SuggestedAssetRate` and changing its type to a fixed-point representation.
This commit replaces the RFQ accept wire message fields InOutRateTick and OutInRateTick with InAssetRate and OutAssetRate. The new fields represent the incoming asset-to-BTC rate and the outgoing asset-to-BTC rate, respectively.
Modify TLV type integers to match the latest BLIP state.
Update the minimum supported accept wire message version to 1. Adjust the version check logic to ensure that only version 1 is accepted, and not any version greater than 0.
…mple rfqmath: simplify price oracle rate example
Update TLV type integers to align with the latest BLIP state. Some integer values are intentionally skipped to reserve space for new fields defined in the BLIP.
Update the minimum supported request wire message version to 1. Adjust the version check logic to ensure that only version 1 is accepted, and not any version greater than 0.
Part 2: RFQ uses fixed-points
# Conflicts: # docs/examples/basic-price-oracle/go.sum # docs/examples/basic-price-oracle/main.go
ffranr
force-pushed
the
approved-rfq-fixedpoint
branch
from
October 19, 2024 01:05
d444152
to
0bdc03f
Compare
Pull Request Test Coverage Report for Build 11440857483Details
💛 - Coveralls |
dstadulis
changed the title
Merge approved RFQ fixedpoint changes
Merge feature-branch RFQ fixedpoint commits into main
Oct 21, 2024
guggero
approved these changes
Oct 21, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🎉
I think we should rebase the branch though, instead of merging main
into it.
ffranr
force-pushed
the
approved-rfq-fixedpoint
branch
2 times, most recently
from
October 21, 2024 13:10
f6b3711
to
0bdc03f
Compare
Will merge once @Roasbeef reviews |
Roasbeef
approved these changes
Oct 21, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🎽
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR will merge approved commits from
approved-rfq-fixedpoint
intomain
.The commits in this PR have already been approved and reviewed here:
#1136
#1141