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

feat: add support of both v1 & v1.1 family of scripts #101

Merged
merged 2 commits into from
Apr 17, 2024

Conversation

sourabhxyz
Copy link
Member

@sourabhxyz sourabhxyz commented Apr 17, 2024

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.

@sourabhxyz sourabhxyz requested a review from a team as a code owner April 17, 2024 10:23
@@ -71,10 +65,6 @@ data OrderBotConfig =
{- ^ The duration (microseconds) of time we wait before re-initiating a
complete iteration for the bot.
-}
, botCFPNftPolicy :: FilePath
Copy link
Member Author

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
Copy link
Member Author

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
Copy link
Member Author

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.

@sourabhxyz sourabhxyz linked an issue Apr 17, 2024 that may be closed by this pull request
@brunjlar brunjlar merged commit 6a78e7a into main Apr 17, 2024
1 check passed
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.

Support of both v1 & v1.1 scripts Move to external dex-contracts-api repository
2 participants