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

[SP] Automated Swap Backend #131

Closed
3 of 12 tasks
D4nte opened this issue Jan 11, 2021 · 3 comments
Closed
3 of 12 tasks

[SP] Automated Swap Backend #131

D4nte opened this issue Jan 11, 2021 · 3 comments
Labels
enhancement New feature or request

Comments

@D4nte
Copy link
Contributor

D4nte commented Jan 11, 2021

The Service Provider (SP) also runs a backend that has the role to execute swaps. The backend...

  • Nectar #174 WIP - automatically executes a swap when reached via the p2p interface.
  • gets any related configuration items for a config file, the config file has reasonable defaults.
  • provides an API to allow the website to access the current rate.
  • uses kraken mid-market rate as rate.
  • uses an up-to-date rate when locking the Bitcoin asset.
  • does not proceed with swap execution if predicted Bitcoin quantity to sell is above a configurable ratio of total balance.
  • uses bitcoind wallet as Bitcoin Wallet.
  • uses monero-wallet-rpc as Monero Wallet.
  • prints Bitcoin cancellation, Bitcoin punishment transactions when computed
  • prints Monero (refund) private key when the protocol allows (Bitcoin refunded)
  • can run several swaps concurrently.
  • Bonus: bundles the swap website, allowing the SP operator to just proxy from their favourite webserver.
@da-kami
Copy link
Member

da-kami commented Jan 18, 2021

Notes on can run swaps concurrently, after working on #147 I see the following issues to be resolved to make concurrent swaps happen (given the code base at the time):

  • Separate EventLoop and EventLoopHandle - I think we will need this to make concurrent swaps possible. We should be able to drive a swap through a handle without creating a new EventLoop. I think the EventLoop should live in the factory, while the handles live in each swap. (Currently the EventLoop is returned upon creating a swap.)
  • Don't just have one swap_id in the Factory but have a list of swaps.
  • Make swaps identifiable in the network communication.

Recording this here so I can get it out of my head for now.

@D4nte
Copy link
Contributor Author

D4nte commented Jan 21, 2021

Regarding can run swaps concurrently, it also means concurrent access to the DB. I think we should do #133 to not end up fixing the db concurrent access twice.

@thomaseizinger
Copy link
Contributor

Closing because epic from previous project.

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
None yet
Development

No branches or pull requests

3 participants