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

[Spike] broker -- hand rolled vs as a service #29

Open
twblack88 opened this issue Oct 21, 2024 · 1 comment
Open

[Spike] broker -- hand rolled vs as a service #29

twblack88 opened this issue Oct 21, 2024 · 1 comment

Comments

@twblack88
Copy link

Chainflip has a thing --poorly named-- called a broker that does (@0xean fills in sophsticated details)

we should probably run our own but there are contingencies we'll need:

  • a cycling amount of FLIP
  • extra protections on the endpoint. there are two attack vectors we need to account for and secure against.
@CumpsD
Copy link

CumpsD commented Oct 21, 2024

Some extra info on rolling your own broker:

  • You need to run chainflip-node (preferably load balance if one goes down, or if you want to do rolling updates)
  • You need to run chainflip-broker-api (same deal, 2 separate)
  • Need to pay attention to the Chainflip Discord to stay up to date and follow the update procedures to keep everything working.
  • Cycling amount of FLIP you can mostly ignore, tx cost is so low it lasts a really long time. Add in like 20 FLIP to start and set a monitor on it
  • You indeed need to put something like nginx/reverse proxy in front of it to block certain RPC calls (like broker_withdraw_fees to avoid somebody just claiming all your broker rewards to their address)
  • Not going to happen quickly, but a user can adjust the commission bps on a call to your broker to not pay any. But if they go that length, they might as well swap somewhere else.
  • You need to protect your broker keys which are on the server too.

Info about the Broker as a Service (BaaS):

  • Docs: https://docs.chainflip-broker.io/use-cases/
  • Main use cases are to make life easier by:
    • Not having to run 2 nodes
    • Not having to run 2 broker apis
    • Not having to pay attention to the Discord/upgrades
    • Not having to care about the FLIP needed (besides a little FLIP to redeem your broker rewards)
    • Have all RPC calls blocked besides the one needed to start a swap
    • Setting a minimum commission bps, which is enforced no matter what users do
    • You hold your own keys, BaaS is fully non-custodial, your keys are used to redeem your rewards.
    • Additional, an extra REST API is provided to make developer life even more easier: https://chainflip-broker.io/docs/ui/index.html
    • Multiple ways to integrate (Chainflip SDK, Swapkit SDK, BaaS REST API)
  • And all of this for just 0.05% fee per swap :) https://docs.chainflip-broker.io/resources/pricing/
  • And you're in good hands and good company!

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

No branches or pull requests

2 participants