-
Notifications
You must be signed in to change notification settings - Fork 14
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
Feature Request: Adding if-else Condition Support for Job Creations #72
Comments
@0x7183 can you give a job example of using if else? |
@llllllluc following some examples:
|
sorry i mean job example where the condition needs if else, can you write some sudo code to help me better understand? the more detail the better maybe use grid bot as example |
With a grid bot we need to buy or sell an asset based on the price. Right now there isn't a way to implement it using only warp. We'll require a job for the buy message with the buy condition and a job with for the sell message with the sell condition. What we need is something like that in pseudo code: If buy: Sorry for the formatting, but I'm from phone and is pretty late here. If this isn't enough I'll provide more details tomorrow! |
I see, this is a nice feature we should support, it's like having 2 condition field and 2 msgs fields, if cond 1 resolves to true, then execute msgs 1, if cond 2 resolves to true, then execute msgs 2, if both resolves to false, then do nothing, but what if both resolve to true? I'm trying to think of an elegant way to implement this. Maybe you can bring this up in warp telegram, and let @vladjdk and @simke9445 chime in. |
I think this is already supported by the recurring job, where you can update var every time it executes (recurring job is after you execute, it will create a new one) |
@vladjdk told us to open an issue on Github and discuss there the implementation details, if you're ok with it we can start working at it and make a PR at the end. Just what is the main branch? |
awesome! the pre release branch is in #67, looking forward to the PR! |
Cool idea, me and @vladjdk were discussing this on several occasions, and its great that you guys took a hand of it. Ideally this would work very similar to a Job would look like this:
in your case:
|
BIG Labs is interested in contributing to Warp Contracts by adding the ability to use if-else conditions when creating jobs.
We would like to discuss the technical aspects and implementation details with the Warp Contracts development team.
The text was updated successfully, but these errors were encountered: