Skip to content

Commit f5abf92

Browse files
authored
Merge pull request #93 from geniusyield/conway-update
feat: conway era support
2 parents a84887a + 4e8dd25 commit f5abf92

File tree

6 files changed

+73
-53
lines changed

6 files changed

+73
-53
lines changed

cabal.project

+55-39
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ repository cardano-haskell-packages
1010
d4a35cd3121aa00d18544bb0ac01c3e1691d618f462c46129271bccf39f7e8ee
1111

1212
-- repeating the index-state for hackage to work around hackage.nix parsing limitation
13-
index-state: 2024-03-19T15:29:53Z
13+
index-state: 2024-08-27T16:28:01Z
1414

1515
index-state:
16-
, hackage.haskell.org 2024-03-19T15:29:53Z
17-
, cardano-haskell-packages 2024-03-15T17:07:52Z
16+
, hackage.haskell.org 2024-08-27T16:28:01Z
17+
, cardano-haskell-packages 2024-07-24T14:16:32Z
1818

1919
packages: .
2020
packages: geniusyield-annset
@@ -27,56 +27,60 @@ test-show-details: direct
2727
source-repository-package
2828
type: git
2929
location: https://github.com/geniusyield/dex-contracts-api
30-
tag: 5d21453d7b99491b5e40ddcdb500685bcd00f862
31-
--sha256: sha256-s8xPPW4zbcYdJvZsxZfBAOCvaheSqI01k1SUhMRrXTA=
30+
tag: v0.11.0
31+
--sha256: sha256-fV6jQVxoPfv1DdssmuHDmyvKcFpFCReiSeZ3n76zC9M=
3232
subdir:
3333
geniusyield-dex-api
3434
geniusyield-onchain/geniusyield-common
3535

3636
source-repository-package
3737
type: git
3838
location: https://github.com/geniusyield/ply
39-
tag: b13674633771f572a5eedfb47276c0ac3993ab85
40-
--sha256: sha256-a63OdFAbo0sWOXxceI2bW/ZMrS8wo1t7aPFrfXvVhvE=
39+
tag: 4a61941b3287782d2c11f9ab1cae0889d0a57385
40+
--sha256: sha256-24WKaBs6qiJzi++wTyqIh61Dc1QeCzeo0YqLE4wsEbg=
4141
subdir: ply-core
4242

4343
source-repository-package
4444
type: git
4545
location: https://github.com/geniusyield/atlas
46-
tag: 97f3ca97bda997533d17274689daa69c5fdcbcd6
47-
--sha256: sha256-NKUrxa3f6tlywWNWwdw5bWQ974ziOG9MXmY9GNZTdu8=
46+
tag: v0.6.0
47+
--sha256: sha256-v+tTCIz8uyaQfsMJRc5F36TNK9ZPfrBxwXLYaXqZrZA=
4848

4949
-------- Begin contents from @atlas@'s @cabal.project@ file. --------
5050

5151
package cardano-crypto-praos
5252
flags: -external-libsodium-vrf
5353

54-
-- TODO: This is fixed for in their later version, omit this when we update to it.
55-
package strict-containers
56-
ghc-options: -Wwarn=noncanonical-monad-instances
57-
5854
source-repository-package
5955
type: git
6056
location: https://github.com/maestro-org/haskell-sdk
6157
tag: v1.7.2
6258
--sha256: sha256-nXnelHH4a+V0nguP8oUDlyEz/fLQ/i1fs/flyZTmvAc=
6359

60+
-- TODO: Temporary, until proposed changes are in upstream (track https://github.com/mlabs-haskell/clb/pull/44)
6461
source-repository-package
6562
type: git
66-
location: https://github.com/mlabs-haskell/clb
67-
tag: 18e781b5b53adc1aa1d8c057c1b606b536a80350
68-
--sha256: sha256-PDmrXYTBHPcY0x+JnF21uupLMBwURLSiNMqNmwwapkc=
69-
70-
constraints:
71-
, cardano-api ^>= 8.38.0.0
63+
location: https://github.com/sourabhxyz/clb
64+
tag: 09414a93047b4c7f6e03e20d1730c9c0f88e1d46
65+
--sha256: sha256-y5fF8IDywt/pQ3HsRE6CpAlqK4uiU/SRuDIqSHxBED0=
7266

73-
-- Everything below is essentially copied from cardano-wallet's cabal.project.
67+
-- Obtaining cardano-node stuff for 9.1.0. These aren't published on CHaP yet.
68+
source-repository-package
69+
type: git
70+
location: https://github.com/IntersectMBO/cardano-node
71+
tag: 9.1.0
72+
--sha256: sha256-F5wgRA820x16f+8c/LlEEBG0rMJIA1XWw6X0ZwX5UWs=
73+
subdir:
74+
cardano-node
75+
cardano-testnet
76+
trace-dispatcher
7477

78+
-- TODO: Make changes upstream
7579
source-repository-package
7680
type: git
77-
location: https://github.com/input-output-hk/cardano-wallet
78-
tag: v2024-03-27
79-
--sha256: sha256-rxMPopa3nxQaM0yOxUCq5oj3+XSL68jkuuFVhj/SY+w=
81+
location: https://github.com/geniusyield/cardano-wallet
82+
tag: 3413fdf74fd25b100662abf2a49c1afc892f1b79
83+
--sha256: sha256-V5DNUzraaDJo6cXc1eeVVIJNWqC8JayQrJeNNLg/Els=
8084
subdir:
8185
lib/address-derivation-discovery
8286
lib/balance-tx/
@@ -99,15 +103,15 @@ source-repository-package
99103
lib/wallet-benchmarks/
100104
lib/wallet/
101105

102-
------ Begin contents from @cardano-wallet@'s @cabal.project@ file. --------
106+
------ Following is mostly from @cardano-wallet@'s @cabal.project@ file. -------
103107

104108
--------------------------------------------------------------------------------
105109

106110
source-repository-package
107111
type: git
108112
location: https://github.com/IntersectMBO/cardano-addresses
109-
tag: 126964483d188c2362393d2a6eea8c65dfc43097
110-
--sha256: 1w152imj28ap5dfdc8x9ly0cy7dn500v7k63vw11f70gvgg6x7my
113+
tag: 2bca06deaa60e54a5322ac757387d744bf043367
114+
--sha256: 1y1mzfly7jac40b9g4xc078rcm5zqhc3xxv77kwxi10yph1jwq7z
111115
subdir: command-line
112116
core
113117

@@ -148,21 +152,30 @@ source-repository-package
148152
--------------------------------------------------------------------------------
149153
-- BEGIN Constraints tweaking section
150154

151-
-- cardano-addresses unit tests bring in some version constraint conflicts.
152-
--
153-
-- 1. hjsonschema and hjsonpointer deps have overly strict bounds.
154-
-- 2. it has strict aeson < 1.5 dep - this will be fixed in the next release.
155155
allow-newer:
156-
hjsonschema:*
157-
, hjsonpointer:*
158-
, *:aeson
159-
, *:hashable
160-
, async-timer:unliftio-core
161-
, ekg:*
162-
, ntp-client:*
163-
, libsystemd-journal:base
164-
, cardano-addresses-cli:mtl
156+
async-timer:unliftio-core
165157
, servant-openapi3:*
158+
, katip:Win32
159+
, raven-haskell:aeson
160+
161+
constraints:
162+
base >= 4.18.2.0 && < 5
163+
, openapi3 >= 3.2.0
164+
, persistent ^>= 2.14.6.0
165+
, cardano-node ^>= 9.1.0
166+
, bech32 >= 1.1.7
167+
168+
-- lower versions of katip won't build with the Win32-2.12.0.1
169+
-- which is shipped with the ghc-9.2.8
170+
, katip >= 0.8.7.4
171+
172+
173+
-- Cardano Node dependencies:
174+
, io-classes >= 1.4
175+
, io-classes -asserts
176+
, ouroboros-consensus-cardano ^>= 0.18
177+
, ouroboros-network ^>= 0.16.1
178+
, ouroboros-network-protocols ^>= 0.9
166179

167180
-- END Constraints tweaking section
168181
--------------------------------------------------------------------------------
@@ -184,6 +197,9 @@ package cardano-config
184197
package cardano-node
185198
flags: -systemd
186199

200+
package bitvec
201+
flags: -simd
202+
187203
-- -------------------------------------------------------------------------
188204

189205
-------- End contents from @cardano-wallet@'s @cabal.project@ file. --------

geniusyield-market-maker/CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Revision history for geniusyield-market-maker
22

3+
## 0.8.0 -- 2024-08-30
4+
5+
* Conway era support. Note that this update is not compatible with Babbage era and so must be employed on Mainnet after Chang HF.
6+
37
## 0.7.0 -- 2024-08-30
48

59
* Updated Atlas & Maestro SDK version to not make use Maestro's recently deprecated protocol parameters & era summaries endpoint.

geniusyield-market-maker/geniusyield-market-maker.cabal

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
cabal-version: 3.4
22
name: geniusyield-market-maker
3-
version: 0.7.0
3+
version: 0.8.0
44
build-type: Simple
55
extra-doc-files: CHANGELOG.md
66
synopsis:

geniusyield-market-maker/impl/datasource-providers/GeniusYield/OrderBot/DataSource/Providers.hs

+2-2
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ withEachAssetOrders c dex poRefs assetFilter f acc = do
5454
acc
5555
infoMap
5656

57-
runQuery :: Connection -> GYTxQueryMonadNode a -> IO a
58-
runQuery (Connection nid providers) = runGYTxQueryMonadNode nid providers
57+
runQuery :: Connection -> GYTxQueryMonadIO a -> IO a
58+
runQuery (Connection nid providers) = runGYTxQueryMonadIO nid providers
5959

6060
allOrderInfos
6161
:: HasDexScripts a

geniusyield-market-maker/src/GeniusYield/MarketMaker/MakerBot.hs

+9-9
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,23 @@ import Control.Exception (Exception (displayException
55
Handler (Handler), catches)
66
import Control.Monad (forM_, forever)
77
import Control.Monad.Reader (runReaderT)
8-
import Control.Monad.State (StateT (..), get, put, lift)
8+
import Control.Monad.State (StateT (..), get, lift,
9+
put)
910
import Data.List.Split (chunksOf)
1011
import qualified Data.Map.Strict as M
1112
import GeniusYield.Api.Dex.Constants (DEXInfo (..))
1213
import GeniusYield.Api.Dex.PartialOrder (PartialOrderInfo (poiOwnerKey),
1314
cancelMultiplePartialOrders',
1415
partialOrders,
1516
placePartialOrder)
16-
import GeniusYield.Imports (printf, (&), fromMaybe)
17+
import GeniusYield.Imports (fromMaybe, printf, (&))
1718
import GeniusYield.MarketMaker.Constants (awaitTxParams, logNS)
1819
import GeniusYield.MarketMaker.Prices
1920
import GeniusYield.MarketMaker.Strategies
2021
import GeniusYield.MarketMaker.User
2122
import GeniusYield.MarketMaker.Utils (addrUser, pkhUser)
2223
import GeniusYield.Providers.Common (SubmitTxException)
23-
import GeniusYield.Transaction (BuildTxException)
24-
import GeniusYield.TxBuilder
24+
import GeniusYield.TxBuilder hiding (User)
2525
import GeniusYield.Types
2626
import System.Exit
2727

@@ -72,7 +72,7 @@ cancelAllOrders' MakerBot {mbUser} netId providers di = do
7272
gyLogInfo providers logNS "---------- Done for the block! -----------"
7373
gyAwaitTxConfirmed providers awaitTxParams tid
7474
go rest
75-
partialOrderInfos runGYTxQueryMonadNode netId providers $ runReaderT (partialOrders (dexPORefs di)) di
75+
partialOrderInfos runGYTxQueryMonadIO netId providers $ runReaderT (partialOrders (dexPORefs di)) di
7676
let userPkh = pkhUser mbUser & toPubKeyHash
7777
userPOIs = filter (\o poiOwnerKey o == userPkh) $ M.elems partialOrderInfos
7878
go userPOIs
@@ -111,15 +111,12 @@ buildAndSubmitActions user@User {uColl, uStakeCred} providers netId ua di = flip
111111
let handlerCommon Exception e => e IO ()
112112
handlerCommon = logWarn . displayException
113113

114-
be BuildTxException IO ()
115-
be = handlerCommon
116-
117114
se SubmitTxException IO ()
118115
se = handlerCommon
119116

120117
me GYTxMonadException IO ()
121118
me = handlerCommon
122-
in [Handler be, Handler se, Handler me]
119+
in [Handler se, Handler me]
123120

124121
buildCommon txBody = do
125122
logInfo $ "Successfully built body for above action, tx id: " <> show (txBodyTxId txBody)
@@ -255,3 +252,6 @@ executeStrategy runStrategy mb netId providers pp di = do
255252
(evolveStrategy runStrategy mb netId providers pp di)
256253
MBReady
257254
return ()
255+
256+
runGYTxMonadNode :: GYNetworkId -> GYProviders -> [GYAddress] -> GYAddress -> Maybe (GYTxOutRef, Bool) -> GYTxBuilderMonadIO (GYTxSkeleton v) -> IO GYTxBody
257+
runGYTxMonadNode nid providers addrs change collateral act = runGYTxBuilderMonadIO nid providers addrs change collateral $ act >>= buildTxBody

geniusyield-market-maker/src/GeniusYield/MarketMaker/Strategies.hs

+2-2
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ import GeniusYield.OrderBot.OrderBook.AnnSet (MultiAssetOrderBook,
5151
withEachAsset)
5252
import GeniusYield.OrderBot.Types
5353
import GeniusYield.TxBuilder (GYTxQueryMonad (utxosAtAddress),
54-
runGYTxQueryMonadNode)
54+
runGYTxQueryMonadIO)
5555
import GeniusYield.Types
5656
import GHC.Natural (naturalFromInteger)
5757

@@ -224,7 +224,7 @@ fixedSpreadVsMarketPriceStrategy
224224

225225
(bp, maob) getOrderBookPrices pp [mmTokenPair] mp priceCheckThreshold
226226

227-
ownUtxos runGYTxQueryMonadNode nid providers $ utxosAtAddress userAddr Nothing -- Assumption: User addresses does not include order validator's address.
227+
ownUtxos runGYTxQueryMonadIO nid providers $ utxosAtAddress userAddr Nothing -- Assumption: User addresses does not include order validator's address.
228228
let ownOrdersPerUser = getOwnOrders [mmTokenPair] [user] maob
229229
allOwnOrders = M.foldr (++) [] ownOrdersPerUser
230230
equityInOrders = foldMap' getEquityFromOrder allOwnOrders

0 commit comments

Comments
 (0)