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
Use the following commands to install:
yarn add perennial-sdk-ts
Important: The provider passed to this library must have the RPC call: eth_call
available.
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
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
tofetch
- [-] Clean up the file structure
- [-] Streamline the examples