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

[feature]: Replace RPC endpoints AddAssetSellOrder and AddAssetBuyOrder with InitRfq* #1165

Open
ffranr opened this issue Oct 31, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@ffranr
Copy link
Contributor

ffranr commented Oct 31, 2024

We need to update our RPC interface before the 0.4.2 release to ensure stability and prepare for asset-to-asset channel payments.

The current buy/sell terminology doesn't accurately represent asset-to-asset payments, where we divest and receive tap assets in the same event. Using buy/sell terminology also causes unnecessary complications for developers; the new endpoint should have fields that directly relate to the invoice payment process or the invoice settlement receive process.

Therefore, we should replace the AddAssetSellOrder and AddAssetBuyOrder endpoints with a new InitRfq* endpoint that initiates the RFQ process when called.

@ffranr
Copy link
Contributor Author

ffranr commented Oct 31, 2024

It's actually simpler with two new endpoints rather than one:

Replace AddAssetBuyOrder with InitRfqRecvInvoicePayment:

message InitRfqRecvInvoicePaymentRequest {
    // The asset that we wish to receive as payment to settle the invoice.
    AssetSpecifier payment_asset = 1;

    uint64 payment_asset_amount = 2;

    uint64 invoice_expiry = 3;

    bytes peer_pub_key = 4;

    uint32 rfq_timeout_seconds = 5;
}

Replace AddAssetSellOrder with InitRfqPayInvoice:

message InitRfqPayInvoiceRequest {
    // The asset which this (wallet) node will use to pay the invoice.
    AssetSpecifier payment_asset = 1;

    // units: msats
    uint64 invoice_amount = 2;
    
    // units: msats
    uint64 max_routing_fee = 3;

    // units: unix timestamp in seconds
    uint64 invoice_expiry = 4;

    bytes peer_pub_key = 5;

    uint32 rfq_timeout_seconds = 6;
}

@ffranr ffranr changed the title [feature]: Replace RPC endpoints AddAssetSellOrder and AddAssetBuyOrder with InitiateRfq [feature]: Replace RPC endpoints AddAssetSellOrder and AddAssetBuyOrder with InitRfq* Oct 31, 2024
@ffranr
Copy link
Contributor Author

ffranr commented Oct 31, 2024

From standup: we're not going to prioritize this very highly. Probably wont be in the next release. We may add a comment to the existing endpoints to note that they may be revised soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: 🆕 New
Development

No branches or pull requests

1 participant