Skip to content

Commit

Permalink
rfq: improve BuyOrder doc
Browse files Browse the repository at this point in the history
  • Loading branch information
ffranr committed Nov 6, 2024
1 parent 67adb56 commit ea82831
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion rfq/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -688,7 +688,25 @@ func (m *Manager) UpsertAssetBuyOffer(offer BuyOffer) error {
return nil
}

// BuyOrder is a struct that represents a buy order.
// BuyOrder instructs the RFQ (Request For Quote) system to request a quote from
// a peer for the acquisition of an asset.
//
// The normal use of a buy order is as follows:
// 1. Alice, operating a wallet node, wants to receive a Tap asset as payment
// by issuing a Lightning invoice.
// 2. Alice has an asset channel established with Bob's edge node.
// 3. Before issuing the invoice, Alice needs to agree on an exchange rate with
// Bob, who will facilitate the asset transfer.
// 4. To obtain the best exchange rate, Alice creates a buy order specifying
// the desired asset.
// 5. Alice's RFQ subsystem processes the buy order and sends buy requests to
// relevant peers to find the best rate. In this example, Bob is the only
// available peer.
// 6. Once Bob provides a satisfactory quote, Alice accepts it.
// 7. Alice issues the Lightning invoice, which Charlie will pay.
// 8. Instead of paying Alice directly, Charlie pays Bob.
// 9. Bob then forwards the agreed amount of the Tap asset to Alice over their
// asset channel.
type BuyOrder struct {
// AssetSpecifier is the asset that the buyer is interested in.
AssetSpecifier asset.Specifier
Expand Down

0 comments on commit ea82831

Please sign in to comment.