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

Strategy + Events #65

Draft
wants to merge 82 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
82 commits
Select commit Hold shift + click to select a range
866a640
Update view for iterating over pool rewards instead of user earnings
LikoIlya Jun 23, 2022
cb76f4c
remove unused var
LikoIlya Jun 23, 2022
3c70ec9
add semicolon
LikoIlya Jun 23, 2022
e6760f3
Merge remote-tracking branch 'origin/readme-patch' into feature/strategy
LikoIlya Oct 24, 2022
ca69703
Initial draft of strategy implementation
LikoIlya Oct 25, 2022
bc6d3e5
Inject strategy methods and lambdas
LikoIlya Oct 26, 2022
33adeeb
Try fix tests
LikoIlya Oct 27, 2022
a26170a
update workflow
LikoIlya Oct 27, 2022
7c21816
upd workflow strange issues with flextesa
LikoIlya Oct 27, 2022
78f9da1
longer wait
LikoIlya Oct 27, 2022
3a3c06c
wait for sandbox up with action
LikoIlya Oct 28, 2022
bc4b1b8
Update flextesa versions
LikoIlya Oct 28, 2022
7b896c4
Upd host
LikoIlya Oct 28, 2022
e5bd553
hosts
LikoIlya Oct 28, 2022
2e443e9
add cache for contracts changes to build
LikoIlya Oct 28, 2022
966d5f6
Update utils
LikoIlya Oct 28, 2022
43cc243
Port utils
LikoIlya Oct 28, 2022
e745066
Workflow
LikoIlya Oct 28, 2022
e4dadc2
Update workflow
LikoIlya Oct 28, 2022
6c64c29
update caching contracts
LikoIlya Oct 28, 2022
7be236c
Update python tests
LikoIlya Oct 28, 2022
a7fc2d0
update compiled dex4factory
LikoIlya Oct 28, 2022
78ac50e
Update JS/TS tests
LikoIlya Oct 31, 2022
aa445f6
upd workflow
LikoIlya Nov 1, 2022
471e3b4
add check for unclaimed reserves
LikoIlya Nov 1, 2022
4b9eb30
Fix tests issues
LikoIlya Nov 2, 2022
4105226
Update params
LikoIlya Nov 2, 2022
1970a59
[?] add additional sleep
LikoIlya Nov 2, 2022
8fd2352
Merge pull request #54 from madfish-solutions/feat/strat/js-tests
LikoIlya Nov 7, 2022
8f9e065
Update helpers to operate with list of tokens
LikoIlya Nov 7, 2022
613109a
fix mistypes
LikoIlya Nov 7, 2022
99352a0
Temporary comment rebalance failcase
LikoIlya Nov 7, 2022
ed61d88
Fix comments
LikoIlya Nov 11, 2022
b9e3596
expr fix
LikoIlya Nov 11, 2022
9bf549e
Add view and check for registered strategy
LikoIlya Nov 11, 2022
3ce82ae
Preparation for multiple strategies and register flow
LikoIlya Nov 15, 2022
9ead4d5
Add manual rebalance
LikoIlya Nov 18, 2022
8cb3b12
remove unneeded check from desired reserves calculation
LikoIlya Nov 21, 2022
cfa504e
Merge pull request #51 from madfish-solutions/fix/views-for-stake-rew…
LikoIlya Nov 21, 2022
efce194
[WIP] Implementation feature strategy
LikoIlya Nov 21, 2022
30f20ac
[WIP] Tests for rebalance
LikoIlya Nov 25, 2022
3ab2936
Add rebalance test
LikoIlya Nov 25, 2022
d2da614
Merge branch 'feature/strategy' into feature/strategy-man-rebalance
LikoIlya Nov 25, 2022
c70155a
fix tests after changes
LikoIlya Nov 28, 2022
a93bbdd
Optimize views
LikoIlya Nov 28, 2022
57ed66f
Optimize views 2
LikoIlya Nov 28, 2022
22ce80e
Merge branch 'feature/strategy-register-check' into feature/strategy-…
LikoIlya Nov 28, 2022
d7b2cd2
Change require to skip
LikoIlya Nov 28, 2022
17115b8
refactor ifs
LikoIlya Nov 28, 2022
d984a40
Merge pull request #57 from madfish-solutions/feature/strategy-man-re…
LikoIlya Nov 28, 2022
99d8b7f
add rebalansing operations to swap invest and divest
LikoIlya Nov 29, 2022
61bc66e
Fix batch size limit
LikoIlya Nov 29, 2022
e7a13fe
add rebalance tests
LikoIlya Dec 1, 2022
7393677
Update to ligo v56
LikoIlya Dec 1, 2022
57dbf17
fix division
LikoIlya Dec 1, 2022
e69644c
fix delta in excpection
LikoIlya Dec 1, 2022
84179d5
Merge pull request #60 from madfish-solutions/feature/upd-ligo-56
LikoIlya Dec 2, 2022
3053087
Update logic for divesting tests
LikoIlya Dec 2, 2022
e3c5bdb
update tests methods
LikoIlya Dec 2, 2022
f2a17ec
Rebalance tests
LikoIlya Dec 2, 2022
dc6c2c2
[DEBUGGING] comment transfers
LikoIlya Dec 2, 2022
73e70bc
experiment with caching wf
LikoIlya Dec 2, 2022
402cc86
Upd naming
LikoIlya Dec 2, 2022
6ecc93b
comment unused var
LikoIlya Dec 2, 2022
3cff290
fix operations
LikoIlya Dec 2, 2022
2d3de8d
fix cache naming
LikoIlya Dec 2, 2022
1f66f0c
Update tests
LikoIlya Dec 4, 2022
3465ef9
Merge pull request #62 from madfish-solutions/fix/tests/rebalance-1
LikoIlya Dec 4, 2022
f6c950c
Merge pull request #61 from madfish-solutions/fix/tests/rebalance
LikoIlya Dec 4, 2022
942ab45
[CQS-99] Add events
LikoIlya Dec 5, 2022
2636000
Optimize batches
LikoIlya Dec 5, 2022
ce359bc
fix internal ops check after events
LikoIlya Dec 5, 2022
a552cbc
Op checks fix
LikoIlya Dec 5, 2022
0c646f9
move rebalance event to strategy
LikoIlya Dec 5, 2022
417f9ad
Merge pull request #59 from madfish-solutions/feat/strat/integr-rebal…
LikoIlya Dec 6, 2022
30cb8c3
Merge pull request #58 from madfish-solutions/feature/strategy
LikoIlya Dec 6, 2022
4cf48de
remove unused pool_id param
LikoIlya Dec 6, 2022
1ae0a56
Merge pull request #63 from madfish-solutions/feat/cache-workflow
LikoIlya Dec 6, 2022
45834d4
Merge pull request #64 from madfish-solutions/feature/events
LikoIlya Dec 6, 2022
c596005
Compile all lambda types in one script execution
LikoIlya Feb 15, 2023
6184396
remove unused
LikoIlya Feb 15, 2023
c71a970
Merge pull request #68 from madfish-solutions/better-lambda-compile
LikoIlya Feb 15, 2023
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
113 changes: 86 additions & 27 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,56 +6,115 @@ on:
- main
- develop
pull_request:
branches:
- main
- develop

jobs:
compile:
name: Compile contracts
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- uses: actions/cache@v3
id: contracts-build
with:
path: |
build
contracts/compiled
key: compiled-contracts-${{ runner.os }}-${{ hashFiles('contracts/**/*.ligo') }}
- name: Setup dependencies
uses: actions/setup-node@v3
with:
node-version: "18"
cache: 'yarn'
cache-dependency-path: './yarn.lock'
- name: Install modules
if: steps.contracts-build.outputs.cache-hit != 'true'
run: yarn install --immutable --immutable-cache --check-cache
- name: Compile contracts and test
if: steps.contracts-build.outputs.cache-hit != 'true'
run: yarn compile
compile-test:
name: Compile contracts for tests
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- uses: actions/cache@v3
id: contracts-build
with:
path: |
build
contracts/compiled
key: compiled-test-contracts-${{ runner.os }}-jest-${{ hashFiles('contracts/**/*.ligo') }}
- name: Setup dependencies
uses: actions/setup-node@v3
with:
node-version: "18"
cache: 'yarn'
cache-dependency-path: './yarn.lock'
- name: Install modules
if: steps.contracts-build.outputs.cache-hit != 'true'
run: yarn install --immutable --immutable-cache --check-cache
- name: Compile contracts and test
if: steps.contracts-build.outputs.cache-hit != 'true'
run: yarn compile-for-test
jest:
needs: compile-test
name: Jest tests
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Setup dependencies
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: "14"
node-version: "18"
cache: 'yarn'
cache-dependency-path: './yarn.lock'
- name: Install Git
run: sudo apt install git -y
- name: Install modules
run: yarn install
- name: Compile contracts for tests
run: yarn compile-for-test
- name: Start sandbox and wait for initialization
run: yarn start-sandbox && sleep 10s
run: yarn install --immutable --immutable-cache --check-cache
- uses: actions/cache@v3
id: contracts-build
with:
path: |
build
contracts/compiled
key: compiled-test-contracts-${{ runner.os }}-jest-${{ hashFiles('contracts/**/*.ligo') }}
- name: Start sandbox
run: yarn start-sandbox
- name: Wait for Sandbox endpoint
uses: emilioschepis/[email protected]
with:
url: http://localhost:20000/chains/main/blocks/head
- name: sleep for 10s
run: sleep 10s
- name: Test the contracts
run: yarn test
- name: Stop sandbox
run: yarn stop-sandbox
pytest:
needs: compile
name: Pytest tests
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: "14"
cache: 'yarn'
cache-dependency-path: './yarn.lock'
- name: Set up Python
run: sudo apt install python pip
uses: actions/checkout@v3
- name: Install crypto libs
run: sudo apt install libsodium-dev libsecp256k1-dev libgmp-dev
- uses: actions/cache@v3
id: contracts-build
with:
path: |
build
contracts/compiled
key: compiled-contracts-${{ runner.os }}-${{ hashFiles('contracts/**/*.ligo') }}
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.9'
cache: 'pip'
- name: Install pytezos and pytest
run: pip install pytezos pytest
- name: Install node modules
run: yarn install
- name: Compile contracts
run: yarn compile
run: pip install -r scenario/requirements.txt
- name: Run scenario tests
run: pytest -s -v

13 changes: 7 additions & 6 deletions config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ dotenv.config();

export const config = {
repoName: "quipuswap-stable-core",
ligoVersion: "0.41.0",
ligoVersion: "0.56.0",
preferredLigoFlavor: "pascaligo",
networks: {
sandbox: {
host: "http://localhost",
host: "http://127.0.0.1",
port: 20000,
protocol: TezosProtocols.ITHACA,
protocol: TezosProtocols.KATHMANDU,
genesisBlockHash: "random",
defaultSignerSK: "edsk3QoqBuvdamxouPhin7swCvkQNgq4jP5KZPbwWNnwdZpSpJiEbq",
accounts: {
Expand All @@ -33,12 +33,12 @@ export const config = {
},
},
testnet: {
host: "https://ithacanet.ecadinfra.com",
host: "https://rpc.ghostnet.testnets.xyz",
port: 443,
faucet: null,
},
mainnet: {
host: "https://mainnet-tezos.giganode.io",
host: "https://mainnet-node.madfish.solutions",
port: 443,
},
},
Expand All @@ -49,8 +49,9 @@ export const config = {
contractsDirectory: "contracts/main",
outputDirectory: "build",
migrationsDir: "migrations",
lambdasDir: "contract_lambdas",
dockerizedLigo: true,
ligoLocalPath: "./ligo",
ligoLocalPath: "ligo",
};

export default config;
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,9 @@
{
"index": 7,
"name": "add_pool"
},
{
"index": 8,
"name": "set_strategy_factory"
}
]
File renamed without changes.
File renamed without changes.
22 changes: 22 additions & 0 deletions contract_lambdas/Strategy_lambdas.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[
{
"index": 0,
"name": "connect_strategy"
},
{
"index": 1,
"name": "connect_token_to_strategy"
},
{
"index": 2,
"name": "update_token_strategy_params"
},
{
"index": 3,
"name": "set_rebalance"
},
{
"index": 4,
"name": "strategy_rebalance"
}
]
File renamed without changes.
Loading