Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions scripts/deploy/addresses/osmo-test-5.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"address-provider": "osmo1wlm6dc0vnncu2v5z26rv97plmlkmalm84uwqatrlftc4gmp8ahgqs6r4py",
"red-bank": "osmo1dl4rylasnd7mtfzlkdqn2gr0ss4gvyykpvr6d7t5ylzf6z535n9s5jjt8u",
"incentives": "osmo1zyz57xf82963mcsgqu3hq5y0h9mrltm4ttq2qe5mjth9ezp3375qe0sm7d",
"oracle": "osmo1khe29uw3t85nmmp3mtr8dls7v2qwsfk3tndu5h4w5g2r5tzlz5qqarq2e2",
"rewards-collector": "osmo1u5pcjue4grmg8lh7xrz2nvpy79xlzknwqkczfkyeyx9zzzj76tpq4tgrcs"
}
32 changes: 27 additions & 5 deletions scripts/deploy/base/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,19 @@
import { setupDeployer } from './setupDeployer'
import { DeploymentConfig } from '../../types/config'
import { printGreen, printRed } from '../../utils/chalk'
import { atomAsset, osmoAsset, atomOracle, axlUSDCAsset, axlUSDCOracle } from '../osmosis/config'
import {
atomAsset,
osmoAsset,
atomOracle,
axlUSDCAsset,
axlUSDCOracle,
atomAssetTest,
axlUSDCAssetTest,
axlUSDCOracleTest,
osmoOracle,
marsAssetTest,
marsOracleTest,
} from '../osmosis/config'

export const taskRunner = async (config: DeploymentConfig) => {
const deployer = await setupDeployer(config)
Expand Down Expand Up @@ -29,12 +41,22 @@ export const taskRunner = async (config: DeploymentConfig) => {
// setup
await deployer.updateAddressProvider()
await deployer.setRoutes()
await deployer.initializeAsset(osmoAsset)
await deployer.initializeAsset(atomAsset)
await deployer.initializeAsset(axlUSDCAsset)
await deployer.setOracle(atomOracle)
if (config.mainnet) {
await deployer.initializeAsset(osmoAsset)
await deployer.initializeAsset(atomAsset)
await deployer.initializeAsset(axlUSDCAsset)
await deployer.setOracle(osmoOracle)
await deployer.setOracle(atomOracle)
await deployer.setOracle(axlUSDCOracle)
} else {
await deployer.initializeAsset(osmoAsset)
await deployer.initializeAsset(atomAssetTest)
await deployer.initializeAsset(axlUSDCAssetTest)
await deployer.initializeAsset(marsAssetTest)
// await deployer.setOracle(atomOracle) NEED POOL SET
await deployer.setOracle(osmoOracle)
await deployer.setOracle(axlUSDCOracleTest)
await deployer.setOracle(marsOracleTest)
}

//run tests
Expand Down
134 changes: 111 additions & 23 deletions scripts/deploy/osmosis/config.ts
Original file line number Diff line number Diff line change
@@ -1,26 +1,29 @@
import { DeploymentConfig, AssetConfig, OracleConfig } from '../../types/config'

const axlUSDC = 'ibc/D189335C6E4A68B513C10AB227BF1C1D38C746766278BA3EEB4FB14124F1D858'
const usdcTest = 'ibc/6F34E1BD664C36CE49ACC28E60D62559A5F96C4F9A6CCE4FC5A67B2852E24CFE'
const atomTest = 'ibc/A8C2D23A1E6F95DA4E48BA349667E322BD7A6C996D8A4AAE8BA72E190F3D1477'
const atom = 'ibc/27394FB092D2ECCD56123C74F36E4C1F926001CEADA9CA97EA622B25F41E5EB2'
const marsTestnet = 'ibc/ACA4C8A815A053CC027DB90D15915ADA31939FA331CE745862CDD00A2904FA17'
const marsMainnet = 'ibc/573FCD90FACEE750F55A8864EF7D38265F07E5A9273FA0E8DAFD39951332B580'
const marsTest = 'ibc/2E7368A14AC9AB7870F32CFEA687551C5064FA861868EDF7437BC877358A81F9'
const mars = 'ibc/573FCD90FACEE750F55A8864EF7D38265F07E5A9273FA0E8DAFD39951332B580'
// note the following three addresses are all 'mars' bech32 prefix
const safetyFundAddr = 'mars1s4hgh56can3e33e0zqpnjxh0t5wdf7u3pze575'
const protocolAdminAddr = 'osmo14w4x949nwcrqgfe53pxs3k7x53p0gvlrq34l5n'
const feeCollectorAddr = 'mars17xpfvakm2amg962yls6f84z3kell8c5ldy6e7x'
const marsOsmoPool = 907
const marsOsmoPoolTest = 9

// axlUSDC does not have a pool on testnet so config can't have swapRoutes configured correctly
export const osmosisTestnetConfig: DeploymentConfig = {
chainName: 'osmosis',
atomDenom: atom,
atomDenom: atomTest,
baseAssetDenom: 'uosmo',
chainId: 'osmo-test-4',
chainId: 'osmo-test-5',
chainPrefix: 'osmo',
channelId: 'channel-2083',
marsDenom: marsTestnet,
channelId: 'channel-24',
marsDenom: marsTest,
rewardCollectorTimeoutSeconds: 600,
rpcEndpoint: 'https://rpc-test.osmosis.zone',
rpcEndpoint: 'https://rpc.osmotest5.osmosis.zone',
safetyFundFeeShare: '0.5',
deployerMnemonic:
'elevator august inherit simple buddy giggle zone despair marine rich swim danger blur people hundred faint ladder wet toe strong blade utility trial process',
Expand All @@ -29,10 +32,15 @@ export const osmosisTestnetConfig: DeploymentConfig = {
second_asset_symbol: 'ATOM',
runTests: false,
mainnet: false,
feeCollectorDenom: marsTestnet,
safetyFundDenom: axlUSDC,
feeCollectorDenom: marsTest,
safetyFundDenom: usdcTest,
swapRoutes: [
{ denom_in: atom, denom_out: 'uosmo', route: [{ pool_id: 1, token_out_denom: 'uosmo' }] },
{ denom_in: 'uosmo', denom_out: usdcTest, route: [{ pool_id: 5, token_out_denom: usdcTest }] },
{
denom_in: 'uosmo',
denom_out: marsTest,
route: [{ pool_id: marsOsmoPoolTest, token_out_denom: marsTest }],
},
],
safetyFundAddr: safetyFundAddr,
protocolAdminAddr: protocolAdminAddr,
Expand All @@ -47,7 +55,7 @@ export const osmosisTestMultisig: DeploymentConfig = {
chainId: 'osmo-test-4',
chainPrefix: 'osmo',
channelId: 'channel-2083',
marsDenom: marsTestnet,
marsDenom: marsTest,
rewardCollectorTimeoutSeconds: 600,
rpcEndpoint: 'https://rpc-test.osmosis.zone',
safetyFundFeeShare: '0.5',
Expand All @@ -59,7 +67,7 @@ export const osmosisTestMultisig: DeploymentConfig = {
multisigAddr: 'osmo14w4x949nwcrqgfe53pxs3k7x53p0gvlrq34l5n',
runTests: false,
mainnet: false,
feeCollectorDenom: marsTestnet,
feeCollectorDenom: marsTest,
safetyFundDenom: axlUSDC,
swapRoutes: [
{ denom_in: atom, denom_out: 'uosmo', route: [{ pool_id: 1, token_out_denom: 'uosmo' }] },
Expand All @@ -76,7 +84,7 @@ export const osmosisMainnet: DeploymentConfig = {
chainId: 'osmosis-1',
chainPrefix: 'osmo',
channelId: 'channel-557',
marsDenom: marsMainnet,
marsDenom: mars,
rewardCollectorTimeoutSeconds: 600,
rpcEndpoint: 'https://rpc.osmosis.zone',
safetyFundFeeShare: '0.5',
Expand All @@ -87,7 +95,7 @@ export const osmosisMainnet: DeploymentConfig = {
multisigAddr: 'osmo14w4x949nwcrqgfe53pxs3k7x53p0gvlrq34l5n',
runTests: false,
mainnet: true,
feeCollectorDenom: marsMainnet,
feeCollectorDenom: mars,
safetyFundDenom: axlUSDC,
swapRoutes: [
{ denom_in: 'uosmo', denom_out: axlUSDC, route: [{ pool_id: 678, token_out_denom: axlUSDC }] },
Expand All @@ -101,23 +109,23 @@ export const osmosisMainnet: DeploymentConfig = {
},
{
denom_in: 'uosmo',
denom_out: marsMainnet,
route: [{ pool_id: marsOsmoPool, token_out_denom: marsMainnet }],
denom_out: mars,
route: [{ pool_id: marsOsmoPool, token_out_denom: mars }],
},
{
denom_in: atom,
denom_out: marsMainnet,
denom_out: mars,
route: [
{ pool_id: 1, token_out_denom: 'uosmo' },
{ pool_id: marsOsmoPool, token_out_denom: marsMainnet },
{ pool_id: marsOsmoPool, token_out_denom: mars },
],
},
{
denom_in: axlUSDC,
denom_out: marsMainnet,
denom_out: mars,
route: [
{ pool_id: 678, token_out_denom: 'uosmo' },
{ pool_id: marsOsmoPool, token_out_denom: marsMainnet },
{ pool_id: marsOsmoPool, token_out_denom: mars },
],
},
],
Expand Down Expand Up @@ -173,7 +181,25 @@ export const osmoAsset: AssetConfig = {
}

export const atomAsset: AssetConfig = {
denom: 'ibc/27394FB092D2ECCD56123C74F36E4C1F926001CEADA9CA97EA622B25F41E5EB2',
denom: atom,
max_loan_to_value: '0.68',
reserve_factor: '0.2',
liquidation_threshold: '0.7',
liquidation_bonus: '0.15',
interest_rate_model: {
optimal_utilization_rate: '0.6',
base: '0',
slope_1: '0.15',
slope_2: '3',
},
deposit_cap: '100000000000',
deposit_enabled: true,
borrow_enabled: true,
symbol: 'ATOM',
}

export const atomAssetTest: AssetConfig = {
denom: atomTest,
max_loan_to_value: '0.68',
reserve_factor: '0.2',
liquidation_threshold: '0.7',
Expand All @@ -191,7 +217,7 @@ export const atomAsset: AssetConfig = {
}

export const axlUSDCAsset: AssetConfig = {
denom: 'ibc/D189335C6E4A68B513C10AB227BF1C1D38C746766278BA3EEB4FB14124F1D858',
denom: axlUSDC,
max_loan_to_value: '0.74',
reserve_factor: '0.2',
liquidation_threshold: '0.75',
Expand All @@ -208,16 +234,78 @@ export const axlUSDCAsset: AssetConfig = {
symbol: 'axlUSDC',
}

export const axlUSDCAssetTest: AssetConfig = {
denom: usdcTest,
max_loan_to_value: '0.74',
reserve_factor: '0.2',
liquidation_threshold: '0.75',
liquidation_bonus: '0.1',
interest_rate_model: {
optimal_utilization_rate: '0.8',
base: '0',
slope_1: '0.2',
slope_2: '2',
},
deposit_cap: '500000000000',
deposit_enabled: true,
borrow_enabled: true,
symbol: 'axlUSDC',
}

export const marsAssetTest: AssetConfig = {
denom: marsTest,
max_loan_to_value: '0.74',
reserve_factor: '0.2',
liquidation_threshold: '0.75',
liquidation_bonus: '0.1',
interest_rate_model: {
optimal_utilization_rate: '0.8',
base: '0',
slope_1: '0.2',
slope_2: '2',
},
deposit_cap: '500000000000',
deposit_enabled: true,
borrow_enabled: true,
symbol: 'mars',
}

export const osmoOracle: OracleConfig = {
denom: 'uosmo',
price: '1',
}

export const atomOracle: OracleConfig = {
denom: 'ibc/27394FB092D2ECCD56123C74F36E4C1F926001CEADA9CA97EA622B25F41E5EB2',
denom: atom,
pool_id: 1,
window_size: 1800,
downtime_detector: { downtime: 'duration30m', recovery: 7200 },
}

// export const atomOracleTest: OracleConfig = {
// denom: atomTest,
// pool_id: 'TBD',
// window_size: 1800,
// downtime_detector: { downtime: 'duration30m', recovery: 7200 },
// }

export const axlUSDCOracle: OracleConfig = {
denom: 'ibc/D189335C6E4A68B513C10AB227BF1C1D38C746766278BA3EEB4FB14124F1D858',
pool_id: 678,
window_size: 1800,
downtime_detector: { downtime: 'duration30m', recovery: 7200 },
}

export const axlUSDCOracleTest: OracleConfig = {
denom: usdcTest,
pool_id: 5,
window_size: 1800,
downtime_detector: { downtime: 'duration30m', recovery: 7200 },
}

export const marsOracleTest: OracleConfig = {
denom: marsTest,
pool_id: 9,
window_size: 1800,
downtime_detector: { downtime: 'duration30m', recovery: 7200 },
}