0.2.8 • Published 1 year ago
@volmexlabs/sdk v0.2.8
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!
0.2.7
2 years ago
0.2.6
2 years ago
0.2.8
1 year ago
0.2.5
2 years ago
0.2.4
2 years ago
0.2.3
2 years ago
0.2.1
3 years ago
0.2.0
3 years ago
0.1.8
3 years ago
0.1.9
3 years ago
0.2.2
3 years ago
0.1.6
3 years ago
0.1.5
3 years ago
0.1.4
3 years ago
0.1.3
3 years ago
0.1.2
3 years ago
0.1.1
3 years ago
0.0.3
3 years ago
0.0.2
3 years ago
0.0.1
3 years ago