Frontend & Client Integrations
Last updated
Last updated
Anyone is able to create a UI for Perennial. The markets are open for all to interact with & the platform has a method to charge extra fees on flow originating from a particular UI.
Integrating Perennial as the underlying markets infrastructure for a new product can reduce the technical burden for developers & improve time to market.
While the Perennial team initially created the first markets and user interface, we welcome projects to integrate with the Perennial protocol to tap into its liquidity & leverage it's robust design.
Perennial has two SDKs available to help developers get started quicker. The most fully featured SDK written in Typescript an is utilized across most of the client integrations.
Additionally, a Python based SDK has been created to assist Makers & Algorithmic traders with their workflows.
These SDKs will abstract away a large portion of the complexity when integrating Perennial into a client application. However if you'd prefer to interact directly with markets you can look at the MultiInvoker.sol section.
Applications utilizing Perennial's MultiInvoker.sol
contract are able to add fees to their order bundles. This allows application developers to focus on creating a great experience for traders/LPs on the front end without having to write Solidity to collect fees on order flow.
See the MultiInvoker.sol section to learn more
In order to reduce the amount of transactions required to interact with the protocol & simplify the user experience, the MultiInvoker.sol
was developed to batch market actions & liquidity provisioning actions into a single transaction.
For example, a new user wants to create a trade on one of Perennial's markets & pay a fee to the UI. Without the MultiInvoker following 4 transactions would be required:
approve()
market #1 to transfer collateral
Request latest oracle price by calling commitPrice()
Make a trade on market #1 by calling update()
Transfer fee to UI developer
Furthermore, every new market the user would interact with they'd need to approve()
the collateral for that market. Now compare this with the MultiInvoker:
approve()
MultiInvoker to transfer collateral (only required once)
Call invoke()
:
Request oracle via commitPrice()
Make trade via update()
Transfer fee to UI developer
In order to your to improve development speed we’ve created an example repo which covers the basic calls you’ll need to populate a UI & submit trades.
Please email info@perennial.finance
to be added to the repo.
Python SDK