@volmexlabs/sdk
v0.2.8
Published
Provide quick access to various volmex functionality
Readme
Volmex SDK
The objective of this repo is to layout the framework for the creation, management, and analysis of Volmex's tokens and indexes.
Example
import { ChainId } from '@uniswap/sdk';
import { FeeAmount } from '@uniswap/v3-sdk';
import { VolmexPriceSDK } from './lib'
const run = async () => {
// Variables driving the SDK
const targetChain = ChainId.MAINNET;
const targetIndex = 'ETH'
const targetStable = 'USDC'
// Create SDK instance
const sdk = new VolmexPriceSDK();
// Initialize the SDK
await sdk.initialize('mainnet')
// Filter down to the index of choice
const index = sdk.getIndexes(targetChain).find(index => index.symbol === targetIndex);
// Filter down to the stable of choice
const stable = sdk.getSupportedStableAssets(targetChain).find(index => index.symbol === targetStable);
// Use the SDK to pull the targeted chains price from Uniswap V3
const [volatilityPool, inverseVolatilityPrice] = await sdk.getPriceForAsset(index, stable, FeeAmount.HIGH)
console.log("🚀 inverseVolatilityPrice", inverseVolatilityPrice.toFixed());
console.log("🚀 volatilityPool", volatilityPool.toFixed())
}
run();Please reach out in our Discord if you have any questions!
