Skip to content

Commit

Permalink
Merge pull request #293 from convergence-rfq/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
pindaroso authored Apr 12, 2024
2 parents c79e520 + 68184ae commit 4d1ceeb
Show file tree
Hide file tree
Showing 273 changed files with 22,342 additions and 8,507 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,12 @@ jobs:
shell: bash
run: yarn validator & sleep 3

- name: Logs
continue-on-error: false
shell: bash
run: yarn validator:logs & sleep 3

- name: Test
run: yarn test


1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ packages/js/.turbo
packages/cli/node_modules
packages/cli/dist
packages/cli/tests/ctx.json
packages/cli/src/customScript.ts
packages/cli/.turbo
packages/js/.nyc_output
packages/cli/.nyc_output
Expand Down
223 changes: 221 additions & 2 deletions packages/cli/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,231 @@
# @convergence-rfq/cli

## 6.6.2

### Major Changes

- add getRequiredCollateralForSettlement operation

### Patch Changes

- Updated dependencies
- @convergence-rfq/sdk@7.0.0

## 6.6.1

### Patch Changes

- Add clear cache before finding a vacant base asset index
- Updated dependencies
- @convergence-rfq/sdk@6.6.1

## 6.6.0

### Minor Changes

- Add user asset functionality, remove duplicated operation to change the existing base asset, add logic to automatically find a vacant base asset index

### Patch Changes

- Updated dependencies
- @convergence-rfq/sdk@6.6.0

## 6.5.0

### Minor Changes

- Replace risk engine program with a simplified one, add squads integration

### Patch Changes

- Updated dependencies
- @convergence-rfq/sdk@6.5.0

## 6.4.2

### Patch Changes

- Update some of vault operator actions API
- Updated dependencies
- @convergence-rfq/sdk@6.4.2

## 6.4.1

### Patch Changes

- Removed reduntant console log
- Updated dependencies
- @convergence-rfq/sdk@6.4.1

## 6.4.0

### Minor Changes

- Add vault operator functionality - an ability to predefine acceptable price for an rfq. User would deposit tokens at the moment of the rfq creation and the settlement would be executed automatically if an acceptable response arrives using a crank bot

### Patch Changes

- Updated dependencies
- @convergence-rfq/sdk@6.4.0

## 6.3.3

### Patch Changes

- Update max-retries logic
- Updated dependencies
- @convergence-rfq/sdk@6.3.3

## 6.3.2

### Patch Changes

- Add max-retries arg to cli and also implement maxRetries logic for retrying sending failed txs to chain again
- Updated dependencies
- @convergence-rfq/sdk@6.3.2

## 6.3.1

### Patch Changes

- Add tx-priority-fee argument to cli and modify sdk txPriority to take custom values
- Updated dependencies
- @convergence-rfq/sdk@6.3.1

## 6.3.0

### Minor Changes

- Update program ids and add vault operator program

### Patch Changes

- Updated dependencies
- @convergence-rfq/sdk@6.3.0

## 6.2.1

### Patch Changes

- fix addJupBaseAssets command
- Updated dependencies
- @convergence-rfq/sdk@6.2.1

## 6.2.0

### Minor Changes

- Integrate hxro ,collateral req changes

### Patch Changes

- Updated dependencies
- @convergence-rfq/sdk@6.2.0

## 6.1.0

### Minor Changes

- Remove collateral requirements, add quote spot fees, add spot instrument config, remove operations to unlock collateral or settle defaults

### Patch Changes

- Updated dependencies
- @convergence-rfq/sdk@6.1.0

## 6.0.1

### Patch Changes

- Updated dependencies
- @convergence-rfq/sdk@6.0.1

## 6.0.0

### Patch Changes

- Updated dependencies
- @convergence-rfq/sdk@6.0.0

## 4.5.35

### Patch Changes

- Updated dependencies
- @convergence-rfq/sdk@4.5.35

## 4.5.34

### Patch Changes

- fix updateBaseAsset cmd

## 4.5.33

### Patch Changes

- Add Birdeye support to fetch token prices for adding jup base assets

## 4.5.32

### Patch Changes

- add additional mint address check for addJupiterTokens check

## 4.5.31

### Patch Changes

- add update base assets command

## 4.5.30

### Patch Changes

- Updated dependencies
- @convergence-rfq/sdk@4.5.30

## 4.5.29

### Patch Changes

- Updated dependencies
- @convergence-rfq/sdk@4.5.29

## 4.5.28

### Patch Changes

- Updated dependencies
- @convergence-rfq/sdk@4.5.28

## 4.5.27

### Patch Changes

- Updated dependencies
- @convergence-rfq/sdk@4.5.27

## 4.5.26

### Patch Changes

- Updated dependencies
- @convergence-rfq/sdk@4.5.26

## 4.5.25

### Patch Changes

- Updated dependencies
- @convergence-rfq/sdk@4.5.25

## 4.5.24

### Patch Changes

- Added whitelist
- Updated dependencies
- @convergence-rfq/sdk@4.5.24
- @convergence-rfq/sdk@4.5.24

## 4.5.22

Expand Down
6 changes: 3 additions & 3 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@convergence-rfq/cli",
"description": "Official Convergence CLI",
"version": "4.5.24",
"version": "6.6.2",
"license": "MIT",
"publishConfig": {
"access": "public"
Expand Down Expand Up @@ -47,7 +47,7 @@
"cli": "ts-node src/index.ts"
},
"dependencies": {
"@convergence-rfq/sdk": "4.5.24",
"@convergence-rfq/sdk": "6.6.2",
"@solana/web3.js": "^1.87.6",
"@types/cookie": "^0.5.1",
"commander": "^10.0.0"
Expand All @@ -61,4 +61,4 @@
"sinon": "^15.0.1",
"ts-mocha": "^10.0.0"
}
}
}
17 changes: 12 additions & 5 deletions packages/cli/scripts/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ set -e

export DEVNET="true"

export SPOT_INSTRUMENT="CjQCEjXtG3QNBuT5Z1sctaAYCo5Mt6edftqHQetEPo9w"
export PSYOPTIONS_EUROPEAN_INSTRUMENT="A86fhhdNVDdXV8pB48WXtPeM3EBkcBeJEdrx9xrUo9nF"
export PSYOPTIONS_AMERICAN_INSTRUMENT="6JG1tWK4w6LmjeXbmDZJsmUsPSjgnp74j2XPsTvjjTX8"
export SPOT_INSTRUMENT="4A9M7iojGDPc4n4YDGnTmsYsNKUohG1zM1nrAqVMMmrm"
export PSYOPTIONS_EUROPEAN_INSTRUMENT="6B7TdBNAF7tWWz5sZbbBZj8jH1ix7QWAchtkvMHveEuW"
export PSYOPTIONS_AMERICAN_INSTRUMENT="HGmSFSRfVAG8RC8Ae4G1JFSHK7Au5GrGskDxncG3JRok"
export HXRO_PRINT_TRADE_PROVIDER="4WbVwc5Edfo3oB1n16bVC9qrghYHSNh1qAECbSCyiT95"

# Same for devnet and mainnet
export BTC_ORACLE_ADDRESS="8SXvChNYFhRq4EZuZvnhjrB3jJRQCv4k3P4W6hesH3Ee"
Expand All @@ -31,6 +32,12 @@ convergence protocol initialize --collateral-mint=$USDC_MINT --rpc-endpoint=$RPC

convergence risk-engine initialize --rpc-endpoint=$RPC_ENDPOINT

convergence protocol add-print-trade-provider --print-trade-provider-program $HXRO_PRINT_TRADE_PROVIDER --settlement-can-expire false --validate-response-account-amount 2 --rpc-endpoint=$RPC_ENDPOINT
convergence hxro initialize-config --valid-mpg $HXRO_MPG --rpc-endpoint=$RPC_ENDPOINT
convergence hxro initialize-operator-trg --rpc-endpoint=$RPC_ENDPOINT

convergence spot-instrument initialize-config --fee-bps "0.01" --rpc-endpoint=$RPC_ENDPOINT

convergence protocol add-instrument --instrument-program=$SPOT_INSTRUMENT --can-be-used-as-quote=true --validate-data-account-amount=1 --prepare-to-settle-account-amount=7 --settle-account-amount=3 --revert-preparation-account-amount=3 --clean-up-account-amount=4 --rpc-endpoint=$RPC_ENDPOINT
convergence protocol add-instrument --instrument-program=$PSYOPTIONS_EUROPEAN_INSTRUMENT --can-be-used-as-quote=false --validate-data-account-amount=2 --prepare-to-settle-account-amount=7 --settle-account-amount=3 --revert-preparation-account-amount=3 --clean-up-account-amount=4 --rpc-endpoint=$RPC_ENDPOINT
convergence protocol add-instrument --instrument-program=$PSYOPTIONS_AMERICAN_INSTRUMENT --can-be-used-as-quote=false --validate-data-account-amount=3 --prepare-to-settle-account-amount=7 --settle-account-amount=3 --revert-preparation-account-amount=3 --clean-up-account-amount=4 --rpc-endpoint=$RPC_ENDPOINT
Expand All @@ -45,8 +52,8 @@ convergence risk-engine set-risk-categories-info --new-value="0.05,1.2,0.06,0.6,
convergence risk-engine set-risk-categories-info --new-value="0.05,2.4,0.08,0.8,0.16,1.2,0.32,1.6,0.48,2.0,0.8,2.4,1.2,2.8" --category=high --rpc-endpoint=$RPC_ENDPOINT
convergence risk-engine set-risk-categories-info --new-value="0.05,5.0,0.10,1.0,0.20,1.5,0.40,2.0,0.60,2.5,1.0,3.0,1.5,3.5" --category=very-high --rpc-endpoint=$RPC_ENDPOINT

convergence protocol add-base-asset --ticker=BTC --oracle-address=$BTC_ORACLE_ADDRESS --oracle-source=switchboard --rpc-endpoint=$RPC_ENDPOINT
convergence protocol add-base-asset --ticker=SOL --oracle-address=$SOL_ORACLE_ADDRESS --oracle-source=switchboard --rpc-endpoint=$RPC_ENDPOINT
convergence protocol add-base-asset --index=0 --ticker=BTC --oracle-address=$BTC_ORACLE_ADDRESS --oracle-source=switchboard --rpc-endpoint=$RPC_ENDPOINT
convergence protocol add-base-asset --index=1 --ticker=SOL --oracle-address=$SOL_ORACLE_ADDRESS --oracle-source=switchboard --rpc-endpoint=$RPC_ENDPOINT

convergence protocol register-mint --mint=$BTC_MINT --base-asset-index=0 --rpc-endpoint=$RPC_ENDPOINT
convergence protocol register-mint --mint=$SOL_MINT --base-asset-index=1 --rpc-endpoint=$RPC_ENDPOINT
Expand Down
Loading

0 comments on commit 4d1ceeb

Please sign in to comment.