[feature]: AddInvoice
: allow specifying the asset invoice amount considering both the merchant and edge nodes' exchange rates or directly in sats along with an implied_fee_limit
#1366
Labels
enhancement
New feature or request
Consider the following
For simplicity of this example, we'll assume bob and charlie don't charge any normal LN routing fees on their sats channels.
Alice wants to buy a candy bar from Frank. Alice and her price oracle thinks 1,000 assets = 10 sats.
Frank wants to be paid 40,000 taproot assets. Frank and his price oracle also thinks 1,000 assets = 10 sat, so he thinks the invoice should be 400 sats. Frank does an RFQ with Dave to get an invoice priced in sats. The invoice is for 440 sats because Dave needs to make some profit off of the deal and he his price oracle think 909 asset=10sat.
Frank gives the invoice to Alice, but she's like, what, that is way too high of a price for me, I think that is 44,000 assets, I'll go somewhere else!! Alice does not want to pay for the "implied fees" of 40 sat or 4,000 assets that dave is collecting on her to forward a payment on Frank.
The "implied fees" here from Frank's point of view are
.
On the other hand, Frank could reduce the amount that he requests to 36,500 assets. That would then result in an invoice of 401 sats. At 401 sats, alice would think she needs to send 40,100 assets. She's would be willing to send that and Frank would get the business. In this case, Frank is indirectly paying the "implied fees" because he was forced to reduce the amount that he is invoicing for.
So, as a receiver of taproot assets, Frank needs to reduce his price in order to deal with the profit Dave needs to make, otherwise he is going to loose customers.
We need a simpler way to invoke
AddInvoice
such that Frank can inputperceived_asset_market_equivalent_amount
, which is the amount of assets he thinks his customer will believe the sats in the invoice are worth based on the buy rate Frank gets from his price oracle. The existingasset_amount
that is currently input intoAddInvoice
can then be computed as follows:Alternatively, we should be able to specify the amount in
AddInvoice
in terms of sats (let's usevalue
since that is what LND'sAddInvoice
already uses) and have theasset_amount
be computed as follows:When invoking
AddInvoice
, Frank does not yet know what Dave's sell rate is yet. So, we also need to be able to put someimplied_fee_limit
on these new options. Theimplied_fee_limit
limits the "implied fees" that can be collected. An error will be returned and no invoice generated if Frank's buy rate and Dave's sell rate are too far apart. We should be able to specify thisimplied_fee_limit
in terms of percent offrank_perceived_asset_market_equivalent_amount
, sats, or assets.Note: we do have the option
experimental.rfq.acceptpricedeviationppm
(taproot-assets/sample-tapd.conf
Lines 363 to 366 in 9202f08
The text was updated successfully, but these errors were encountered: