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

incentive APR query fix #544

Merged
merged 25 commits into from
Jun 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
23e2f0c
incentive APR query fix
jelysn May 28, 2024
98de248
update apr tracking from last 24hrs data
jelysn May 30, 2024
ebf6f37
Update MaxEdenRewardAprLps to be applied on ProxyTVL instead of TVL
jelysn May 31, 2024
22f9f1b
code cleanup
jelysn May 31, 2024
1cb6b89
Add wasmbinding for leveragelp open and close estimation
jelysn Jun 3, 2024
0fa5ccb
Add CLI command for open and close estimation of leveragelp
jelysn Jun 3, 2024
5a03644
Write basic masterchef spec
jelysn Jun 4, 2024
51e563b
Write basic leveragelp spec
jelysn Jun 4, 2024
ddf85cc
cleanup endpoints data
jelysn Jun 4, 2024
a33ea04
move some contents from PR 545 - leveragelp doc
jelysn Jun 6, 2024
3f12f8f
move some contents from PR 546 - masterchef doc
jelysn Jun 6, 2024
2eb9799
add more on endpoints
jelysn Jun 6, 2024
0b34193
more details in leveragelp and masterchef spec
jelysn Jun 6, 2024
5f2612d
copy mechanism section from PR545
jelysn Jun 6, 2024
e932d55
add query and msg for leveragelp rewards
jelysn Jun 7, 2024
6c074bf
update leveragelp liquidation & stopLoss price execution flow
jelysn Jun 12, 2024
e17b6d0
.version was added
fenriz07 Jun 12, 2024
a7baaf1
deploy was added
fenriz07 Jun 12, 2024
3dd0ada
update consensus version of masterchef to prevent panic in unmarshal
jelysn Jun 13, 2024
01c135b
Merge branch 'post_v32_fix' of github.com:elys-network/elys into post…
jelysn Jun 13, 2024
ecf1021
.version was added
fenriz07 Jun 13, 2024
20b264d
Merge branch 'main' of github.com:elys-network/elys into post_v32_fix
jelysn Jun 14, 2024
1f7f6cc
v4 migration update
jelysn Jun 14, 2024
e8acac3
refactor perpetual module files to avoid too many short files
jelysn Jun 14, 2024
febe882
refactor files in perp
jelysn Jun 14, 2024
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
126 changes: 126 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
name: Deploy in devnet
on:
push:
branches:
- devnet
jobs:
deploy:
runs-on: ubuntu-latest
environment: devnet
env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
NAME: elys
COMMIT: ${{ github.sha }}
VERSION:
BINARY:
DBENGINE: pebbledb
COSMWASM_VERSION:
NAME_WITH_VERSION:
steps:
- name: Checking repository
uses: actions/checkout@v4
- name: Setting variables
run: |
VER=$(cat .version)
echo "VERSION=$VER" >> $GITHUB_ENV
echo "BINARY=${NAME}d" >> $GITHUB_ENV
echo "NAME_WITH_VERSION=${NAME}-${VER}" >> $GITHUB_ENV
- name: Debuging enviroment
run: |
echo "BRANCH NAME:" $BRANCH_NAME
echo "NAME:" $NAME
echo "COMMIT:" $COMMIT
echo "VERSION": $VERSION
echo "BYNARY": $BINARY
echo "NAME_WITH_VERSION": $NAME_WITH_VERSION
- name: Setuping go
uses: actions/setup-go@v5
with:
go-version: "1.21"
- name: Building elys binary
env:
CGO_ENABLED: 1
run: |
echo Building elysd binary

COSMWASM_VERSION=$(go list -m github.com/CosmWasm/wasmvm | sed 's/.* //')
echo $COSMWASM_VERSION

sudo wget https://github.com/CosmWasm/wasmvm/releases/download/${COSMWASM_VERSION}/libwasmvm_muslc.x86_64.a -O /usr/lib/libwasmvm.x86_64.a

sudo GOOS=linux GOARCH=amd64 go build -mod=readonly -trimpath -o elysd -ldflags "-X github.com/cosmos/cosmos-sdk/version.Name=${NAME} \
-X github.com/cosmos/cosmos-sdk/version.AppName=${NAME} \
-X github.com/cosmos/cosmos-sdk/version.ServerName=${BINARY} \
-X github.com/cosmos/cosmos-sdk/version.ClientName=${BINARY} \
-X github.com/cosmos/cosmos-sdk/version.Version=${VERSION} \
-X github.com/cosmos/cosmos-sdk/version.Commit=${COMMIT} \
-X github.com/cosmos/cosmos-sdk/types.DBBackend=${DBENGINE} \
-X github.com/cosmos/cosmos-sdk/version.BuildTags=netgo,ledger,muslc,osusergo,${DBENGINE} \
-w -s \
-linkmode=external \
-extldflags '-Wl,-z,muldefs -static -lm'" -tags "ledger,${DBENGINE}" ./cmd/${BINARY}
echo "Version of elysd: $(./elysd version)"
- name: Compressing elys binary
run: |
cp elysd /tmp/elysd
sudo apt-get install -y tar
tar czvf ${{env.NAME_WITH_VERSION}}.tar.gz elysd
mkdir -p ${{env.NAME_WITH_VERSION}}
mv ${{env.NAME_WITH_VERSION}}.tar.gz ${{env.NAME_WITH_VERSION}}/${{env.NAME_WITH_VERSION}}.tar.gz
- uses: ryand56/r2-upload-action@latest
id: bucket
name: Uploading binary to bucket
with:
r2-account-id: ${{ secrets.R2_ACCOUNT_ID }}
r2-access-key-id: ${{ secrets.R2_ACCESS_KEY_ID }}
r2-secret-access-key: ${{ secrets.R2_SECRET_ACCESS_KEY }}
r2-bucket: ${{ secrets.R2_BUCKET }}
source-dir: ${{env.NAME_WITH_VERSION}}
destination-dir: releases
- name: Creating software upgrade proposal
run: |

# helper functions
extract_txhash() { awk -F 'txhash: ' '/txhash:/{print $2; exit}'; }
extract_proposal_id() { awk -F 'key: proposal_id|value: ' '/key: proposal_id/ { getline; gsub(/"/, "", $2); print $2; exit }'; }
extract_and_calc_upgrade_height() { awk -F'"latest_block_height":"' '{ split($2,a,"\""); print a[1]+25; exit }'; }
extract_checksum() { awk "/elysd-${{ github.ref_name }}-linux-amd64.tar.gz/ {print \$1; exit}"; }

# environment variables
ELYSD=/tmp/elysd
NODE=https://rpc.devnet.elys.network:443
OPTIONS="--node $NODE --chain-id elysdevnet-1 --keyring-backend=test -b=sync --fees=100000uelys --gas=300000 -y"

# save private keys to files
echo "${{ secrets.PRIVATE_KEY_FUJI }}" > /tmp/private_key_fuji.txt
echo "${{ secrets.PRIVATE_KEY_MALLORCA }}" > /tmp/private_key_mallorca.txt

# recover keys
echo "${{ secrets.PASSPHRASE_FUJI }}" | $ELYSD keys import fuji --keyring-backend test /tmp/private_key_fuji.txt
echo "${{ secrets.PASSPHRASE_MALLORCA }}" | $ELYSD keys import mallorca --keyring-backend test /tmp/private_key_mallorca.txt

# get checksum
# checksum=$(cat dist/sha256sum.txt | extract_checksum)

# query and upgrade height
height=$($ELYSD status --node $NODE | extract_and_calc_upgrade_height)
# create proposal
txhash=$(
$ELYSD tx gov submit-legacy-proposal software-upgrade \
${{env.VERSION}} \
--deposit=10000000uelys \
--upgrade-height=$height \
--title="${{env.VERSION}}" \
--description="Elys Network${{env.VERSION}} released. Focuses on enhancements and codebase improvements." \
--upgrade-info="{\"binaries\":{\"linux/amd64\":\"https://snapshots.elys.network/releases/${{env.NAME_WITH_VERSION}}.tar.gz\"}}" \
--no-validate \
--from=mallorca \
$OPTIONS | extract_txhash
)
sleep 10
proposalid=$($ELYSD q tx $txhash --node $NODE | extract_proposal_id)

# vote on proposal
$ELYSD tx gov vote $proposalid yes --from=fuji $OPTIONS
$ELYSD tx gov vote $proposalid yes --from=mallorca $OPTIONS
sleep 10
1 change: 1 addition & 0 deletions .version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v0.32.1
1 change: 1 addition & 0 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -1005,6 +1005,7 @@ func NewElysApp(
app.StablestakeKeeper,
app.CommitmentKeeper,
app.AssetprofileKeeper,
app.MasterchefKeeper,
)
leveragelpModule := leveragelpmodule.NewAppModule(appCodec, app.LeveragelpKeeper, app.AccountKeeper, app.BankKeeper)

Expand Down
3 changes: 0 additions & 3 deletions config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -454,9 +454,6 @@ genesis:
- denom: "uinc"
min_amount: "1000000"
reward_portion_for_lps: "0.6"
dex_rewards_lps:
num_blocks: "1"
amount: "0"
max_eden_reward_apr_lps: "0.5"
protocol_revenue_address: "elys10d07y265gmmuvt4z0w9aw880jnsr700j6z2zm3"
chain_id: elystestnet-1
Loading
Loading