perennial-sdk-ts
v0.2.3
Published
A typescript library for interacting with Perennial V2 markets
Downloads
4
Readme
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:
- [x] Fetching account positions
- [x] Market Data
- [-] Taker Data
- [-] Maker Data
Graph:
- [x] Enable Graph usage
- [x] User PNL
- [x] Vault History
- [x] Market Volume
Examples:
- [x] 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