@volare.finance/volare.js
Version:
The SDK for Volare Protocol
66 lines (65 loc) • 1.61 kB
TypeScript
/**
* @file protocols.ts
* @author astra <astra@volare.com>
* @date 2022
*/
import { Address, BigNumber } from '@volare.finance/utils.js';
export declare const USD_DECIMALS = 8;
export declare const USDC_DECIMALS = 6;
export declare const VTOKEN_DECIMALS = 8;
export declare const STRIKE_DECIMALS = 8;
export declare const BASE_DECIMALS = 27;
export declare enum ActionType {
OpenVault = 0,
MintShortOption = 1,
BurnShortOption = 2,
DepositLongOption = 3,
WithdrawLongOption = 4,
DepositCollateral = 5,
WithdrawCollateral = 6,
SettleVault = 7,
Redeem = 8,
Call = 9,
Liquidate = 10
}
export interface IActionArgs {
actionType: ActionType;
owner: Address;
secondAddress: Address;
asset: Address;
vaultId: number;
amount: string | number;
index: number;
data: string;
}
/**
* @field strikePrice denominated in strike asset
* @field expiry denominated in second
*/
export interface INativeVToken {
address: Address;
underlyingAsset: Address;
strikeAsset: Address;
collateralAsset: Address;
strikePrice: BigNumber;
expiry: number;
isPut: boolean;
}
export interface INativeVault {
shortVTokens: Address[];
longVTokens: Address[];
collateralAssets: Address[];
shortAmounts: BigNumber[];
longAmounts: BigNumber[];
collateralAmounts: BigNumber[];
}
export declare enum VaultType {
FullyCollateralized = "0x00",
NakedMargin = "0x01"
}
export declare enum StrategyType {
Long = "Long",
Short = "Short",
CallSpread = "Call Spread",
PutSpread = "Put Spread"
}