Mito

Example code snippets to query the indexer for the Mito vault module related data.

Mito Documentation has been moved here visit Mito's Docs.

(Outdated) Using gRPC

Fetch a vault based off it's contract address, such as the vault's tvl or profits

import { IndexerGrpcNinjaApi } from '@injectivelabs/sdk-ts'
import { getNetworkEndpoints, Network } from '@injectivelabs/networks'

const endpoints = getNetworkEndpoints(Network.Testnet)
const indexerGrpcNinjaApi = new IndexerGrpcNinjaApi(endpoints.ninjaApi)

const contractAddress = '0x...' /* optional param */
const slug = 'derivative-vault' /* optional param */

const vault = await indexerGrpcNinjaApi.fetchVault({
  contractAddress,
  slug,
})

console.log(vault)

Fetch vaults and associated details

Fetch the lp token price chart for a vault based on the vault address

Fetch the tvl token chart for a vault based on the vault address

Fetch the vaults associated with a holder of its lp tokens

Fetch the lp token holders from the vault address

Fetch the lp holder's portfolio

Fetch the leaderboard to see Pnl rankings

Last updated