Friktion
Search…
Friktion Snapshot
The Friktion Snapshot is a continuously updated historical record of data of Friktion volts. It can be found at https://friktion-labs.github.io/mainnet-tvl-snapshots/friktionSnapshot.json. The page typically refreshes every 1-5 minutes. Fields will never be removed or modified, only added.
An example of provided data is given below:
{
"globalId": "mainnet_income_call_sol",
"voltVaultId": "CbPemKEEe7Y7YgBmYtFaZiECrVTP5sGrYzrrrviSewKY",
"extraVaultDataId": "HDQFvghwrjCZjVcKiFZD3amopbW5WX97juPvKsV3WGv2",
"vaultAuthority": "Hxtb6APfNtf9m8jJjh7uYp8fCTGr9aeHxBSfiPqCrV6G",
"quoteMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"underlyingMint": "So11111111111111111111111111111111111111112",
"depositTokenMint": "So11111111111111111111111111111111111111112",
"shareTokenMint": "4Hnh1UCC6HLzx9NaGKnTVHR2bANcRrhydumdHCnrT3i2",
"shareTokenSymbol": "fcSOL",
"shareTokenDecimals": 9,
"depositPool": "unrWTSSfz6H7DzYYHRTuTCK3yVzR1YUNqUn7xWwr4Z5",
"premiumPool": "Dq3ZMPnpXqxqRmMaLKdGphsX7M1bxccaNuWHiqDkceSY",
"spotSerumMarketId": "Aj3bg9mGwGyDAkxtWKhHVsJV8X2fhKsZ3tpN1NfYbjWd",
"depositTokenSymbol": "SOL",
"depositTokenCoingeckoId": "solana",
"underlyingTokenSymbol": "SOL",
"underlyingTokenCoingeckoId": "solana",
"voltType": 1,
"apy": 29.6,
"isVoltage": false,
"isInCircuits": false,
"highVoltage": "mainnet_income_call_sol_high",
"shareTokenPrice": 1.1693336600241941,
"depositTokenPrice": 43.39,
"tvlUsd": 8047435.992590882,
"tvlDepositToken": 185467.526909216,
"capacityUsd": 12583100,
"capacityDepositToken": 290000,
"latestEpochYield": 0.37,
"weeklyPy": 0.5,
"monthlyPy": 2.18,
"apr": 26,
"apyAfterFees": 26.3,
"performanceFeeRate": 0.1,
"withdrawalFeeRate": 0.001,
"nextAutocompoundingTime": 1658455199000,
"lastTradedOption": "3vqAnf177jpQFCxFgePjx2MD6DLhmEhx6BDpn9BEabpS"
},
The simplest way to access is a direct http request to the hosted endpoint (https://friktion-labs.github.io/mainnet-tvl-snapshots/friktionSnapshot.json).
Alternatively, we provide helper methods via the SDK. An example of accessing the full Friktion Snapshot (including data about all devnet and mainnet volts) is given below.
const PROVIDER_URL = "https://api.mainnet-beta.solana.com";
const payer = new Keypair();
const provider = new AnchorProvider(
new Connection(PROVIDER_URL),
new NodeWallet(payer as unknown as Account),
{}
);
​
const friktionSdk = new FriktionSDK({
provider: provider,
network: "mainnet-beta",
});
​
// this getter will cache the result.
console.log(await friktionSdk.getSnapshot());
​
// force reload the cache
await friktionSdk.reloadSnapshot();
To access a volt-specific snapshot, load an SDK and then call the appropriate getter.
Full Example:
import { FriktionSDK } from "@friktion-labs/friktion-sdk";
import { AnchorProvider, Wallet } from "@project-serum/anchor";
import { Connection, PublicKey } from "@solana/web3.js";
import BN from "bn.js";
​
// SOL Covered Call Volt
const voltVaultId = new PublicKey(
"CbPemKEEe7Y7YgBmYtFaZiECrVTP5sGrYzrrrviSewKY"
);
const PROVIDER_URL = "https://api.mainnet-beta.solana.com";
const CLUSTER = "mainnet-beta";
const provider = new AnchorProvider(
new Connection(PROVIDER_URL),
Wallet.local(),
{}
);
const friktionSDK: FriktionSDK = new FriktionSDK({
provider: provider,
network: CLUSTER,
});
const user = provider.wallet.publicKey;
​
const roundNumber = new BN(25);
​
(async () => {
const voltSdk = await friktionSDK.loadVoltSDKByKey(voltVaultId);
// cached
const snapshot = await voltSdk.getSnapshot();
// force reload cache
await voltSdk.reloadSnapshot();
console.log("snapshot = ", snapshot);
​
//// sample fields ////
console.log(
"SNAPSHOT\n------------",
"\nisHighVoltage: ",
snapshot.isVoltage,
// await voltSdk.isHighVoltage()
"\nlast option traded: ",
snapshot.lastTradedOption.toString(),
// await voltSdk.getLastTradedOptionKey()
"\nunderlying asset symbol: ",
snapshot.underlyingTokenSymbol,
// await voltSdk.getUnderlyingTokenSymbol()
"\nvolt token symbol: ",
snapshot.shareTokenSymbol,
// await voltSdk.getShareTokenSymbol()
"\nnext autocompounding time: ",
snapshot.nextAutocompoundingTime,
// await voltSdk.getNextAutocompoundingTime();
"\nperformance fee: ",
snapshot.performanceFeeRate,
// await voltSdk.getPerformanceFeeRate()
"\nwithdrawal fee: ",
snapshot.withdrawalFeeRate
// await voltSdk.getWithdrawalFeeRate()
​
// etc.
);
})();
​
Copy link