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

Lw/6242 fix hh tasks v2 #145

Open
wants to merge 10 commits into
base: automation_v2
Choose a base branch
from

Conversation

johnnieskywalker
Copy link
Contributor

adding buy and sell trigger is fixed
output of
npx hardhat create-trigger --vault 433 --type 3 --params '[40000,30000,'0',true,100,200]' --network goerli
image

npx hardhat create-trigger --vault 433 --type 4 --params '[40000,30000,'0',true,100,200]' --network goerli

image

TBD fix for creating all the triggers

@adamskrodzki adamskrodzki changed the base branch from automation_v2 to as/automation_v2_merged October 31, 2022 15:00
@johnnieskywalker johnnieskywalker changed the base branch from as/automation_v2_merged to automation_v2 October 31, 2022 16:29
console.log(!activeTriggerIds.length)
console.log('Array.isArray(activeTriggerIds) && activeTriggerIds.length !== 0')
console.log(Array.isArray(activeTriggerIds) && activeTriggerIds.length !== 0)
triggerIdToReplace =
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this was returning -Infinity for an empty array

@johnnieskywalker johnnieskywalker marked this pull request as ready for review November 9, 2022 13:41
@johnnieskywalker
Copy link
Contributor Author

How to test

Try adding all types of triggers for vault you own on goerli. Here are example command calls and transactions.

Stop loss to coll

npx hardhat create-trigger --vault 433 --type 1 --params '[190]' --network goerli

Stop Loss to DAI

npx hardhat create-trigger --vault 433 --type 2 --params '[180]' --network goerli

Auto buy

npx hardhat create-trigger --vault 433 --type 3 --params '[40000,30000,'0',true,100,200]' --network goerli

Auto sell

npx hardhat create-trigger --vault 433 --type 4 --params '[40000,30000,'0',true,100,200]' --network goerli

Take Profit to Collateral

npx hardhat create-trigger --vault 433 --type 7 --params '[490, 1000000000]' --network goerli

Take Profit to DAI

npx hardhat create-trigger --vault 433 --type 8 --params '[490, 1000000000]' --network goerli

Test pessimistic scenarios for example not existing triggerIDs expect clear error message

npx hardhat create-trigger --vault 433 --type 4 --params '[490, 1000000000]' --network goerli

beware gas estimation issues etc

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.

1 participant