mithraiclabs / bi-dashboard Goto Github PK
View Code? Open in Web Editor NEWA frontend for displaying analytical information for the Psy Ecosystem
A frontend for displaying analytical information for the Psy Ecosystem
Sort the total volume by the source of the volume.
Chart Type: Number
OptionMarket
s from PsyAmerican protocol see docs// THIS IS DETAILED PSEUDO CODE AND WILL NOT WORK COPY PASTA
import { Keypair, PublicKey } from '@solana/web3.js';
import { PsyAmericanIdl } from "@mithraic-labs/psy-american";
const connection = new Connection("https://api.mainnet-beta.solana.com");
const anchorProvider = new Provider(connection, new Keypair(), {});
const program = new Program(PsyAmericanIdl, new PublicKey('R2y9ip6mxmWUj4pt54jP2hz2dgvMozy9VTSwMWE7evs'), anchorProvider);
// Load all the PsyOptions option markets
const optionMarkets = await getAllOptionAccounts(program);
Group the _underlyingAssetPool_s and _quoteAssetPool_s by their mint addresses. Then sum the total amount in all of the pools for each asset type. (E.g. in all pools across all markets there is 115 BTC, 234 ETH, and 5,000,000 USDC)
Use Aleph's API to query the current price of the asset by the mint address (E.g. current price of BTC on Serum). Using the mint address rather than hard coding these values makes this scaleable as OptionMarkets are permissionless and may have random assets added.
Multiply the amounts of assets in the pools with the price of the assets and sum all.
Chart Type: Line Graph
Number of unique daily traders spanning the last 30 days
{
dailyStats(markets: ARRAY_OF_MARKETS
)
{
au {
au
interval
}
}
}
Note: The chart below contains the volume (as a bar chart) as well, which is not required at the moment.
Chart Type: Pie
Total Volume over last 7 days partitioned by underlying / quote asset pair
Breaks down the volume of each asset for clear visibility ie BTC, ETH, SOL, SAMO etc
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.