Skip to content

A typescript library for interacting with Perennial V2 markets

Notifications You must be signed in to change notification settings

equilibria-xyz/perennial-sdk-ts

Repository files navigation

Perennial Typescript SDK - DRAFT

A collection of functions to interact with the Perennial V2 markets. Within it you'll find:

  • Read functions for:
    • Markets
    • Vaults
  • Helper Functions
    • Building transaction data
    • Positions
    • Interest Rate& Funding
  • Constants
    • Network (Chain & Oracle)
    • Contracts
    • Markets
  • ABIs of contracts
  • Types

Getting Started

Use the following commands to install:

yarn add perennial-sdk-ts

Utilization

Important: The provider passed to this library must have the RPC call: eth_call available.

Examples

You can check out the various examples of how to use this code base in the /examples folder. To run these examples use the following command:

  npx esno ./examples/fetchMakerData.ts

If you need to add env varibles you can front load them like this:

ALCHEMY_URL=<url_goes_here> npx esno ./examples/fetchMakerData.ts

To Do:

Chain Data:

  • Fetching account positions
  • Market Data
  • [-] Taker Data
  • [-] Maker Data

Graph:

  • Enable Graph usage
  • User PNL
  • Vault History
  • Market Volume

Examples:

  • Graph Fetch User PNL
  • [-] Graph Fetch Vault History
  • [-] Graph Fetch Market Volume
  • [-] Fetch Maker Data

Housekeeping:

  • [-] Normalize function names away from use to fetch
  • [-] Clean up the file structure
  • [-] Streamline the examples

About

A typescript library for interacting with Perennial V2 markets

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published