Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add testnet data #101

Closed
wants to merge 2 commits into from
Closed
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
28 changes: 28 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,34 @@ The Rebalancer sends funds to be auctioned daily. If you are a market maker inte
- [untrn, newt] - `neutron1zvw9l8c82hnvwsntpuy89p86ztfmmudd9usfmnpa2tnqws74zsxq56sczm`
- [uusdc, newt] - `neutron1vu04szc78ae0nplwpuxjr6j592hn2d60zqtuts7w3ah6kajtxd2q2vfv59`

## Neutron Testnet Contracts

[![Check Set-Up & Build](https://github.com/timewave-computer/valence-services/actions/workflows/check.yml/badge.svg)](https://github.com/timewave-computer/valence-services/actions/workflows/check.yml)

### Code ids

- auctions-manager - `5673`
- auction - `5679`
- services-manager - `5674`
- rebalancer - `8367`
- oracle - `8368`
- account - `5677`

### Addresses

- Services manager - `neutron13ncggwefau3xla04vlugy20meap7g7a9lf2d2sxwgwvgr9mnn3yqkpjzs6`
- Auctions manager - `neutron1669ftav8rv4hjuak89w04k7f0f7m9qq9564s00ld4m8dvhsr5hfsxy3x46`
- Rebalancer - `neutron1y9aurkegmqlqwhsnwctee4w4aja7n64yuat800p8yys509pyl0fsvrmydm`
- Oracle - `neutron1g4qcmk65nw57hmqlzk6cejnftg20zmctky0l2epdfz3npw3x2cmqprul6f`
- Account - `neutron1gc3tt3edg3drsc3aa22du9pa9f9s2gx6reu2hvq7s6yrdmy8zqjssfj52p`

### Auctions addresses

denom - `factory/neutron1phx0sz708k3t6xdnyc98hgkyhra4tp44et5s68/rebalancer-test`

- [untrn, test] - `neutron10p7d4ca0a5a3plx0d3dw0qmrnldfxwgq8q48205za6pgyhmqqzasg58fg4`
- [test, untrn] - `neutron1s859kh0cgte55fmgtksylw5khv8yxvhslpxmpqdy46fv8q7wxj8qtplru4`

## Security

If you believe you've found a security-related issue with the contracts associated with this repository, please disclose responsibly by contacting the Timewave team at [[email protected]](mailto:[email protected]).
Expand Down
7 changes: 7 additions & 0 deletions scripts/add_service_to_manager.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@ elif [[ "$CHAIN" == 'neutron' || "$CHAIN" == 'ntrn' ]]; then
FEES="1000untrn"

ADDR_SERVICES_MANAGER="neutron1gantvpnat0la8kkkzrnj48d5d8wxdjllh5r2w4r2hcrpwy00s69quypupa"
elif [[ "$CHAIN" == 'ntrn-testnet' ]]; then
BINARY="neutrond"
GAS_PRICES="0.075untrn"
OWNER_ADDR="neutron1phx0sz708k3t6xdnyc98hgkyhra4tp44et5s68"
FEES="1000untrn"

ADDR_SERVICES_MANAGER="neutron13ncggwefau3xla04vlugy20meap7g7a9lf2d2sxwgwvgr9mnn3yqkpjzs6"
else
echo "Unknown chain"
fi
Expand Down
36 changes: 30 additions & 6 deletions scripts/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,25 @@ elif [[ "$CHAIN" == 'neutron' || "$CHAIN" == 'ntrn' ]]; then
# General data per chain
WHITELISTED_DENOMS='["untrn", "ibc/C4CFF46FD6DE35CA4CF4CE031E643C8FDC9BA4B99AE598E9B0ED98FE3A2319F9"]'
WHITELISTED_BASE_DENOMS='[{"denom": "untrn", "min_balance_limit": "10000000"}, {"denom": "ibc/C4CFF46FD6DE35CA4CF4CE031E643C8FDC9BA4B99AE598E9B0ED98FE3A2319F9", "min_balance_limit": "10000000"}]'
elif [[ "$CHAIN" == 'ntrn-testnet' ]]; then
BINARY="neutrond"
GAS_PRICES="0.075untrn"
OWNER_ADDR="neutron1phx0sz708k3t6xdnyc98hgkyhra4tp44et5s68"

CODE_ID_ACCOUNT=5677
CODE_ID_SERVICES_MANAGER=5674
CODE_ID_REBALANCER=5675
CODE_ID_ORACLE=5676
CODE_ID_AUCTION=5679
CODE_ID_AUCTIONS_MANAGER=5673

# Contracts addresses for init below
ADDR_SERVICES_MANAGER="neutron13ncggwefau3xla04vlugy20meap7g7a9lf2d2sxwgwvgr9mnn3yqkpjzs6"
ADDR_AUCTIONS_MANAGER="neutron1669ftav8rv4hjuak89w04k7f0f7m9qq9564s00ld4m8dvhsr5hfsxy3x46"

# General data per chain
WHITELISTED_DENOMS='["untrn", "factory/neutron1phx0sz708k3t6xdnyc98hgkyhra4tp44et5s68/rebalancer-test"]'
WHITELISTED_BASE_DENOMS='[{"denom": "untrn", "min_balance_limit": "1000"}, {"denom": "factory/neutron1phx0sz708k3t6xdnyc98hgkyhra4tp44et5s68/rebalancer-test", "min_balance_limit": "1000"}]'
else
echo "Unknown chain"
fi
Expand Down Expand Up @@ -74,15 +93,16 @@ elif [[ "$COMMAND" == 'services-manager' ]]; then

$BINARY tx wasm init $CODE_ID_SERVICES_MANAGER "$init_msg" --label "Valence services manager" \
--admin $OWNER_ADDR --from $OWNER_ADDR $EXECUTE_FLAGS

################################################
############### Auctions Manager ###############
################################################
elif [[ "$COMMAND" == 'auctions-manager' ]]; then
init_msg=$(jq -n \
--argjson auction_code_id $CODE_ID_AUCTION \
--arg server_addr $OWNER_ADDR \
'{ auction_code_id: $auction_code_id,
min_auction_amount: [["untrn", "20000"], ["ibc/C4CFF46FD6DE35CA4CF4CE031E643C8FDC9BA4B99AE598E9B0ED98FE3A2319F9", "10000"]]
min_auction_amount: [["untrn", {"send": "1000", "start_auction": "1000"}], ["factory/neutron1phx0sz708k3t6xdnyc98hgkyhra4tp44et5s68/rebalancer-test", {"send": "1000", "start_auction": "1000"}]],
server_addr: $server_addr
}')

$BINARY tx wasm init $CODE_ID_AUCTIONS_MANAGER "$init_msg" --label "Valence auctions manager" \
Expand All @@ -108,9 +128,9 @@ elif [[ "$COMMAND" == 'rebalancer' ]]; then
base_denom_whitelist: $whitelist_base_denom,
cycle_period: 60,
fees: {
denom: "untrn",
register_fee: "1000000",
resume_fee: "1000000"
denom: "factory/neutron1phx0sz708k3t6xdnyc98hgkyhra4tp44et5s68/rebalancer-test",
register_fee: "1000",
resume_fee: "1000"
},
}')

Expand All @@ -126,7 +146,11 @@ elif [[ "$COMMAND" == 'oracle' ]]; then
init_msg=$(
jq -n \
--arg auctions_manager_addr "$ADDR_AUCTIONS_MANAGER" \
'{auctions_manager_addr: $auctions_manager_addr}'
'{
auctions_manager_addr: $auctions_manager_addr,
seconds_allow_manual_change: 60,
seconds_auction_prices_fresh: 360
}'
)

$BINARY tx wasm init $CODE_ID_ORACLE "$init_msg" --label "Valence oracle" \
Expand Down
12 changes: 6 additions & 6 deletions scripts/migrate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ SERVICES_MANAGER_ADDR="neutron1gantvpnat0la8kkkzrnj48d5d8wxdjllh5r2w4r2hcrpwy00s
AUCTIONS_MANAGER_ADDR="neutron13exc5wdc7y5qpqazc34djnu934lqvfw2dru30j52ahhjep6jzx8ssjxcyz"

# Code ids
REBALANCER_CODE_ID=1501
ORACLE_CODE_ID=1505
SERVICES_MANAGER_CODE_ID=1503
AUCTIONS_MANAGER_CODE_ID=1502
AUCTION_CODE_ID=1504
ACCOUNT_CODE_ID=1506
SERVICES_MANAGER_CODE_ID=1615
REBALANCER_CODE_ID=1616
AUCTIONS_MANAGER_CODE_ID=1614
AUCTION_CODE_ID=1617
ORACLE_CODE_ID=1619
ACCOUNT_CODE_ID=1618

# array of pairs we have to migrate
declare -a PAIRS=(
Expand Down
10 changes: 8 additions & 2 deletions scripts/new_auction.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ elif [[ "$CHAIN" == 'neutron' || "$CHAIN" == 'ntrn' ]]; then
OWNER_ADDR="neutron1phx0sz708k3t6xdnyc98hgkyhra4tp44et5s68"

ADDR_AUCTIONS_MANAGER="neutron13exc5wdc7y5qpqazc34djnu934lqvfw2dru30j52ahhjep6jzx8ssjxcyz"
elif [[ "$CHAIN" == 'ntrn-testnet' ]]; then
BINARY="neutrond"
GAS_PRICES="0.075untrn"
OWNER_ADDR="neutron1phx0sz708k3t6xdnyc98hgkyhra4tp44et5s68"

ADDR_AUCTIONS_MANAGER="neutron1669ftav8rv4hjuak89w04k7f0f7m9qq9564s00ld4m8dvhsr5hfsxy3x46"
else
echo "Unknown chain"
fi
Expand All @@ -23,8 +29,8 @@ EXECUTE_FLAGS="--gas-prices $GAS_PRICES --gas auto --gas-adjustment 1.4 -y"
# EXECUTE_FLAGS="--fees $FEES --gas auto --gas-adjustment 1.4 -y"

## You can change value manually and uncomment it here
PAIR='["ibc/B559A80D62249C8AA07A380E2A2BEA6E5CA9A6F079C912C3A9E9B494105E4F81", "factory/neutron1p8d89wvxyjcnawmgw72klknr3lg9gwwl6ypxda/newt"]'
LABEL="auction USDC/NEWT"
PAIR='["factory/neutron1phx0sz708k3t6xdnyc98hgkyhra4tp44et5s68/rebalancer-test", "untrn"]'
LABEL="auction TEST/NTRN"
AUCTION_STRATEGY='{ "start_price_perc": 5000, "end_price_perc": 5000 }'
CHAIN_HALT='{ "cap": "14400", "block_avg": "3" }'
PRICE_FRESHNESS='{ "limit": "3", "multipliers": [["2", "2"], ["1", "1.5"]] }'
Expand Down
2 changes: 1 addition & 1 deletion scripts/register_to_service.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ execute_msg=$(jq -n \
'{
"register_to_service": {
"service_name": "rebalancer",
"data": "ewoiYmFzZV9kZW5vbSI6ICJpYmMvQzRDRkY0NkZENkRFMzVDQTRDRjRDRTAzMUU2NDNDOEZEQzlCQTRCOTlBRTU5OEU5QjBFRDk4RkUzQTIzMTlGOSIsCiJwaWQiOiB7ICJwIjogIjAuMSIsICJpIjogIjAiLCAiZCI6ICIwIiB9LAoidGFyZ2V0X292ZXJyaWRlX3N0cmF0ZWd5IjogInByb3BvcnRpb25hbCIsCiJ0YXJnZXRzIjogWwp7CiJkZW5vbSI6ICJpYmMvQzRDRkY0NkZENkRFMzVDQTRDRjRDRTAzMUU2NDNDOEZEQzlCQTRCOTlBRTU5OEU5QjBFRDk4RkUzQTIzMTlGOSIsCiJicHMiOiA1MDAwCn0sCnsgImRlbm9tIjogInVudHJuIiwgImJwcyI6IDUwMDAgfQpdCn0="
"data": "ewoiYmFzZV9kZW5vbSI6ICJmYWN0b3J5L25ldXRyb24xcGh4MHN6NzA4azN0NnhkbnljOThoZ2t5aHJhNHRwNDRldDVzNjgvcmViYWxhbmNlci10ZXN0IiwKInBpZCI6IHsgInAiOiAiMC4xIiwgImkiOiAiMCIsICJkIjogIjAiIH0sCiJ0YXJnZXRfb3ZlcnJpZGVfc3RyYXRlZ3kiOiAicHJvcG9ydGlvbmFsIiwKInRhcmdldHMiOiBbCnsKImRlbm9tIjogImZhY3RvcnkvbmV1dHJvbjFwaHgwc3o3MDhrM3Q2eGRueWM5OGhna3locmE0dHA0NGV0NXM2OC9yZWJhbGFuY2VyLXRlc3QiLAoiYnBzIjogNTAwMAp9LAp7ICJkZW5vbSI6ICJ1bnRybiIsICJicHMiOiA1MDAwIH0KXQp9"
}
}')

Expand Down
11 changes: 8 additions & 3 deletions scripts/update_oracle_addr.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,23 @@ elif [[ "$CHAIN" == 'neutron' || "$CHAIN" == 'ntrn' ]]; then
FEES="1000untrn"

ADDR_AUCTIONS_MANAGER="neutron13exc5wdc7y5qpqazc34djnu934lqvfw2dru30j52ahhjep6jzx8ssjxcyz"
elif [[ "$CHAIN" == 'ntrn-testnet' ]]; then
BINARY="neutrond"
GAS_PRICES="0.075untrn"
OWNER_ADDR="neutron1phx0sz708k3t6xdnyc98hgkyhra4tp44et5s68"

ADDR_AUCTIONS_MANAGER="neutron1669ftav8rv4hjuak89w04k7f0f7m9qq9564s00ld4m8dvhsr5hfsxy3x46"
else
echo "Unknown chain"
fi

EXECUTE_FLAGS="--gas-prices $GAS_PRICES --gas auto --gas-adjustment 1.4 -y"
# EXECUTE_FLAGS="--fees $FEES --gas auto --gas-adjustment 1.4 -y"

execute_msg=$(jq -n \
--arg oracle_Addr "$ORACLE_ADDR" \
--arg oracle_addr "$ORACLE_ADDR" \
'{admin: {
update_oracle: {
oracle_addr: $oracle_Addr,
oracle_addr: $oracle_addr,
}
}}')

Expand Down
9 changes: 8 additions & 1 deletion scripts/update_price.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@ elif [[ "$CHAIN" == 'neutron' || "$CHAIN" == 'ntrn' ]]; then
FEES="1000untrn"

ORACLE_ADDR="neutron1s8uqyh0mmh8g66s2dectf56c08y6fvusp39undp8kf4v678ededsy6tstf"
elif [[ "$CHAIN" == 'ntrn-testnet' ]]; then
BINARY="neutrond"
GAS_PRICES="0.075untrn"
OWNER_ADDR="neutron1phx0sz708k3t6xdnyc98hgkyhra4tp44et5s68"
FEES="1000untrn"

ORACLE_ADDR="neutron1g4qcmk65nw57hmqlzk6cejnftg20zmctky0l2epdfz3npw3x2cmqprul6f"
else
echo "Unknown chain"
fi
Expand All @@ -45,7 +52,7 @@ else
--arg pair1 "$PAIR1" \
--arg pair2 "$PAIR2" \
--arg price "$PRICE" \
'{update_price: {
'{manual_price_update: {
pair: [$pair1, $pair2],
price: $price,
}}')
Expand Down
8 changes: 7 additions & 1 deletion scripts/upload.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,14 @@ elif [[ "$CHAIN" == 'neutron' || "$CHAIN" == 'ntrn' ]]; then
OWNER_ADDR="neutron1phx0sz708k3t6xdnyc98hgkyhra4tp44et5s68"
AUCTIONS_MANAGER_ADDR="neutron13exc5wdc7y5qpqazc34djnu934lqvfw2dru30j52ahhjep6jzx8ssjxcyz"

elif [[ "$CHAIN" == 'ntrn-testnet' ]]; then
BINARY="neutrond"
GAS_PRICES="0.075untrn"
OWNER_ADDR="neutron1phx0sz708k3t6xdnyc98hgkyhra4tp44et5s68"
AUCTIONS_MANAGER_ADDR="neutron1669ftav8rv4hjuak89w04k7f0f7m9qq9564s00ld4m8dvhsr5hfsxy3x46"

else

echo "Unknown chain"
fi

Expand All @@ -43,7 +50,6 @@ REBALANCER_FILE_NAME="$ARTIFACTS_PATH/rebalancer.wasm"
if [[ "$COMMAND" == 'account' ]]; then
$BINARY tx wasm s $ACCOUNT_FILE_NAME --from $OWNER_ADDR $ACCOUNT_EXECUTE_FLAGS
elif [[ "$COMMAND" == 'auction' ]]; then
# Auction needs to be instantiated by the manager, so need to change the --instantiate-anyof-addresses
$BINARY tx wasm s $AUCTION_FILE_NAME --from $OWNER_ADDR $EXECUTE_FLAGS
elif [[ "$COMMAND" == 'auctions-manager' ]]; then
$BINARY tx wasm s $AUCTIONS_MANAGER_FILE_NAME --from $OWNER_ADDR $EXECUTE_FLAGS
Expand Down