@@ -109,9 +109,12 @@ configure_genesis() {
109109 | jq -M ' .app_state.wasm.params.instantiate_default_permission = "Everybody"' \
110110 | jq -M --argjson guardians " $guardian_json " --arg feed_id " $AKT_PRICE_FEED_ID " '
111111 .app_state.oracle.params.min_price_sources = 1 |
112- .app_state.oracle.params.max_price_staleness_blocks = 100 |
112+ .app_state.oracle.params.max_price_staleness_period = 30 |
113113 .app_state.oracle.params.twap_window = 50 |
114- .app_state.oracle.params.max_price_deviation_bps = 1000' \
114+ .app_state.oracle.params.max_price_deviation_bps = 1000 |
115+ .app_state.oracle.params.price_retention = "86400s" |
116+ .app_state.oracle.params.prune_epoch = "hour" |
117+ .app_state.oracle.params.max_prune_per_epoch = 1000' \
115118 > " ${GENESIS_PATH} "
116119
117120 log " Genesis configuration complete"
236239{
237240 "admin": "$admin_addr ",
238241 "wormhole_contract": "$wormhole_addr ",
239- "update_fee": "1000000 ",
242+ "update_fee": "1000 ",
240243 "price_feed_id": "$AKT_PRICE_FEED_ID ",
241244 "data_sources": [
242245 {
258261 pyth_addr=$( akash query wasm list-contract-by-code " $pyth_code_id " -o json | jq -r ' .contracts[-1]' )
259262 log " Pyth contract address: $pyth_addr "
260263
261- # Register Pyth as authorized oracle source
262- register_oracle_source " $pyth_addr "
264+ # Register Pyth as authorized oracle source and fund BME vault via gov proposal
265+ register_oracle_source " $pyth_addr " " $admin_addr "
263266
264267 # Write configuration for Hermes
265268 write_hermes_config " $pyth_addr "
@@ -271,37 +274,37 @@ EOF
271274
272275register_oracle_source () {
273276 local pyth_addr=$1
274- log " Registering Pyth contract as authorized oracle source..."
277+ local admin_addr=$2
278+ log " Registering Pyth contract as authorized oracle source and funding BME vault..."
275279
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
280+ # Create proposal JSON with both oracle params and BME vault funding
287281 cat > /tmp/oracle-params.json << EOF
288282{
289283 "messages": [
290284 {
291- "@type": "/akash.oracle.v1 .MsgUpdateParams",
285+ "@type": "/akash.oracle.v2 .MsgUpdateParams",
292286 "authority": "akash10d07y265gmmuvt4z0w9aw880jnsr700jhe7z0f",
293287 "params": {
294288 "sources": ["$pyth_addr "],
295289 "min_price_sources": 1,
296- "max_price_staleness_blocks ": 100 ,
290+ "max_price_staleness_period ": 30 ,
297291 "twap_window": 50,
298- "max_price_deviation_bps": 1000
292+ "max_price_deviation_bps": 1000,
293+ "price_retention": "86400s",
294+ "prune_epoch": "hour",
295+ "max_prune_per_epoch": 1000
299296 }
297+ },
298+ {
299+ "@type": "/akash.bme.v1.MsgFundVault",
300+ "authority": "akash10d07y265gmmuvt4z0w9aw880jnsr700jhe7z0f",
301+ "amount": {"denom": "${CHAIN_TOKEN_DENOM} ", "amount": "1000000000000"},
302+ "source": "$admin_addr "
300303 }
301304 ],
302305 "deposit": "10000000uakt",
303- "title": "Register Pyth Contract",
304- "summary": "Authorize pyth contract as oracle source"
306+ "title": "Register Pyth Contract and Fund BME Vault ",
307+ "summary": "Authorize pyth contract as oracle source and seed BME vault with initial AKT "
305308}
306309EOF
307310
0 commit comments