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 vault migration logic #530

Merged
merged 6 commits into from
Jun 21, 2022
Merged

Conversation

sanandnarayan
Copy link
Contributor

Merge @KMKoushik transfer vault with anand's otc hedge code

@vercel
Copy link

vercel bot commented Jun 21, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
continuouscall ✅ Ready (Inspect) Visit Preview Jun 21, 2022 at 5:40AM (UTC)

@sanandnarayan sanandnarayan merged commit 4adbb49 into otchedge-v2 Jun 21, 2022
@sanandnarayan sanandnarayan deleted the transfer-vault-with-hedge branch June 21, 2022 16:57
sanandnarayan added a commit that referenced this pull request Jun 21, 2022
tests duplicated for otc hedge; needs cleanup

tests cleaned up

cleaned up the otc hedge test and got the expected variables ready

renamed managerBuyPrice variable name

temp commit

temp commit

reduce trader sell quantity when buy price is greater

added time and price threshold checks

Fix: ordered the var updates

added increasing price check & removed auction uniswap code

Removed auctions

made the tests pending for the code removed

removed auctionTriggerTime from isTimeHege

price check for OTC price vs uniswap

ran prettier on crab test hege otc

ran prettier on crab contract hege otc

lint

Check all trade pairs are the same

added multiple orders as test

added test for single order, multiple orders from different people

added buyside test for otchedge

added checks for traders balance as well

nit: trader is now a variable

organized the multiple orders test

made one testcase more readable with functions

added test for manager being able to trade in lesser quantity

added test for manager to pass a large sellAmount

added test to allow the manager to buy at a greater price

added test for lesser quantity and greater price

Added test for timeThreshold and priceThresholds

ran formatter on test

tests for check otc price

refactored type and domain data

added test for invalid signature i.e a fake order

test for manager buy price atleast seller price

tests for manager buyer price should be greater than 0

added test for correct formatting of orders

removed failing tests

added tests for setters and re arranged the crab contract

Add vault migration with timelock logic (#530)

* Add vault migration logic

* rebased on top of otchedgev2 and fixed timelock location and public variable

* Fix tests

* removed unused code in timelock tests

* ran prettier on timelock code

* fixed order of tests and small errors

Co-authored-by: KMKoushik <koushikmohan1996@gmail.com>

removed console.logs and todos and typos

format the otc hedge test file
sanandnarayan added a commit that referenced this pull request Jun 22, 2022
* Init crab v2

* Port v1 tests to v2

* Change CrabStrategyV2 typechain

Change CrabStrategyV2 typechain

Added otchedge code without test; and removed uniswap/price hedge

tests duplicated for otc hedge; needs cleanup

tests cleaned up

cleaned up the otc hedge test and got the expected variables ready

renamed managerBuyPrice variable name

temp commit

temp commit

reduce trader sell quantity when buy price is greater

added time and price threshold checks

Fix: ordered the var updates

added increasing price check & removed auction uniswap code

Removed auctions

made the tests pending for the code removed

removed auctionTriggerTime from isTimeHege

price check for OTC price vs uniswap

ran prettier on crab test hege otc

ran prettier on crab contract hege otc

lint

Check all trade pairs are the same

added multiple orders as test

added test for single order, multiple orders from different people

added buyside test for otchedge

added checks for traders balance as well

nit: trader is now a variable

organized the multiple orders test

made one testcase more readable with functions

added test for manager being able to trade in lesser quantity

added test for manager to pass a large sellAmount

added test to allow the manager to buy at a greater price

added test for lesser quantity and greater price

Added test for timeThreshold and priceThresholds

ran formatter on test

tests for check otc price

refactored type and domain data

added test for invalid signature i.e a fake order

test for manager buy price atleast seller price

tests for manager buyer price should be greater than 0

added test for correct formatting of orders

removed failing tests

added tests for setters and re arranged the crab contract

Add vault migration with timelock logic (#530)

* Add vault migration logic

* rebased on top of otchedgev2 and fixed timelock location and public variable

* Fix tests

* removed unused code in timelock tests

* ran prettier on timelock code

* fixed order of tests and small errors

Co-authored-by: KMKoushik <koushikmohan1996@gmail.com>

removed console.logs and todos and typos

format the otc hedge test file

removed console logs on the crabv2 contract

removed delta hedge threshold

removed unused params and renamed function params

resolved name changes per joe

removed unused variable; better token checking logic;view functions added

removed stale tests and fixed the constructor

Change MockTimelock to Timelock in integration tests

prettierrc restored to reflect main branch

Fix lint issues

Price/quantity orders (#536)

* added expiries

* updated test orders with t+ 10 min expiries

* fixed typehash

* added expiry to type data in test file

* orders with prices

* fixed direction of remaining quantity che k

* fix natspec

* reduced remainingAmounts in hedgeOTC

* checks that orders are all in same direction and trading opposite to hedge

* passing in flags for _mintWPowerPerp and _burnPowerPerp + naming + revert messages

* isHedgeBuying vs isOrderBuying

* fixes and lint

* added withdrawing weth, initialize current price; fixed 3 tests;

* fixed test for allowing to trade lower quantity

* formatted the document

* fixed test for allowing vault manager to trade more quantity

* fixed test for allowing vault manager to buy at greater price

* fixed test for allowing vault manager to buy at greater price and specify lesser quanitity

* fixed test for high price by manager

* fixed test for invalid signature

* fixed test for manager price < order price

* fixed test for ordering of orders

* removed import console

Co-authored-by: Anand Narayan <i@codeanand.com>
@sanandnarayan sanandnarayan mentioned this pull request Jun 22, 2022
sanandnarayan added a commit that referenced this pull request Jun 22, 2022
* Init crab v2

* Port v1 tests to v2

* Change CrabStrategyV2 typechain

Change CrabStrategyV2 typechain

Added otchedge code without test; and removed uniswap/price hedge

tests duplicated for otc hedge; needs cleanup

tests cleaned up

cleaned up the otc hedge test and got the expected variables ready

renamed managerBuyPrice variable name

temp commit

temp commit

reduce trader sell quantity when buy price is greater

added time and price threshold checks

Fix: ordered the var updates

added increasing price check & removed auction uniswap code

Removed auctions

made the tests pending for the code removed

removed auctionTriggerTime from isTimeHege

price check for OTC price vs uniswap

ran prettier on crab test hege otc

ran prettier on crab contract hege otc

lint

Check all trade pairs are the same

added multiple orders as test

added test for single order, multiple orders from different people

added buyside test for otchedge

added checks for traders balance as well

nit: trader is now a variable

organized the multiple orders test

made one testcase more readable with functions

added test for manager being able to trade in lesser quantity

added test for manager to pass a large sellAmount

added test to allow the manager to buy at a greater price

added test for lesser quantity and greater price

Added test for timeThreshold and priceThresholds

ran formatter on test

tests for check otc price

refactored type and domain data

added test for invalid signature i.e a fake order

test for manager buy price atleast seller price

tests for manager buyer price should be greater than 0

added test for correct formatting of orders

removed failing tests

added tests for setters and re arranged the crab contract

Add vault migration with timelock logic (#530)

* Add vault migration logic

* rebased on top of otchedgev2 and fixed timelock location and public variable

* Fix tests

* removed unused code in timelock tests

* ran prettier on timelock code

* fixed order of tests and small errors

Co-authored-by: KMKoushik <koushikmohan1996@gmail.com>

removed console.logs and todos and typos

format the otc hedge test file

removed console logs on the crabv2 contract

removed delta hedge threshold

removed unused params and renamed function params

resolved name changes per joe

removed unused variable; better token checking logic;view functions added

removed stale tests and fixed the constructor

Change MockTimelock to Timelock in integration tests

prettierrc restored to reflect main branch

Fix lint issues

Price/quantity orders (#536)

* added expiries

* updated test orders with t+ 10 min expiries

* fixed typehash

* added expiry to type data in test file

* orders with prices

* fixed direction of remaining quantity che k

* fix natspec

* reduced remainingAmounts in hedgeOTC

* checks that orders are all in same direction and trading opposite to hedge

* passing in flags for _mintWPowerPerp and _burnPowerPerp + naming + revert messages

* isHedgeBuying vs isOrderBuying

* fixes and lint

* added withdrawing weth, initialize current price; fixed 3 tests;

* fixed test for allowing to trade lower quantity

* formatted the document

* fixed test for allowing vault manager to trade more quantity

* fixed test for allowing vault manager to buy at greater price

* fixed test for allowing vault manager to buy at greater price and specify lesser quanitity

* fixed test for high price by manager

* fixed test for invalid signature

* fixed test for manager price < order price

* fixed test for ordering of orders

* removed import console

Co-authored-by: Anand Narayan <i@codeanand.com>
sanandnarayan added a commit that referenced this pull request Jun 22, 2022
* Init crab v2 (#517)

* Init crab v2

* Port v1 tests to v2

* Change CrabStrategyV2 typechain

Change CrabStrategyV2 typechain

Added otchedge code without test; and removed uniswap/price hedge

tests duplicated for otc hedge; needs cleanup

tests cleaned up

cleaned up the otc hedge test and got the expected variables ready

renamed managerBuyPrice variable name

temp commit

temp commit

reduce trader sell quantity when buy price is greater

added time and price threshold checks

Fix: ordered the var updates

added increasing price check & removed auction uniswap code

Removed auctions

made the tests pending for the code removed

removed auctionTriggerTime from isTimeHege

price check for OTC price vs uniswap

ran prettier on crab test hege otc

ran prettier on crab contract hege otc

lint

Check all trade pairs are the same

added multiple orders as test

added test for single order, multiple orders from different people

added buyside test for otchedge

added checks for traders balance as well

nit: trader is now a variable

organized the multiple orders test

made one testcase more readable with functions

added test for manager being able to trade in lesser quantity

added test for manager to pass a large sellAmount

added test to allow the manager to buy at a greater price

added test for lesser quantity and greater price

Added test for timeThreshold and priceThresholds

ran formatter on test

tests for check otc price

refactored type and domain data

added test for invalid signature i.e a fake order

test for manager buy price atleast seller price

tests for manager buyer price should be greater than 0

added test for correct formatting of orders

removed failing tests

added tests for setters and re arranged the crab contract

Add vault migration with timelock logic (#530)

* Add vault migration logic

* rebased on top of otchedgev2 and fixed timelock location and public variable

* Fix tests

* removed unused code in timelock tests

* ran prettier on timelock code

* fixed order of tests and small errors

Co-authored-by: KMKoushik <koushikmohan1996@gmail.com>

removed console.logs and todos and typos

format the otc hedge test file

removed console logs on the crabv2 contract

removed delta hedge threshold

removed unused params and renamed function params

resolved name changes per joe

removed unused variable; better token checking logic;view functions added

removed stale tests and fixed the constructor

Change MockTimelock to Timelock in integration tests

prettierrc restored to reflect main branch

Fix lint issues

Price/quantity orders (#536)

* added expiries

* updated test orders with t+ 10 min expiries

* fixed typehash

* added expiry to type data in test file

* orders with prices

* fixed direction of remaining quantity che k

* fix natspec

* reduced remainingAmounts in hedgeOTC

* checks that orders are all in same direction and trading opposite to hedge

* passing in flags for _mintWPowerPerp and _burnPowerPerp + naming + revert messages

* isHedgeBuying vs isOrderBuying

* fixes and lint

* added withdrawing weth, initialize current price; fixed 3 tests;

* fixed test for allowing to trade lower quantity

* formatted the document

* fixed test for allowing vault manager to trade more quantity

* fixed test for allowing vault manager to buy at greater price

* fixed test for allowing vault manager to buy at greater price and specify lesser quanitity

* fixed test for high price by manager

* fixed test for invalid signature

* fixed test for manager price < order price

* fixed test for ordering of orders

* removed import console

Co-authored-by: Anand Narayan <i@codeanand.com>

* removed comments and unused tests

Co-authored-by: KM Koushik <koushikmohan1996@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants