If you wish to suggest changes on this document, please open a PR on the Liquidity Provider Server Repository
Liquidity Provider Server
The Liquidity Provider Server (LPS) is a server that interacts with a Liquidity Bridge Contract (LBC) to provide liquidity for users as part of the Flyover protocol. This server performs all the necessary operations to play the role of the Liquidity Provider, involving transactions in both Rootstock and Bitcoin networks.
Liquidity Providers (LPs) interact with the protocol to perform management operations related to topics such as collateral, funds, fees management, configuration, etc. through the LPS. The LP does these operations through the Liquidity Provider Server, which is why the LPS also has an API that the LP interacts with to perform various management operations.
Actors in the Flyover Protocol
In the Flyover Protocol, there are three main Actors:
- The regular user (user), who is the party interested in executing Peg-In/Peg-Out operations
- The Liquidity Provider (LP), who provides liquidity to speed up the operation for the user in exchange for a fee as a reward
- The integrator who integrates the flyover SDK into their dapp/protocol. In order to do this, the user and the LP need to agree on the terms of the service (a Peg-In/Peg-Out Quote). This implies that the different LPs may offer different quotes, so the user needs to be able to interact with each LP to receive quote details and decide which one is going to be used for the operation.
The user interacts with the Flyover Protocol through the Flyover SDK. This SDK fetches the list of the available LP from the liquidity bridge contract (LBC), this contract returns a list where each element has some information about the LP, among this information will be the URL of the liquidity provider server (LPS) instance of that LP so the user can communicate with it. This means that the LPS has an API that every user interacts with to do the quote agreement.
How to Run LPS
To run the project locally you can follow these steps:
git clone git@github.com:rsksmart/liquidity-provider-server.git
cd docker-compose/local
export LPS_STAGE=regtest
./lps-env.sh up
This will set up a local environment, please keep in mind that a productive set-up could vary in multiple aspects.