Contract Interfaces
A high level description of key contract functions
Collateral
The Collateral contract stores collateral balances for { user, product } pairs. There is a single Collateral contract in the protocol.
Deposit
Deposit pulls collateral (DSU) from the msg.sender
and credits the product's collateral balance for the specified account.
account
- The address of the user accountproduct
- The address of the Perennial productamount
- Amount of DSU to deposit
Withdraw
Withdraw decrements the balance of msg.sender
product collateral balance and pushes the DSU to the specified receiver.
account
- The address of the user accountproduct
- The address of the Perennial productamount
- Amount of DSU to deposit
Liquidate
Liquidate closes account
's position for the specified product. Liquidate will revert if the user is not eligible for liquidation.
To check if a user is liquidateable, call
account
- The address of the user accountproduct
- The address of the Perennial product
Product
The Product contract is a market in the Perennial protocol. A new product contract is deployed for each launched market via the Controller's createProduct
method.
Open/Close Make
amount
- Size of the maker position to open or close
Open/Close Take
Taker positions are traders in the system. The maximum size of a taker position is determined by the account's collateral, the product's maintenance requirement, and the product's liquidity (open maker positons)
amount
- Size of the taker position to open or close
Lens
Snapshots
account
- The address of the user accountproduct
- The address of the Perennial product
MultiInvoker
The MultiInvoker allows for multiple interactions with the Perennial protocol in a single transaction.
Where each Invocation
has an action
and args
field. The args
are ABI encoded arguments, you can use the following typescript snippet to generate payloads for each action.
Last updated