@dydxfoundation/governance
Version:
dYdX governance smart contracts
219 lines (218 loc) • 8.55 kB
JavaScript
;
/**
* Configuration values for the mainnet deployment, used as the defaults for other deployments.
*
* Time periods and timestamps are in seconds unless otherwise indicated.
*/
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const bignumber_js_1 = __importDefault(require("bignumber.js"));
const luxon_1 = require("luxon");
const constants_1 = require("../lib/constants");
const util_1 = require("../lib/util");
// Schedule parameters.
const EPOCH_LENGTH = 28 * constants_1.ONE_DAY_SECONDS;
const BLACKOUT_WINDOW = 14 * constants_1.ONE_DAY_SECONDS;
const MERKLE_DISTRIBUTOR_WAITING_PERIOD = 7 * constants_1.ONE_DAY_SECONDS;
// Equal to 65 epochs plus a portion of an epoch, to account for leftover rewards due to the
// different start dates of the two staking modules.
const REWARDS_DISTRIBUTION_LENGTH = 157679998;
// Staking parameters.
//
// Equal to 25M tokens per staking module divided by 157,679,998 seconds of distributing rewards
const STAKING_REWARDS_PER_SECOND = (0, util_1.toWad)('0.1585489619');
// Treasury parameters.
//
// Frontloaded rewards is sum of:
// - 75M (retroactive distribution)
// - 383,562 (epoch 0 Liquidity Module rewards)
// - 3,835,616 (epoch 0 trader rewards)
// - 1,150,685 (epoch 0 liquidity provider rewards)
const REWARDS_TREASURY_FRONTLOADED_FUNDS = (0, util_1.toWad)(75000000 +
383562 +
3835616 +
1150685);
const LONG_TIMELOCK_CONFIG = {
DELAY: constants_1.ONE_DAY_SECONDS * 7,
GRACE_PERIOD: constants_1.ONE_DAY_SECONDS * 7,
MINIMUM_DELAY: constants_1.ONE_DAY_SECONDS * 5,
MAXIMUM_DELAY: constants_1.ONE_DAY_SECONDS * 21,
PROPOSITION_THRESHOLD: 200,
VOTING_DURATION_BLOCKS: constants_1.ONE_DAY_BLOCKS * 10,
VOTE_DIFFERENTIAL: 1000,
MINIMUM_QUORUM: 1000,
};
const SHORT_TIMELOCK_CONFIG = {
DELAY: constants_1.ONE_DAY_SECONDS * 2,
GRACE_PERIOD: constants_1.ONE_DAY_SECONDS * 7,
MINIMUM_DELAY: constants_1.ONE_DAY_SECONDS,
MAXIMUM_DELAY: constants_1.ONE_DAY_SECONDS * 7,
PROPOSITION_THRESHOLD: 50,
VOTING_DURATION_BLOCKS: constants_1.ONE_DAY_BLOCKS * 4,
VOTE_DIFFERENTIAL: 50,
MINIMUM_QUORUM: 200,
};
const MERKLE_PAUSER_TIMELOCK_CONFIG = {
DELAY: 0,
GRACE_PERIOD: constants_1.ONE_DAY_SECONDS * 7,
MINIMUM_DELAY: 0,
MAXIMUM_DELAY: constants_1.ONE_DAY_SECONDS,
PROPOSITION_THRESHOLD: 50,
VOTING_DURATION_BLOCKS: constants_1.ONE_DAY_BLOCKS * 2,
VOTE_DIFFERENTIAL: 50,
MINIMUM_QUORUM: 100,
};
const MERKLE_DISTRIBUTOR_CONFIG = {
IPNS_NAME: 'rewards-data.dydx.foundation',
IPFS_UPDATE_PERIOD: 60 * 3,
MARKET_MAKER_REWARDS_AMOUNT: 1150685,
TRADER_REWARDS_AMOUNT: 3835616,
TRADER_SCORE_ALPHA: 0.7,
};
const STARK_PROXY_CONFIG = {
BORROWER_CONFIGS: [
{
// Wintermute
BORROWER_ADDRESS: '0x4f3a120E72C76c22ae802D129F599BFDbc31cb81',
BORROWER_ALLOCATION: 2500,
},
{
// Amber
BORROWER_ADDRESS: '0x39ad99e33ab7ee85818741dd6076112188bc2611',
BORROWER_ALLOCATION: 2500,
},
{
// Sixtant
BORROWER_ADDRESS: '0x89ded350b2be3dc2014c71f1e49cdfad17ccaf7c',
BORROWER_ALLOCATION: 2000,
},
{
// Kronos
BORROWER_ADDRESS: '0x38d981c3c42b2ec8e9572f560552407d0f1279fb',
BORROWER_ALLOCATION: 2000,
},
{
// DAT Trading
BORROWER_ADDRESS: '0x940ab7307c7971f9284ba9c19b3313600d79c48a',
BORROWER_ALLOCATION: 1000,
},
],
};
const config = {
// Common schedule parameters.
EPOCH_LENGTH,
BLACKOUT_WINDOW,
REWARDS_DISTRIBUTION_LENGTH,
// DYDX token parameters.
MINT_MAX_PERCENT: 2,
// Governance parameters.
VOTING_DELAY_BLOCKS: 6570,
// Treasury parameters.
REWARDS_TREASURY_VESTING_AMOUNT: new bignumber_js_1.default((0, util_1.toWad)(450000000))
.minus(REWARDS_TREASURY_FRONTLOADED_FUNDS)
.toFixed(),
COMMUNITY_TREASURY_VESTING_AMOUNT: (0, util_1.toWad)(50000000),
// Timelock parameters.
LONG_TIMELOCK_CONFIG,
SHORT_TIMELOCK_CONFIG,
MERKLE_PAUSER_TIMELOCK_CONFIG,
// Merkle Distributor.
MERKLE_DISTRIBUTOR_CONFIG,
MERKLE_DISTRIBUTOR_WAITING_PERIOD,
// Safety Module.
SM_REWARDS_PER_SECOND: STAKING_REWARDS_PER_SECOND,
// Liquidity Staking.
LS_MIN_BLACKOUT_LENGTH: 3 * constants_1.ONE_DAY_SECONDS,
LS_MAX_EPOCH_LENGTH: 92 * constants_1.ONE_DAY_SECONDS,
LS_REWARDS_PER_SECOND: STAKING_REWARDS_PER_SECOND,
getLiquidityStakingMinEpochLength() {
return this.LS_MIN_BLACKOUT_LENGTH * 2;
},
getLiquidityStakingMaxBlackoutLength() {
return this.LS_MAX_EPOCH_LENGTH / 2;
},
// Stark Proxies.
STARK_PROXY_CONFIG,
// Treasuries.
REWARDS_TREASURY_FRONTLOADED_FUNDS,
// Initial token allocations.
TOKEN_ALLOCATIONS: {
TEST_TOKENS_1: {
ADDRESS: '0xeb74327ddd3f0d359321f06d84a9d3871b4d96a4',
AMOUNT: (0, util_1.toWad)(2),
},
TEST_TOKENS_2: {
ADDRESS: '0xb03414a51a625e8ce16d284e34941ba66c5683c9',
AMOUNT: (0, util_1.toWad)(2),
},
TEST_TOKENS_3: {
ADDRESS: '0x1eec5afab429859c46db6552bc973bdd525fd7b1',
AMOUNT: (0, util_1.toWad)(2),
},
TEST_TOKENS_4: {
ADDRESS: '0x69112552fac655bb76a3e0ee7779843451db02b6',
AMOUNT: (0, util_1.toWad)(2),
},
DYDX_FOUNDATION: {
ADDRESS: '0xb4fbF1Cd41BB174ABeFf6001B85490b58b117B22',
AMOUNT: (0, util_1.toWad)(293355248.288681),
},
DYDX_TRADING: {
ADDRESS: '0xf95746B2c3D120B78Fd1Cb3f9954CB451c2163E4',
AMOUNT: (0, util_1.toWad)(115941170.358637),
},
DYDX_LLC: {
ADDRESS: '0xCc9507708a918b1d44Cf63FaB4E7B98b7517060f',
AMOUNT: (0, util_1.toWad)(90703573.352682),
},
},
// Addresses which were used on mainnet for token custody testing.
TOKEN_TEST_ADDRESSES: [
'0xeb74327ddd3f0d359321f06d84a9d3871b4d96a4',
'0xb03414a51a625e8ce16d284e34941ba66c5683c9',
'0x1eec5afab429859c46db6552bc973bdd525fd7b1',
'0x69112552fac655bb76a3e0ee7779843451db02b6',
'0x688134aefae00632d36754ca9f085bd25072e2f0',
'0xb50309682298fecf08ea07792154fa26f05fd7e5',
'0x49fae0a92272ec68583eb009f4c40bcf91b9010f',
'0xad2955994fb189117478eec154153ba7d0f835ca',
],
// Safety Module recovery.
//
// The owed amount is the amount that was initially staked and stuck in the Safety Module,
// plus additional compensation.
//
// Compensation for each user is 10% of what they staked, rounded down to the nearest 1e-18 DYDX.
// The total owed amount is calculated by summing the staked amounts and compensation amounts
// for all users who staked to the Safety Module.
//
// Snapshot of staked balances taken on September 14, 2021 UTC. The last tx was on September 9.
//
SM_RECOVERY_OWED_AMOUNT: '173204761823871505252385',
//
// Distribution start is unchanged from the mainnet deployment
SM_RECOVERY_DISTRIBUTION_START: (luxon_1.DateTime.fromISO('2021-09-08T15:00:00', { zone: 'utc' }).toSeconds()),
//
// Calculate the distribution end as follows:
//
// 25,000,000 - 15745.887438533773204745 DYDX are available as rewards once staking resumes.
// The rewards rate is unchanged at 0.1585489619 DYDX per second, so we can issue rewards for
// 157580685 whole seconds.
//
// Assuming for now that the earliest staking may resume (counting 18 days from when a proposal
// is created) is 2021-11-02T01:00:00 UTC, we arrive at the following time.
//
SM_RECOVERY_DISTRIBUTION_END: (luxon_1.DateTime.fromISO('2026-10-30T21:24:45', { zone: 'utc' }).toSeconds()),
// dYdX Grants Program.
// Amount to be transferred is $6,250,000 of DYDX at market.
// Per the DIP, price has been calculated using 24h VWAP from market data.
// Price derived is $8.31 using Binance.com DYDX/USDT on 01/01/22.
// Using market price of $8.31, rounded amount to be transferred is 752,000.00 DYDX.
//
DGP_MULTISIG_ADDRESS: '0xFa3811E5C92358133330f9F787980ba1e8E0D99a',
//
DGP_FUNDING_AMOUNT: '752000000000000000000000',
};
exports.default = config;