Friktion
Search…
Volt #01 & #02

Create a Volt

const ulMint = friktionSDK.net.mints.SOL;
const ulNormFactor = Math.pow(10, (await getMint(connection, ulMint)).decimals); // 10^9 for SOL
const { instruction: initializeIx, voltKey } =
await ShortOptionsVoltSDK.getInitializeVoltInstruction({
sdk: friktionSDK,
adminKey: user,
seed: new Keypair().publicKey, // random pubkey, optional. will be generated in instruction otherwise
underlyingAssetMint: ulMint,
quoteAssetMint: friktionSDK.net.mints.USDC, // USDC mainnet mint. The mint used as the token for quote price when settling an option.
permissionedMarketPremiumMint: friktionSDK.net.mints.USDC, // Mint used to bid on options contracts in epoch-based auctions
underlyingAmountPerContract: new BN(ulNormFactor), // 1 SOL per contract
serumProgramId: friktionSDK.net.SERUM_DEX_PROGRAM_ID,
expirationInterval: new BN(7 * 24 * 60 * 60), // expected time between each epoch. Not stricly enforced. set to 7 days here
capacity: new BN(10000 * ulNormFactor), // 10000 SOL
individualCapacity: new BN(100 * ulNormFactor), // 100 SOL
permissionlessAuctions: false,
});
​
const tx = new Transaction().add(initializeIx);
const txResult = await provider.sendAndConfirm(tx);
Your volt can now be loaded!
const voltSdk: ShortOptionsVoltSDK = await friktionSDK.loadShortOptionsVoltSDKByKey(voltKey)

Option Market Details

Find the strike, expiry, and other metadata about the most recent options contract a target volt sold.
// currently (SOL Covered Call, epoch = 32), optionsContract.key = AgCZWYgSkkutErY6qe3VaPQYvbxSzbAxUgBKUUXfziAc
​
// generic options contract struct (GenericOptionsContractWithKey) returned with full details
const optionsContract = await voltSdk.getCurrentOptionsContract();
​
// floating point strike price
const strike = await voltSdk.getStrikeFromOptionsContract(optionsContract); // 52
​
const details: OptionsContractDetails = await voltSdk.getCurrentOptionsContractDetails()
// type OptionsContractDetails = {
// mintName: string | undefined;
// contractSize: number;
// strike: number;
// // in milliseconds unix timestamp
// expiry: number;
// isCall: boolean;
// };
​
const detailsString = await voltSdk.optionsContractToDetailsString(optionsContract); // Fri, 01 Jul 2022 02:00:00 GMT $52 CALL

Serum Market

Volt 1 & 2 auctions are conducted on Serum markets. The public key is a PDA based on details of the options contract traded for that epoch
const {
serumMarketKey // public key
} = await voltSdk.getCurrentMarketAndAuthorityInfo()

Rebalancing

See our DOV Auction Automation Script (automateDovAuctions.ts) for more details on how to crank the rebalancing pipeline.
Copy link
On this page
Create a Volt
Option Market Details
Serum Market
Rebalancing