Dev tools
Content Out of Date
This content is not maintained and refers to an out-of-date version of Perpetual Protocol.
For the latest documentation, see https://docs.perp.com
Maker bot
An open source maker bot for providing liquidity on Perp v2: https://github.com/perpetual-protocol/perp-maker/
Check out the following resources to get started:
Arbitrage bot
An open source trading bot for arbitraging between Perp v2 and CEXes like Binance/FTX: https://github.com/perpetual-protocol/perp-curie-arbitrageur
Check out the following resources to get started:
The Graph API
Perpetual Protocol does not provide an official API. Instead it relies on services such as The Graph. This is to ensure the maximum distribution and decentralization possible at this point in the project's development.
The Graph is intended as a data collection, and may not be realtime.
Important Links
Definitions
🚧 Definitions will be added as they are requested. Please come to our Discord and request in in the #coding-chat channel!
FundingUpdated
FundingUpdated
Updates the global funding params which are used to calculate each trader's funding payment
Updated per timestamp
FundingPaymentSettled
FundingPaymentSettled
Settles a trader's funding payment into owedRealizedPnl
Calculated before executing
openPosition
,closePosition
,addLiquidity
,removeLiquidity
.
dailyFundingRate
dailyFundingRate
Shows funding rate from past 24h
app.perp.com shows
dailyFundingRate / 24 * 100
exchangedPositionNotional
exchangedPositionNotional
Shows value of a trade in USD
Includes non-fee generating swaps, so aggregate fees will be less than 0.1% of this value
Examples
See more examples in the “playground” at The Graph link above.
Query latest Funding Rate
Query your funding payment history
Query Maker Position Change
Query Liquidation
Query prices
Last updated