-
Notifications
You must be signed in to change notification settings - Fork 11
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
feat: add support of both v1 & v1.1 family of scripts #101
Conversation
@@ -71,10 +65,6 @@ data OrderBotConfig = | |||
{- ^ The duration (microseconds) of time we wait before re-initiating a | |||
complete iteration for the bot. | |||
-} | |||
, botCFPNftPolicy :: FilePath |
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.
All the boilerplate information is already encoded in geniusyield-dex-api
cabal project and so is no longer required.
This change would still be backwards compatible wrt configuration as extra json fields or environment variables would simply be ignored.
-> [OrderAssetPair] | ||
-> IO (Map OrderAssetPair [SomeOrderInfo]) | ||
allOrderInfos c dex assetPairs = do | ||
cTime <- getCurrentGYTime | ||
|
||
partialOrderInfos <- runQuery c $ | ||
runReaderT (partialOrders $ partialOrderFilter cTime) dex | ||
runReaderT (partialOrdersWithTransformerPredicate (dexPORefs dex) $ partialOrderFilter cTime) dex |
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.
partialOrdersWithTransformerPredicate
has type signature,
partialOrdersWithTransformerPredicate
∷ GYDexApiQueryMonad m a
⇒ PORefs
→ (PartialOrderInfo → Maybe b)
→ m [b]
whereas partialOrders
have type signature,
partialOrders
∷ GYDexApiQueryMonad m a
⇒ PORefs
→ m (Map.Map GYTxOutRef PartialOrderInfo)
And definition of partialOrdersWithTransformerPredicate
is
partialOrdersWithTransformerPredicate pors transformerPredicate = do
ois ← Map.elems <$> partialOrders pors
pure $ mapMaybe transformerPredicate ois
|
||
source-repository-package | ||
type: git | ||
location: https://github.com/geniusyield/dex-contracts-api |
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.
Using commit from this PR.
Let's merge PR at dex-contracts-api
side once our systems are all up to date, since that PR would create orders at v1.1 script.
Closes #100, #78.
To test, I created two orders, one at v1 & other at v1.1. My SOR was able to match them, match tx: link.