@@ -100,6 +100,7 @@ configure_genesis() {
100100 done
101101 guardian_json+=" ]"
102102
103+ # shellcheck disable=SC2002
103104 cat " ${GENESIS_PATH} .orig" | \
104105 jq -M ' .app_state.gov.voting_params.voting_period = "60s"' \
105106 | jq -M ' .app_state.gov.params.voting_period = "60s"' \
@@ -109,9 +110,12 @@ configure_genesis() {
109110 | jq -M ' .app_state.wasm.params.instantiate_default_permission = "Everybody"' \
110111 | jq -M --argjson guardians " $guardian_json " --arg feed_id " $AKT_PRICE_FEED_ID " '
111112 .app_state.oracle.params.min_price_sources = 1 |
112- .app_state.oracle.params.max_price_staleness_blocks = 100 |
113- .app_state.oracle.params.twap_window = 50 |
114- .app_state.oracle.params.max_price_deviation_bps = 1000' \
113+ .app_state.oracle.params.max_price_staleness_period = "60s" |
114+ .app_state.oracle.params.twap_window = "30s" |
115+ .app_state.oracle.params.max_price_deviation_bps = 1000 |
116+ .app_state.oracle.params.price_retention = "86400s" |
117+ .app_state.oracle.params.prune_epoch = "hour" |
118+ .app_state.oracle.params.max_prune_per_epoch = 1000' \
115119 > " ${GENESIS_PATH} "
116120
117121 log " Genesis configuration complete"
236240{
237241 "admin": "$admin_addr ",
238242 "wormhole_contract": "$wormhole_addr ",
239- "update_fee": "1000000 ",
243+ "update_fee": "1000 ",
240244 "price_feed_id": "$AKT_PRICE_FEED_ID ",
241245 "data_sources": [
242246 {
258262 pyth_addr=$( akash query wasm list-contract-by-code " $pyth_code_id " -o json | jq -r ' .contracts[-1]' )
259263 log " Pyth contract address: $pyth_addr "
260264
261- # Register Pyth as authorized oracle source
262- register_oracle_source " $pyth_addr "
265+ # Register Pyth as authorized oracle source and fund BME vault via gov proposal
266+ register_oracle_source " $pyth_addr " " $admin_addr "
263267
264268 # Write configuration for Hermes
265269 write_hermes_config " $pyth_addr "
@@ -271,37 +275,37 @@ EOF
271275
272276register_oracle_source () {
273277 local pyth_addr=$1
274- log " Registering Pyth contract as authorized oracle source..."
278+ local admin_addr=$2
279+ log " Registering Pyth contract as authorized oracle source and funding BME vault..."
275280
276- # Build guardian addresses JSON array for the proposal
277- local guardian_json=" ["
278- for i in " ${! GUARDIAN_ADDRESSES[@]} " ; do
279- if [ " $i " -gt 0 ]; then
280- guardian_json+=" ,"
281- fi
282- guardian_json+=" \" ${GUARDIAN_ADDRESSES[$i]} \" "
283- done
284- guardian_json+=" ]"
285-
286- # Create proposal JSON
281+ # Create proposal JSON with both oracle params and BME vault funding
287282 cat > /tmp/oracle-params.json << EOF
288283{
289284 "messages": [
290285 {
291- "@type": "/akash.oracle.v1 .MsgUpdateParams",
286+ "@type": "/akash.oracle.v2 .MsgUpdateParams",
292287 "authority": "akash10d07y265gmmuvt4z0w9aw880jnsr700jhe7z0f",
293288 "params": {
294289 "sources": ["$pyth_addr "],
295290 "min_price_sources": 1,
296- "max_price_staleness_blocks": 100,
297- "twap_window": 50,
298- "max_price_deviation_bps": 1000
291+ "max_price_staleness_period": "60s",
292+ "twap_window": "30s",
293+ "max_price_deviation_bps": 1000,
294+ "price_retention": "86400s",
295+ "prune_epoch": "hour",
296+ "max_prune_per_epoch": 1000
299297 }
298+ },
299+ {
300+ "@type": "/akash.bme.v1.MsgFundVault",
301+ "authority": "akash10d07y265gmmuvt4z0w9aw880jnsr700jhe7z0f",
302+ "amount": {"denom": "${CHAIN_TOKEN_DENOM} ", "amount": "1000000000000"},
303+ "source": "$( akash keys show main -a) "
300304 }
301305 ],
302306 "deposit": "10000000uakt",
303- "title": "Register Pyth Contract",
304- "summary": "Authorize pyth contract as oracle source"
307+ "title": "Register Pyth Contract and Fund BME Vault ",
308+ "summary": "Authorize pyth contract as oracle source and seed BME vault with initial AKT "
305309}
306310EOF
307311
0 commit comments