-
Notifications
You must be signed in to change notification settings - Fork 1
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
Update wlth-bid-ask-ma-spread.rain #35
base: main
Are you sure you want to change the base?
Conversation
fix on inverted math was sub/add in wrong direction
stablerevertcondition stablerevert-amount | ||
if(tokenrevertcondition tokenrevert-amount | ||
if(stablecondition stable-amount | ||
if(tokencondition token-amount max-value()) | ||
) | ||
) | ||
), | ||
|
||
price:if( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Try replacing the price
with the following segment:
mul1: mul(current-price 0.995),
mul2: mul(current-price 1.005),
price: conditions(
stablerevertcondition mul1
tokenrevertcondition mul2
stablecondition mul2
tokencondition mul1
"default" max-value()
);
- The above should solve the problem of too many elements on stack, but probably will get that error if more elements were to be present on the stack. Perhaps try introducing more sources that do some of the calcs.
- Also I'm not sure of the
price
calculation above is correct becausecurrent-price
is only in one direction and hencemul1
andmul2
are also in the same direction
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have added and pushed. That gets past the truncation error.
I have put the "string" in at the end of the conditions. if I put Max Value and the direction is stable outgoing that could still go through? however if token outgoing it wont?
is there an issue there?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, if you put max-value as the default value if all conditions are false, it won't go through in either case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is that? it still provides a price?
fix on inverted math
was sub/add in wrong direction
Motivation
Solution
Checks
By submitting this for review, I'm confirming I've done the following: