-
Notifications
You must be signed in to change notification settings - Fork 121
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
Remove remaining instances of "rate tick" from RFQ systems #1156
Conversation
The remaining RFQ cleanup work after this PR is merge:
|
Pull Request Test Coverage Report for Build 11447101930Details
💛 - Coveralls |
3efc8a8
to
9442dc9
Compare
// | ||
// Example use case: | ||
// | ||
// Alice is trying to pay an invoice by spending an asset. Alice therefore | ||
// requests that Bob (her asset channel counterparty) purchase the asset from | ||
// her. Bob's payment, in BTC, will pay the invoice. | ||
// | ||
// Alice requests a bid quote from Bob. Her request includes a rate tick | ||
// hint (ask). Alice get the rate tick hint by calling this endpoint. She sets: | ||
// Alice requests a bid quote from Bob. Her request includes an asset rates hint |
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.
// Alice requests a bid quote from Bob. Her request includes an asset rates hint | |
// Alice requests a bid quote from Bob. Her request includes an asset-rate hint |
Or are we referring to the name of the bundle, Asset Rates?
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.
The request includes an in-asset to BTC rate hint and an out-asset to BTC rate hint.
// Alice requests a bid quote from Bob. Her request includes a rate tick | ||
// hint (ask). Alice get the rate tick hint by calling this endpoint. She sets: | ||
// Alice requests a bid quote from Bob. Her request includes an asset rates hint | ||
// (ask). Alice get the asset rates hint by calling this endpoint. She sets: |
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.
// (ask). Alice get the asset rates hint by calling this endpoint. She sets: | |
// (ask). Alice receives the asset rates hint by calling this endpoint. She sets: |
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.
I've gone with "Alice obtains". Let me know if you think "receives" is better or something else.
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.
obtains sgtm
// Deprecated: Use QueryAssetRatesResponse.ProtoReflect.Descriptor instead. | ||
func (*QueryAssetRatesResponse) Descriptor() ([]byte, []int) { |
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.
Should this be fully removed now? or are the motivations to preserve functionality?
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.
This was auto-generated by our protos generator. It's probably in place for backwards compatibility. I think we can ignore this.
"properties": { | ||
"subjectAssetRate": { | ||
"$ref": "#/definitions/priceoraclerpcFixedPoint", | ||
"description": "subjectAssetRate is the number of subject asset units per BTC represented\nas a fixed-point number. This field is also commonly referred to as the\nsubject asset to BTC (conversion) rate. When the subject asset is BTC\nmilli-satoshis (msats), this field should be set to 100 billion since\nthere are 100 billion msats in a BTC." |
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.
"description": "subjectAssetRate is the number of subject asset units per BTC represented\nas a fixed-point number. This field is also commonly referred to as the\nsubject asset to BTC (conversion) rate. When the subject asset is BTC\nmilli-satoshis (msats), this field should be set to 100 billion since\nthere are 100 billion msats in a BTC." | |
"description": "subjectAssetRate is the number of subject asset units per BTC represented\nas a fixed-point number. This field is also commonly referred to as the\nsubject asset to BTC (conversion) rate. When the subject asset is BTC\nmilli-satoshis (msats), this field should be set to 100 billion since\nthere are 100 billion msats per one bitcoin." |
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.
I've gone with:
When the subject asset is BTC,
// this field should be set to 100 billion, as one BTC is equivalent to 100
// billion msats.
}, | ||
"paymentAssetRate": { | ||
"$ref": "#/definitions/priceoraclerpcFixedPoint", | ||
"description": "paymentAssetRate is the number of payment asset units per BTC represented\nas a fixed-point number. This field is also commonly referred to as the\npayment asset to BTC (conversion) rate. When the payment asset is BTC\nmilli-satoshis (msats), this field should be set to 100 billion since\nthere are 100 billion msats in a BTC." |
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.
"description": "paymentAssetRate is the number of payment asset units per BTC represented\nas a fixed-point number. This field is also commonly referred to as the\npayment asset to BTC (conversion) rate. When the payment asset is BTC\nmilli-satoshis (msats), this field should be set to 100 billion since\nthere are 100 billion msats in a BTC." | |
"description": "paymentAssetRate is the number of payment asset units per BTC represented\nas a fixed-point number. This field is also commonly referred to as the\npayment asset to BTC (conversion) rate. When the payment asset is BTC\nmilli-satoshis (msats), this field should be set to 100 billion since\nthere are 100 billion msats per one bitcoin." |
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.
I've gone with:
When the payment asset is BTC,
// this field should be set to 100 billion, as one BTC is equivalent to 100
// billion msats.
"description": "QueryRateTickErrResponse is the error response to a rate tick query." | ||
}, | ||
"priceoraclerpcQueryRateTickResponse": { | ||
"type": "object", | ||
"properties": { | ||
"success": { | ||
"$ref": "#/definitions/priceoraclerpcQueryRateTickSuccessResponse", | ||
"description": "success is the successful response to the rate tick query." | ||
}, | ||
"error": { | ||
"$ref": "#/definitions/priceoraclerpcQueryRateTickErrResponse", | ||
"description": "error is the error response to the rate tick query." | ||
} | ||
}, | ||
"description": "QueryRateTickResponse is the response to a rate tick query." | ||
"description": "QueryAssetRatesErrResponse is the error response to a QueryAssetRates call." |
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.
Is the range of responses reduced s.t. QueryAssetRatesErrResponse encapsulates everything?
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.
QueryAssetRatesErrResponse
encapsulates all error responses from a price oracle service QueryAssetRates
endpoint call. QueryAssetRatesErrResponse
does not encapsulate every kind of response. We also have QueryAssetRatesOkResponse
.
This commit removes the "rate tick" concept from the price oracle RPC and replaces it with an asset units per BTC rate, using the new fixed-point type. This commit focuses on RPC changes. Other instances of "rate tick" will be removed in subsequent commits.
This commit removes the "rate tick" concept from the price oracle basic example.
Rename variables, constants, and uses in comments.
9442dc9
to
07ac6a4
Compare
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 🎉
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.
Thanks for the modifications!
This PR removes any remaining mention of "rate tick" from the Price Oracle RPC endpoints and the RFQ packages.