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

Buyer payouts as on-the-fly reverse submarine swaps #160

Merged
merged 14 commits into from
Jun 17, 2022

Conversation

Reckless-Satoshi
Copy link
Collaborator

@Reckless-Satoshi Reckless-Satoshi commented Jun 5, 2022

This feature will allow buyers to submit an onchain address instead of an invoice. For a fee, they will be able to directly receive their Sats on their cold storage.

Background and motivation in #128 (comment)

TODO:

  • Implement LNnode functions to query channel, wallet and total balance.
  • DB model for "Liquidity" under the Control app
  • Implement LNnode functions to validate an onchain address and suggest fee in sats/vbyte
  • Implement utils for submarine swap cost: linearly proportional to available on-chain liquidity.
  • New API model for "OnchainPayment"
  • New Order props: is_swap (boolean), payout_onchain (foreign key OnchainPayment).
  • Logic remake for on-chain address submission (instead of LNinvoice) and payment (instead of routing)
  • Add frontend component. Submit a payout invoice as a new tab: "submit onchain address". Only available if enough liquidity is onchain. Must inform user of % fee cost of the swap. Must suggest user a miner fee and ask for input (calculated in frontend assuming ~120 vbytes tx size). Ultimately shows user 2 amounts: exactly how many sats they receive and how many sats it costs.
  • Add frontend component. Transaction sent! show TXID. On successful trade window.

@Reckless-Satoshi
Copy link
Collaborator Author

Ready and live in the testnet platform.

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

Successfully merging this pull request may close these issues.

None yet

1 participant