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

Implement Initial Enforcement of Offers in RFQ System #1403

Open
levmi opened this issue Feb 19, 2025 · 0 comments
Open

Implement Initial Enforcement of Offers in RFQ System #1403

levmi opened this issue Feb 19, 2025 · 0 comments

Comments

@levmi
Copy link
Collaborator

levmi commented Feb 19, 2025

Per planning discussion yesterday, we want to enable the enforcement of offers within the RFQ system. Currently, we can register basic offers with the RFQ system via RPC. However, these offer limitations are not actually enforced. This is evident in the following commented-out code:

// TODO(ffranr): Reformulate once BuyOffer fields have been revised.
offerAvailable := n.HasAssetBuyOffer(
request.AssetSpecifier, uint64(request.PaymentMaxAmt),
)
if !offerAvailable {
log.Infof("Would reject sell request: no suitable buy offer, " +
"but ignoring for now")
// TODO(ffranr): Re-enable pre-price oracle rejection (i.e.
// reject on missing offer)
// If we do not have a suitable buy offer, then we will reject
// the asset sell quote request with an error.
// reject := rfqmsg.NewReject(
// request.Peer, request.ID,
// rfqmsg.ErrNoSuitableBuyOffer,
// )
// go sendOutgoingMsg(reject)
//
// return nil
}
This lack of enforcement applies to both buy and sell offers.

We'd like to take the initial step towards enforcing those offers. It's also worth noting that the RFQ counterparty is currently unaware of these offers. They serve purely as a local mechanism for asset channel management in relation to RFQ.

So, the minimum initial step is uncommenting the code

// TODO(ffranr): Reformulate once BuyOffer fields have been revised.
offerAvailable := n.HasAssetBuyOffer(
request.AssetSpecifier, uint64(request.PaymentMaxAmt),
)
if !offerAvailable {
log.Infof("Would reject sell request: no suitable buy offer, " +
"but ignoring for now")
// TODO(ffranr): Re-enable pre-price oracle rejection (i.e.
// reject on missing offer)
// If we do not have a suitable buy offer, then we will reject
// the asset sell quote request with an error.
// reject := rfqmsg.NewReject(
// request.Peer, request.ID,
// rfqmsg.ErrNoSuitableBuyOffer,
// )
// go sendOutgoingMsg(reject)
//
// return nil
}
here so that we avoid a dead RPC endpoint. Then, related to #1362, we can think carefully about the path forward to enable the functionality that we want.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant