Skip to content

Implement Initial Enforcement of Offers in RFQ System #1403

Open
@levmi

Description

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.

Activity

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

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions