granite-config
Version:
Granite configuration package
125 lines (121 loc) • 3.07 kB
TypeScript
declare const StacksNetworks: readonly [
"mainnet",
"testnet",
"devnet",
"mocknet"
];
type StacksNetworkName = (typeof StacksNetworks)[number];
declare enum GRANITE_MARKETS {
MAINNET = "MAINNET",
MAINNET_STAGING = "MAINNET_STAGING"
}
interface Chain {
id: GRANITE_MARKETS;
name: string;
tgBot: string;
network: StacksNetworkName;
}
interface ScaledIRParams {
urKink: number;
slope1: number;
slope2: number;
baseIR: number;
}
type SafetyModuleParams = {
stakedPercentageKink: number;
slope1: number;
slope2: number;
baseRewardRate: number;
};
interface Contract {
id: string;
name: string;
principal: string;
}
interface Token {
display_name: string;
contract: Contract;
decimals: number;
display_decimals: number;
image: string;
price_feed?: string;
asset_cap?: number;
dust_threshold?: number;
}
interface CollateralToken extends Token {
liquidationLTV: number;
liquidationPremium: number;
maxLTV: number;
}
declare enum GraniteContracts {
STATE = "STATE",
LP = "LP",
BORROWER = "BORROWER",
LIQUIDATOR = "LIQUIDATOR",
INTEREST_RATE = "INTEREST_RATE",
GOVERNANCE = "GOVERNANCE",
WITHDRAWAL_CAPS = "WITHDRAWAL_CAPS",
WITHDRAWAL_CAPS_UTILITY = "WITHDRAWAL_CAPS_UTILITY",
SAFETY_MODULE = "SAFETY_MODULE",
PYTH_STORAGE = "PYTH_STORAGE",
FLASH_LOAN = "FLASH_LOAN",
BTC_LEVERAGE = "BTC_LEVERAGE",
REPAY_WITH_COLLATERAL = "REPAY_WITH_COLLATERAL"
}
interface LpIncentivesEpoch {
startDate: number;
endDate: number;
rewards: number;
contract: Contract;
token: Contract;
}
interface WithdrawalCaps {
lp: number;
debt: number;
collaterals: number[];
timeWindow: number;
}
interface Market {
chain_id: GRANITE_MARKETS;
market_asset: Token;
share_token: Token;
collaterals: CollateralToken[];
contracts: Record<GraniteContracts, Contract>;
ir_params: ScaledIRParams;
safety_module_params: SafetyModuleParams;
protocol_reserve_percentage: number;
scaling_factor: number;
lp_incentives: LpIncentivesEpoch[];
withdrawal_caps: WithdrawalCaps;
pyth_fee: number;
flash_loan_fee: number;
}
interface Config {
defaultChainId: GRANITE_MARKETS;
defaultNetwork: StacksNetworkName;
chains: Record<GRANITE_MARKETS, Chain>;
markets: Record<GRANITE_MARKETS, Market>;
links: {
discord: string;
github: string;
x: string;
telegram: string;
};
}
declare const config: Config;
declare const AEUSDC: {
id: string;
name: string;
principal: string;
};
declare const SBTC: {
id: string;
name: string;
principal: string;
};
declare const STX: {
id: string;
name: string;
principal: string;
};
export { AEUSDC, type Chain, type CollateralToken, type Config, type Contract, GRANITE_MARKETS, GraniteContracts, type LpIncentivesEpoch, type Market, SBTC, STX, type SafetyModuleParams, type ScaledIRParams, type Token, type WithdrawalCaps, config };