From 4aca2ef080988b45be4321c01f190983bc05e7e0 Mon Sep 17 00:00:00 2001 From: Valentino Cerutti Date: Thu, 2 Nov 2023 18:41:48 -0300 Subject: [PATCH] Updates for the removal of minFill --- README.md | 8 +- cabal.project | 8 +- compiled-scripts/minting-policy | 4 +- compiled-scripts/partial-order | 7 +- config-files/bot-config.json | 42 ++++---- .../src/GeniusYield/DEX/Api/Constants.hs | 2 +- .../src/GeniusYield/DEX/Api/PartialOrder.hs | 96 +++++++------------ .../src/GeniusYield/DEX/Api/Types.hs | 4 +- .../lib-common/GeniusYield/OrderBot/Types.hs | 40 ++++---- geniusyield-orderbot/src/OrderBotConfig.hs | 2 +- geniusyield-orderbot/test/Main.hs | 2 - .../test/Tests/Prop/Strategies.hs | 75 ++++----------- geniusyield-orderbot/test/Tests/Prop/Utils.hs | 30 +++--- .../GeniusYield/OrderBot/OrderBook/List.hs | 2 + 14 files changed, 128 insertions(+), 194 deletions(-) diff --git a/README.md b/README.md index eb7ff00..e59eab8 100644 --- a/README.md +++ b/README.md @@ -336,10 +336,10 @@ that is completely placed on the blockchain. That is the validator and minting p { "validatorRefs":{ "refAddr":"addr_test1wpgexmeunzsykesf42d4eqet5yvzeap6trjnflxqtkcf66g0kpnxt", - "refNftAC":"fae686ea8f21d567841d703dea4d4221c2af071a6f2b433ff07c0af2.e6a295bb83d06f53fcf91151f54acec0a63fbd6f0d924206d5d012e6da3b72af", - "refNftUtxoRef":"39f987a6beb9cc4c45bba149a21c28068f640f3593f15f8157f0b6022b431977#0", - "scriptRef":"39f987a6beb9cc4c45bba149a21c28068f640f3593f15f8157f0b6022b431977#1", - "nftPolicyRef":"39f987a6beb9cc4c45bba149a21c28068f640f3593f15f8157f0b6022b431977#0" + "refNftAC":"fae686ea8f21d567841d703dea4d4221c2af071a6f2b433ff07c0af2.6af3807634905a04be64a8dbe0ddb9da6ce52eed23cb428c7be5d6114eacc189", + "refNftUtxoRef":"aaaae7e568aab31db6f74faaf550867d58b2361868324567470862ecaaac7646#0", + "scriptRef":"aaaae7e568aab31db6f74faaf550867d58b2361868324567470862ecaaac7646#1", + "nftPolicyRef":"aaaae7e568aab31db6f74faaf550867d58b2361868324567470862ecaaac7646#0" } } ``` diff --git a/cabal.project b/cabal.project index b155cec..b4ef702 100644 --- a/cabal.project +++ b/cabal.project @@ -33,8 +33,8 @@ package strict-containers source-repository-package type: git location: https://github.com/maestro-org/haskell-sdk - tag: 3c4efccb00df8e9fe0313dfb5228e294caa1807d - --sha256: sha256-H7SsK0ri7cmE9d9cUhFZu24s1FWrvMuVlKzplFfBe+4= + tag: 3865f4465f05323a378dbed257c34450923e8c99 + --sha256: sha256-nQnvml8eelTw7HpzByC5Rv5XUD74oLJucRRg8OFz71s= -- Unfortunately, cardano-node 8.1.2 is constrained with plutus-ledger-api 1.5.0.0 and we would like at least 1.6.0.0. -- This is done in accordance with changes in https://github.com/input-output-hk/cardano-ledger/pull/3430/files. @@ -64,8 +64,8 @@ source-repository-package source-repository-package type: git location: https://github.com/geniusyield/atlas - tag: v0.3.0 - --sha256: sha256-55nIF4S6TyrI1onWH6bu7WDynqHophMZ+QCyw8IFsfQ= + tag: 014f8b4ab5b21b1c54165716f3cb6e800b6defb9 + --sha256: sha256-1QhPygU0MyXO9QvJkJD4awNmWEhj79jSFbQBj0FQNfM= source-repository-package type: git diff --git a/compiled-scripts/minting-policy b/compiled-scripts/minting-policy index 95a254e..38bb140 100644 --- a/compiled-scripts/minting-policy +++ b/compiled-scripts/minting-policy @@ -1,11 +1,11 @@ { - "cborHex": "590c6e590c6b01000032323232323232323232323232323232323232323232323232323232323232323232323232222232323232323232325333023302a30300021323232323232325333028001161533302a5330223302623375e6e9cc0b0020dd39816181718160008020a998111aba3302c00115330223032375a6070605a002266e3cdd7181b981680080289919999814111299981600089128008a9998171801181880089911180100198188008998018011818000919181a99998111bae3030302e003480008cccc08c009200075a6eac004dd59818181798170011bae302f302e302d00200423232533302e533302e3035303b00214a0266e3c05cdd7181880089919191919191919191919191919299981e18230028a99981e19b870040051533303c3371e6eb8c0fc01c05c54ccc0f0c11c00c54ccc0f0c10c00854ccc0f0c1180044c8c8c8c8c8c8c8c8c94ccc114cc0d88cc0dc8c148dd6982a8009bab30540013330327006eacc120c11cc118068cc0c48dd31981911ba8303a375a0026eac004ccc0c9c019817982400a1ba800e3302f3303b488100488100375066e08cdc0006016a99982299b88304b00333704900000108008a99982299b87304b0033370466e1000c00800840044cdc024004002207c2c66e10008004cdc100119b830070033370400266e0c0140094ccc104c12001452000153330413371200a90000a40022900119981e91129998219825000880109980180099b8600200153330403371200400220022004a66608066e2400800440084004c0c400cc0c0004cdc100324004606060840022c2c2c2c2c2c6eb4c0f801cdd6981e981e0021bad303c003375a607600c6eb4c0e8010c0e0c0e0c0e0004c0dc004c0d8c0d8c0d8004c0d4004c0d0004c0ccc0ccc0c94ccc0c4c0e40084ccccc0b08c888c00800cc100004dd49bae303400100923232320045333034303b304100215333034303d371a6eb8c0dc0044c8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c94ccc118c134c14c0044c8c8c8c94ccc128cdd79ba7304c00250561323232533304d337126e34dd71828000a408026464646464646464646464646464640aaa6660b260ba00420a82c6eb4c174004c16c008dd6982d800982c802a99982b182e8010a99982b18309bad305900113205053330543058001104f161615333056305e0021320505333054001104f161630630023061001375460ac00260a800aa6660a260b00042a6660a260b86eb4c1500044c812d4ccc13cc14c0044128585854ccc144c1640084c812d4ccc13c00441285858c178008c170004dd5182880098278008b18270011bad304e001304c006163750607a6eb4c130004c128008dd69825000982a0008b1baa304800130460045333043304a30500021325333044533043304b0011304d0011325333045337126e34dd71824000a408026407ea666086608e002207c2c2c608c0042c6e34dd718230008b18280009baa30440013042002375a608400260800046eb4c100004c0f80114ccc0ecc108c1200084c94ccc0f14cc0ecc10c0044c1140044c94ccc0f4cdc49b8d375c6080002902009901ba99981d981f800881b0b0b181f0010b1b8d375c607c0022c60900026ea8c0f0004c0e80114ccc0dcc0f8c1100084c8c8c8c8c8c8c8c8c8c80e94ccc0f8c10801440e4594ccc0fcc1180084c8c8c8c8c80f54ccc104c11401440f0594ccc108c1240084c8c8c8c8c81014ccc110c12001440fc594ccc114c13000854ccc114c138dc69bae304800113203f53330433047001103e161615333045304d00215333045304e371a6eb8c1200044c80fd4ccc10cc11c00440f8585858c148008c140004dd518228008a99982118250010991919191919020a999822982480108200b1bad30490013047002375a608e002608a0046eb4c11400458c13c008c134004dd518210008a99981f982380109901ca99981e800881c0b0b182600118250009baa303f001303d005533303a30410021533303a3043371a6eb8c0f40044c80d14ccc0e0c0f000440cc585854ccc0e8c10800854ccc0e8c10cdc69bae303d0011320345333038303c001103316161630470023045001375460740022c60880026ea8c0e0004c0d80045858c104004dd50008b0a99981899b87480100084c8c8c8c80114ccc0d0c0ecc10400854ccc0d0c0f4dc69bae303700113232323232323232323232323232323232325333046304d3053001132323232533304a3375e6e9cc13000941584c8c8c94ccc134cdc49b8d375c60a00029020099191919191919191919191919191902aa99982c982e801082a0b1bad305d001305b002375a60b600260b200aa6660ac60ba0042a6660ac60c26eb4c1640044c81414ccc150c160004413c585854ccc158c1780084c81414ccc150004413c5858c18c008c184004dd5182b000982a002a999828982c0010a999828982e1bad305400113204b533304f3053001104a161615333051305900213204b533304f001104a1616305e002305c001375460a2002609e0022c609c0046eb4c138004c13001858dd4181e9bad304c001304a002375a609400260a80022c6ea8c120004c1180114ccc10cc128c1400084c94ccc1114cc10cc12c0044c1340044c94ccc114cdc49b8d375c6090002902009901fa9998219823800881f0b0b18230010b1b8d375c608c0022c60a00026ea8c110004c108008dd6982100098200011bad3040001303e004533303b30423048002132533303c53303b304300113045001132533303d337126e34dd71820000a408026406ea666076607e002206c2c2c607c0042c6e34dd7181f0008b18240009baa303c001303a0045333037303e304400213232323232323232323203a533303e3042005103916533303f30460021323232323203d53330413045005103c16533304230490021323232323204053330443048005103f165333045304c00215333045304e371a6eb8c1200044c80fd4ccc10cc11c00440f8585854ccc114c13400854ccc114c138dc69bae304800113203f53330433047001103e161616305200230500013754608a0022a66608460940042646464646464082a66608a609200420802c6eb4c124004c11c008dd6982380098228011bad304500116304f002304d001375460840022a66607e608e004264072a66607a00220702c2c609800460940026ea8c0fc004c0f40154ccc0e8c10400854ccc0e8c10cdc69bae303d0011320345333038303c001103316161533303a30420021533303a3043371a6eb8c0f40044c80d14ccc0e0c0f000440cc585858c11c008c114004dd5181d0008b18220009baa3038001303600116163041001375400260680022c607c00460780026ea8c0c4c0c0c0c0c0bc00c58c0ec004dd518179816981798168008b198100068028b19998118061bab302c009200116375660566054605460546054605460540106eb0c0a8020dd618148041b92337166eb4c0a0c09c004dd7181418131814000981280098130008a9998119980f918179bad3032001333301d0063756604c00640022c2c203860600026ea8020c088c088004c084c084004c07cc084c07c0114ccc074c090c0a80084dd718100008b18150009baa301e301d301c001223232533301a3375e00698101000001e133005002374c6600a00200660386036603400660366032004446601c66ec000800407088cc04c894ccc0580040704cc03ccdd81812980d80098021813180d8009801180d000800911199802111ba63330062237506600e6eb4008dd68009bab00237560020040024446666024446600244a66602e00420022666600801060380046036004002444a6660300022660220060042646464a66603a66ebc0080044cc050cdd80011980598158031815801999804006802980f8020a99980e99b90375c0046eb80044cc050018cccc02003000cc07c0100144cc05000ccccc020030018014c07c010c0a4008c0a0010c07400401400800488004880088c034894ccc0400045288a998051801980a80089801180a0009299980799b89001480044c0080044004dc0a40004a66601a66e2400520001610012322223300d2253330100011005153330123375e603e602a00200c260086040602a0022600460280020026ea400488cdd2a4000660066ea4008cc00cdd4800a5eb815d0111998050010008a504988cc0088c888c00800cdd5980b0009ba90012223300522533300800112250011533300a3375e602e601a0020082600a601a0022600460180020024600444a66600a002294054cc018c00cc0280044c008c0240048c8c0088cc0080080048c0088cc00800800555cf9198010008a5157344601c6ea80055d12ba110014bd6f7b6301b8248008dc3a40006e1d2002370e901c1b8848000dc4a400026e9d2f5c0aae7555cf1", + "cborHex": "590cf4590cf1010000323232323232323232323232323232323232323232323232323232323232323232323232323232222232323232323232325333025302d3032002153330253302123031375a6068002666603e00c6eacc0a000c8004585840784c8c8c8c8c8c8c94ccc0a80045854ccc0b14cc08ccc0a08cc094020c0c0c0b800401054cc08cd5d198170008a99811981a1bad303a302f00113371e6eb8c0e4c0bc0040144c8ccccc0a88894ccc0b8004489400454ccc0c0c008c0cc0044c888c00800cc0cc0044cc00c008c0c80048c8c0dccccc08cdd718191818001a40004666604800490003ad37560026eacc0c8c0c4c0c0008dd71818981818178010021191929998182999818181b981e8010a5013371e02e6eb8c0cc0044c8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c94ccc10cc128c1400084c8c94ccc114c134c14800854ccc114c13c02854ccc114cdc38048050a99982299b8f375c609001a03c2a66608a60980102a66608a609e00e2a66608a606e6607a00c00a2a66608a94454ccc114c0d4cc0bcdd598241823982300c199818b803330317006605a00c6ea0028cc0b4064128cc0b4cc0e9221004881003750056207c2c2c2c2c2c2c2c2c2a66608a609e0142a66608a66e1c02402854ccc114cdc79bae304800d01e15333045304c00815333045304f0071533304530373303d00600515333045337126eb4c12000cdd698240008a999822981a998179bab304830473046018333031700666062e00cc0b4018dd40051981680c825198169981d245004881003750056207c2c2c2c2c2c2c2c2c60a40026ea8c1180244c8c8c94ccc118c14002c54ccc118cdc38050058a99982319b8f375c609201c03e2a66608c609a0122a66608c60a00102a66608c60706607c00e00c2a66608c94454ccc118c0d8cc0c0dd598249824182380c9998193803330327006605c00e6ea002ccc0b806812ccc0b8cc0ed2201004881003750058207e2c2c2c2c2c2c2c2c60a600460a20026ea8c118024c140004dd51822004182180518210061bad3041303f3041007375a6080607e0066eb4c0fc020dd6981f003181e000981d800981d000981c800981c000981b800981b000981a981a981a2999819981d0010b0a99981999b87480100084c8c8c8c80114ccc0d8c0f4c10c00854ccc0d8c0fcdc69bae303900113232323232323232323232323232323232325333048304f3055001132323232533304c3375e6e9cc13800941604c94ccc134cdc49b8d375c60a00029020099191919191919191919191919029a99982b982d80108290b1bad305b00130590055333056305d002153330563061375a60b20022640a0a6660a860b0002209e2c2c2a6660ac60bc0042640a0a6660a8002209e2c2c60c600460c20026ea8c158004c1500154ccc144c16000854ccc144c170dd6982a000899025a999827982980088250b0b0a999828982c801099025a99982780088250b0b182f001182e0009baa3051001304f00116304e006163750607c6eb4c138004c130008dd69826000982b0008b1baa304a00130480045333045304c30520021325333046533045304d0011304f0011325333047337126e34dd71825000a4080264082a66608a609200220802c2c60900042c6e34dd718240008b18290009baa30460013044002375a608800260840046eb4c108004c1000114ccc0f4c110c1280084c94ccc0f94cc0f4c1140044c11c0044c94ccc0fccdc49b8d375c6084002902009901ca99981e9820800881c0b0b18200010b1b8d375c60800022c60940026ea8c0f8004c0f00114ccc0e4c100c1180084c8c8c8c8c8c8c8c8c8c80f14ccc100c11001440ec594ccc104c1200084c8c8c8c8c80fd4ccc10cc11c01440f8594ccc110c12c0084c8c8c8c8c81094ccc118c1280144104594ccc11cc13800854ccc11cc140dc69bae304a001132041533304530490011040161615333047304f002153330473050371a6eb8c1280044c81054ccc114c1240044100585858c150008c148004dd518238008a99982218260010991919191919021a999823982580108210b1bad304b0013049002375a6092002608e0046eb4c11c00458c144008c13c004dd518220008a999820982480109901da99981f800881d0b0b182700118260009baa3041001303f005533303c30430021533303c3045371a6eb8c0fc0044c80d94ccc0e8c0f800440d4585854ccc0f0c11000854ccc0f0c114dc69bae303f001132036533303a303e001103516161630490023047001375460780022c608c0026ea8c0e8004c0e00045858c10c004dd5000981b00089999981711911180100198210009ba9375c606c0020124646464008a66606c607a60860042a66606c607e6e34dd7181c800899191919191919191919191919191919191929998241827982a800899191919299982619baf374e609c004a0b0264a66609a66e24dc69bae3050001481004c8c8c8c8c8c8c8c8c8c8c8c8c814d4ccc15cc16c008414858dd6982d800982c802a99982b182e8010a99982b18309bad305900113205053330543058001104f161615333056305e0021320505333054001104f161630630023061001375460ac00260a800aa6660a260b00042a6660a260b86eb4c1500044c812d4ccc13cc14c0044128585854ccc144c1640084c812d4ccc13c00441285858c178008c170004dd5182880098278008b18270030b1ba8303e375a609c00260980046eb4c130004c15800458dd5182500098240022999822982618290010992999823299822982680089827800899299982399b89371a6eb8c12800520401320415333045304900110401616304800216371a6eb8c12000458c148004dd5182300098220011bad30440013042002375a60840026080008a66607a60886094004264a66607ca6607a608a0022608e002264a66607e66e24dc69bae3042001481004c80e54ccc0f4c10400440e05858c10000858dc69bae304000116304a0013754607c0026078008a6660726080608c004264646464646464646464078a666080608800a20762ca66608260900042646464646407ea666086608e00a207c2ca666088609600426464646464084a66608c609400a20822ca66608e609c0042a66608e60a06e34dd71825000899020a999822982480088200b0b0a99982398278010a99982398281b8d375c6094002264082a66608a609200220802c2c2c60a800460a40026ea8c11c00454ccc110c1300084c8c8c8c8c8c810d4ccc11cc12c008410858dd6982580098248011bad30490013047002375a608e0022c60a2004609e0026ea8c11000454ccc104c1240084c80ed4ccc0fc00440e85858c138008c130004dd51820800981f802a99981e18218010a99981e18229b8d375c607e00226406ca666074607c002206a2c2c2a66607860880042a666078608a6e34dd7181f80089901b299981d181f000881a8b0b0b182480118238009baa303c0011630460013754607400260700022c2c60860026ea800458c100008c0f8004dd518199819181918188018b181e8009baa3031302f3031302f001163302100d00516333302500c3756605c01240022c6eacc0b4c0b0c0b0c0b0c0b0c0b0c0b0020dd618160041bac302b008372466e2cdd6981518148009bae302a3028302a00130270013028001303200137540106048604800260466046002604260466042008a66603e604c605800426eb8c08800458c0b0004dd51810180f980f000911919299980e19baf0034c1010000020133005002374c6600a002006603c603a6038006603a6036004446601e66ec000800407c88ccc011c00011980191ba6330042375066e052000375a0026eac00400488cc050894ccc05c0040744cc03ccdd81813180e00098021813980e0009801180d800800911199802111ba63330062237506600e6eb4008dd68009bab00237560020040024446666026446600244a666030004200226666008010603a0046038004002444a6660320022660220060042646464a66603c66ebc0080044cc050cdd8001198059816003181600199980400680298100020a99980f19b90375c0046eb80044cc050018cccc02003000cc0800100144cc05000ccccc020030018014c080010c0a8008c0a4010c07800401400800488004880088cc0088cc00c8c078dd698108009bab30200010012300d22533301000114a22a660126006602a002260046028002466601e002941289299980719b89001480005840048c8888cc038894ccc044004401454ccc04ccdd79810180b000803098021810980b00089801180a8008009ba9001223374a9000198019ba900233003375200297ae0574044666016004002294088cdd79ba7300b002374e6016002931198011191118010019bab301600137520024446600a44a666010002244a0022a66601466ebcc05cc0340040104c014c0340044c008c0300040048c008894ccc0140045280a9980318019805000898011804800919180111980100100091801119801001000aab9f23300200114a2ae688c038dd5000aba25742200498010101004bd6f7b6301b8748000dc3a40046e1d2038371090001b89480004dd3a5eb8155ceaab9e1", "description": "DEX.PartialOrderNFT", "params": [ "PlutusLedgerApi.V1.Scripts:ScriptHash", "GHC.Num.Integer:Integer" ], - "rawHex": "590c6b01000032323232323232323232323232323232323232323232323232323232323232323232323232222232323232323232325333023302a30300021323232323232325333028001161533302a5330223302623375e6e9cc0b0020dd39816181718160008020a998111aba3302c00115330223032375a6070605a002266e3cdd7181b981680080289919999814111299981600089128008a9998171801181880089911180100198188008998018011818000919181a99998111bae3030302e003480008cccc08c009200075a6eac004dd59818181798170011bae302f302e302d00200423232533302e533302e3035303b00214a0266e3c05cdd7181880089919191919191919191919191919299981e18230028a99981e19b870040051533303c3371e6eb8c0fc01c05c54ccc0f0c11c00c54ccc0f0c10c00854ccc0f0c1180044c8c8c8c8c8c8c8c8c94ccc114cc0d88cc0dc8c148dd6982a8009bab30540013330327006eacc120c11cc118068cc0c48dd31981911ba8303a375a0026eac004ccc0c9c019817982400a1ba800e3302f3303b488100488100375066e08cdc0006016a99982299b88304b00333704900000108008a99982299b87304b0033370466e1000c00800840044cdc024004002207c2c66e10008004cdc100119b830070033370400266e0c0140094ccc104c12001452000153330413371200a90000a40022900119981e91129998219825000880109980180099b8600200153330403371200400220022004a66608066e2400800440084004c0c400cc0c0004cdc100324004606060840022c2c2c2c2c2c6eb4c0f801cdd6981e981e0021bad303c003375a607600c6eb4c0e8010c0e0c0e0c0e0004c0dc004c0d8c0d8c0d8004c0d4004c0d0004c0ccc0ccc0c94ccc0c4c0e40084ccccc0b08c888c00800cc100004dd49bae303400100923232320045333034303b304100215333034303d371a6eb8c0dc0044c8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c94ccc118c134c14c0044c8c8c8c94ccc128cdd79ba7304c00250561323232533304d337126e34dd71828000a408026464646464646464646464646464640aaa6660b260ba00420a82c6eb4c174004c16c008dd6982d800982c802a99982b182e8010a99982b18309bad305900113205053330543058001104f161615333056305e0021320505333054001104f161630630023061001375460ac00260a800aa6660a260b00042a6660a260b86eb4c1500044c812d4ccc13cc14c0044128585854ccc144c1640084c812d4ccc13c00441285858c178008c170004dd5182880098278008b18270011bad304e001304c006163750607a6eb4c130004c128008dd69825000982a0008b1baa304800130460045333043304a30500021325333044533043304b0011304d0011325333045337126e34dd71824000a408026407ea666086608e002207c2c2c608c0042c6e34dd718230008b18280009baa30440013042002375a608400260800046eb4c100004c0f80114ccc0ecc108c1200084c94ccc0f14cc0ecc10c0044c1140044c94ccc0f4cdc49b8d375c6080002902009901ba99981d981f800881b0b0b181f0010b1b8d375c607c0022c60900026ea8c0f0004c0e80114ccc0dcc0f8c1100084c8c8c8c8c8c8c8c8c8c80e94ccc0f8c10801440e4594ccc0fcc1180084c8c8c8c8c80f54ccc104c11401440f0594ccc108c1240084c8c8c8c8c81014ccc110c12001440fc594ccc114c13000854ccc114c138dc69bae304800113203f53330433047001103e161615333045304d00215333045304e371a6eb8c1200044c80fd4ccc10cc11c00440f8585858c148008c140004dd518228008a99982118250010991919191919020a999822982480108200b1bad30490013047002375a608e002608a0046eb4c11400458c13c008c134004dd518210008a99981f982380109901ca99981e800881c0b0b182600118250009baa303f001303d005533303a30410021533303a3043371a6eb8c0f40044c80d14ccc0e0c0f000440cc585854ccc0e8c10800854ccc0e8c10cdc69bae303d0011320345333038303c001103316161630470023045001375460740022c60880026ea8c0e0004c0d80045858c104004dd50008b0a99981899b87480100084c8c8c8c80114ccc0d0c0ecc10400854ccc0d0c0f4dc69bae303700113232323232323232323232323232323232325333046304d3053001132323232533304a3375e6e9cc13000941584c8c8c94ccc134cdc49b8d375c60a00029020099191919191919191919191919191902aa99982c982e801082a0b1bad305d001305b002375a60b600260b200aa6660ac60ba0042a6660ac60c26eb4c1640044c81414ccc150c160004413c585854ccc158c1780084c81414ccc150004413c5858c18c008c184004dd5182b000982a002a999828982c0010a999828982e1bad305400113204b533304f3053001104a161615333051305900213204b533304f001104a1616305e002305c001375460a2002609e0022c609c0046eb4c138004c13001858dd4181e9bad304c001304a002375a609400260a80022c6ea8c120004c1180114ccc10cc128c1400084c94ccc1114cc10cc12c0044c1340044c94ccc114cdc49b8d375c6090002902009901fa9998219823800881f0b0b18230010b1b8d375c608c0022c60a00026ea8c110004c108008dd6982100098200011bad3040001303e004533303b30423048002132533303c53303b304300113045001132533303d337126e34dd71820000a408026406ea666076607e002206c2c2c607c0042c6e34dd7181f0008b18240009baa303c001303a0045333037303e304400213232323232323232323203a533303e3042005103916533303f30460021323232323203d53330413045005103c16533304230490021323232323204053330443048005103f165333045304c00215333045304e371a6eb8c1200044c80fd4ccc10cc11c00440f8585854ccc114c13400854ccc114c138dc69bae304800113203f53330433047001103e161616305200230500013754608a0022a66608460940042646464646464082a66608a609200420802c6eb4c124004c11c008dd6982380098228011bad304500116304f002304d001375460840022a66607e608e004264072a66607a00220702c2c609800460940026ea8c0fc004c0f40154ccc0e8c10400854ccc0e8c10cdc69bae303d0011320345333038303c001103316161533303a30420021533303a3043371a6eb8c0f40044c80d14ccc0e0c0f000440cc585858c11c008c114004dd5181d0008b18220009baa3038001303600116163041001375400260680022c607c00460780026ea8c0c4c0c0c0c0c0bc00c58c0ec004dd518179816981798168008b198100068028b19998118061bab302c009200116375660566054605460546054605460540106eb0c0a8020dd618148041b92337166eb4c0a0c09c004dd7181418131814000981280098130008a9998119980f918179bad3032001333301d0063756604c00640022c2c203860600026ea8020c088c088004c084c084004c07cc084c07c0114ccc074c090c0a80084dd718100008b18150009baa301e301d301c001223232533301a3375e00698101000001e133005002374c6600a00200660386036603400660366032004446601c66ec000800407088cc04c894ccc0580040704cc03ccdd81812980d80098021813180d8009801180d000800911199802111ba63330062237506600e6eb4008dd68009bab00237560020040024446666024446600244a66602e00420022666600801060380046036004002444a6660300022660220060042646464a66603a66ebc0080044cc050cdd80011980598158031815801999804006802980f8020a99980e99b90375c0046eb80044cc050018cccc02003000cc07c0100144cc05000ccccc020030018014c07c010c0a4008c0a0010c07400401400800488004880088c034894ccc0400045288a998051801980a80089801180a0009299980799b89001480044c0080044004dc0a40004a66601a66e2400520001610012322223300d2253330100011005153330123375e603e602a00200c260086040602a0022600460280020026ea400488cdd2a4000660066ea4008cc00cdd4800a5eb815d0111998050010008a504988cc0088c888c00800cdd5980b0009ba90012223300522533300800112250011533300a3375e602e601a0020082600a601a0022600460180020024600444a66600a002294054cc018c00cc0280044c008c0240048c8c0088cc0080080048c0088cc00800800555cf9198010008a5157344601c6ea80055d12ba110014bd6f7b6301b8248008dc3a40006e1d2002370e901c1b8848000dc4a400026e9d2f5c0aae7555cf1", + "rawHex": "590cf1010000323232323232323232323232323232323232323232323232323232323232323232323232323232222232323232323232325333025302d3032002153330253302123031375a6068002666603e00c6eacc0a000c8004585840784c8c8c8c8c8c8c94ccc0a80045854ccc0b14cc08ccc0a08cc094020c0c0c0b800401054cc08cd5d198170008a99811981a1bad303a302f00113371e6eb8c0e4c0bc0040144c8ccccc0a88894ccc0b8004489400454ccc0c0c008c0cc0044c888c00800cc0cc0044cc00c008c0c80048c8c0dccccc08cdd718191818001a40004666604800490003ad37560026eacc0c8c0c4c0c0008dd71818981818178010021191929998182999818181b981e8010a5013371e02e6eb8c0cc0044c8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c94ccc10cc128c1400084c8c94ccc114c134c14800854ccc114c13c02854ccc114cdc38048050a99982299b8f375c609001a03c2a66608a60980102a66608a609e00e2a66608a606e6607a00c00a2a66608a94454ccc114c0d4cc0bcdd598241823982300c199818b803330317006605a00c6ea0028cc0b4064128cc0b4cc0e9221004881003750056207c2c2c2c2c2c2c2c2c2a66608a609e0142a66608a66e1c02402854ccc114cdc79bae304800d01e15333045304c00815333045304f0071533304530373303d00600515333045337126eb4c12000cdd698240008a999822981a998179bab304830473046018333031700666062e00cc0b4018dd40051981680c825198169981d245004881003750056207c2c2c2c2c2c2c2c2c60a40026ea8c1180244c8c8c94ccc118c14002c54ccc118cdc38050058a99982319b8f375c609201c03e2a66608c609a0122a66608c60a00102a66608c60706607c00e00c2a66608c94454ccc118c0d8cc0c0dd598249824182380c9998193803330327006605c00e6ea002ccc0b806812ccc0b8cc0ed2201004881003750058207e2c2c2c2c2c2c2c2c60a600460a20026ea8c118024c140004dd51822004182180518210061bad3041303f3041007375a6080607e0066eb4c0fc020dd6981f003181e000981d800981d000981c800981c000981b800981b000981a981a981a2999819981d0010b0a99981999b87480100084c8c8c8c80114ccc0d8c0f4c10c00854ccc0d8c0fcdc69bae303900113232323232323232323232323232323232325333048304f3055001132323232533304c3375e6e9cc13800941604c94ccc134cdc49b8d375c60a00029020099191919191919191919191919029a99982b982d80108290b1bad305b00130590055333056305d002153330563061375a60b20022640a0a6660a860b0002209e2c2c2a6660ac60bc0042640a0a6660a8002209e2c2c60c600460c20026ea8c158004c1500154ccc144c16000854ccc144c170dd6982a000899025a999827982980088250b0b0a999828982c801099025a99982780088250b0b182f001182e0009baa3051001304f00116304e006163750607c6eb4c138004c130008dd69826000982b0008b1baa304a00130480045333045304c30520021325333046533045304d0011304f0011325333047337126e34dd71825000a4080264082a66608a609200220802c2c60900042c6e34dd718240008b18290009baa30460013044002375a608800260840046eb4c108004c1000114ccc0f4c110c1280084c94ccc0f94cc0f4c1140044c11c0044c94ccc0fccdc49b8d375c6084002902009901ca99981e9820800881c0b0b18200010b1b8d375c60800022c60940026ea8c0f8004c0f00114ccc0e4c100c1180084c8c8c8c8c8c8c8c8c8c80f14ccc100c11001440ec594ccc104c1200084c8c8c8c8c80fd4ccc10cc11c01440f8594ccc110c12c0084c8c8c8c8c81094ccc118c1280144104594ccc11cc13800854ccc11cc140dc69bae304a001132041533304530490011040161615333047304f002153330473050371a6eb8c1280044c81054ccc114c1240044100585858c150008c148004dd518238008a99982218260010991919191919021a999823982580108210b1bad304b0013049002375a6092002608e0046eb4c11c00458c144008c13c004dd518220008a999820982480109901da99981f800881d0b0b182700118260009baa3041001303f005533303c30430021533303c3045371a6eb8c0fc0044c80d94ccc0e8c0f800440d4585854ccc0f0c11000854ccc0f0c114dc69bae303f001132036533303a303e001103516161630490023047001375460780022c608c0026ea8c0e8004c0e00045858c10c004dd5000981b00089999981711911180100198210009ba9375c606c0020124646464008a66606c607a60860042a66606c607e6e34dd7181c800899191919191919191919191919191919191929998241827982a800899191919299982619baf374e609c004a0b0264a66609a66e24dc69bae3050001481004c8c8c8c8c8c8c8c8c8c8c8c8c814d4ccc15cc16c008414858dd6982d800982c802a99982b182e8010a99982b18309bad305900113205053330543058001104f161615333056305e0021320505333054001104f161630630023061001375460ac00260a800aa6660a260b00042a6660a260b86eb4c1500044c812d4ccc13cc14c0044128585854ccc144c1640084c812d4ccc13c00441285858c178008c170004dd5182880098278008b18270030b1ba8303e375a609c00260980046eb4c130004c15800458dd5182500098240022999822982618290010992999823299822982680089827800899299982399b89371a6eb8c12800520401320415333045304900110401616304800216371a6eb8c12000458c148004dd5182300098220011bad30440013042002375a60840026080008a66607a60886094004264a66607ca6607a608a0022608e002264a66607e66e24dc69bae3042001481004c80e54ccc0f4c10400440e05858c10000858dc69bae304000116304a0013754607c0026078008a6660726080608c004264646464646464646464078a666080608800a20762ca66608260900042646464646407ea666086608e00a207c2ca666088609600426464646464084a66608c609400a20822ca66608e609c0042a66608e60a06e34dd71825000899020a999822982480088200b0b0a99982398278010a99982398281b8d375c6094002264082a66608a609200220802c2c2c60a800460a40026ea8c11c00454ccc110c1300084c8c8c8c8c8c810d4ccc11cc12c008410858dd6982580098248011bad30490013047002375a608e0022c60a2004609e0026ea8c11000454ccc104c1240084c80ed4ccc0fc00440e85858c138008c130004dd51820800981f802a99981e18218010a99981e18229b8d375c607e00226406ca666074607c002206a2c2c2a66607860880042a666078608a6e34dd7181f80089901b299981d181f000881a8b0b0b182480118238009baa303c0011630460013754607400260700022c2c60860026ea800458c100008c0f8004dd518199819181918188018b181e8009baa3031302f3031302f001163302100d00516333302500c3756605c01240022c6eacc0b4c0b0c0b0c0b0c0b0c0b0c0b0020dd618160041bac302b008372466e2cdd6981518148009bae302a3028302a00130270013028001303200137540106048604800260466046002604260466042008a66603e604c605800426eb8c08800458c0b0004dd51810180f980f000911919299980e19baf0034c1010000020133005002374c6600a002006603c603a6038006603a6036004446601e66ec000800407c88ccc011c00011980191ba6330042375066e052000375a0026eac00400488cc050894ccc05c0040744cc03ccdd81813180e00098021813980e0009801180d800800911199802111ba63330062237506600e6eb4008dd68009bab00237560020040024446666026446600244a666030004200226666008010603a0046038004002444a6660320022660220060042646464a66603c66ebc0080044cc050cdd8001198059816003181600199980400680298100020a99980f19b90375c0046eb80044cc050018cccc02003000cc0800100144cc05000ccccc020030018014c080010c0a8008c0a4010c07800401400800488004880088cc0088cc00c8c078dd698108009bab30200010012300d22533301000114a22a660126006602a002260046028002466601e002941289299980719b89001480005840048c8888cc038894ccc044004401454ccc04ccdd79810180b000803098021810980b00089801180a8008009ba9001223374a9000198019ba900233003375200297ae0574044666016004002294088cdd79ba7300b002374e6016002931198011191118010019bab301600137520024446600a44a666010002244a0022a66601466ebcc05cc0340040104c014c0340044c008c0300040048c008894ccc0140045280a9980318019805000898011804800919180111980100100091801119801001000aab9f23300200114a2ae688c038dd5000aba25742200498010101004bd6f7b6301b8748000dc3a40046e1d2038371090001b89480004dd3a5eb8155ceaab9e1", "role": "MintingPolicyRole", "type": "PlutusScriptV2", "version": "ScriptV2" diff --git a/compiled-scripts/partial-order b/compiled-scripts/partial-order index f9518ac..6334d80 100644 --- a/compiled-scripts/partial-order +++ b/compiled-scripts/partial-order @@ -1,12 +1,11 @@ { - "cborHex": "590ba2590b9f0100003232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232222222323232323232323232323232323232533303e304530490031323232323232323333041233040008304530410013758608800c4646464666608a464a660826608a6094608c002044260a4660846eacc128c124c118004084c124c120c114004dd61824004919192999826182a182b80109919192999827982b1998238038008048991919191919191919299982c182f001899299982c9982b11299982e0008a501533305b3375e60b400200629444c008c164004dd6182c00a8a99982c99b87008304d4800841385858dd49bae305702913253330593060004132533305a3371090000008a99982d19b880010081533305a337126eb4c16409400454ccc168cc008c100ccc121c0180e800998231981fa4500488100375005ea0062a6660b4666084e24ccc121c00091981b91ba6330382375060a06eb4004dd58009998243803304600737500026608c6607e910100488100375066e000840bcc8c8c8cc168894ccc1800041844c94ccc1814cc158cc14cc17cc178c178004c1a80104cc168c17c0040144dd5982f982f182d982f80109801982f001182d182f000806998271982c91299982f8008b099299982f99baf306b305e002005100113003305d0023069305d00100d4bd70182d182b00a183199826182c982a81719826182c982c182a81719826182c982c182c182a81719826182c981b182a817198261ba8337020100026609860b2606a60aa05c6609860b260b0606a60aa05c6609860b2606860aa05c6609860b260b0606860aa05c6609860b2606660aa05c6609860b260b0606660aa05c6609860b2606460aa05c660986ea0cdc01bad305930583032305502e480092f5c02646464a6660ba60c860d000426464a6660be60ca60d40042a6660be6607c607a6eb4c1780040144150584150c1a8004dd5182e0128a99982e9981e181f9bad305c00100313232533305f3065306a0021533305f3303e303d375a60bc00200a20a82c20a860d40026ea8c17009458c1a0004dd5182d012182c80b8b0b0b0b0b1bad3058003153330593370e010609a90010a99982c99800981f999823b80301c007330453303e48900488100375066e04cdc0998280089981f2441004881003305033045006375000e6607c9110048810002050021323232533305c306230670021533305c3303b303e375a60b600200626464a6660bc60c860d20042a6660bc6607a60786eb4c174004014414c58414cc1a4004dd5182d8120b09919299982f183218348010a99982f1981e981e1bad305d00100510531610533069001375460b604860ce0026ea8c16408cc1600585858c101c48991919982b111299982e80088010991919802a99982f29982a19828982e982e182e000983400309982c182e8008038999826380004375660ba60b860b2004200860b800660b000260b60020ba01266094660aa44a6660b60022c264a6660b666ebcc19cc16800807440044c00cc164008c194c1640040252f5c060ac04e60c400460c00026ea809cc148088dd698288101998249bab305000f00300b3758609e01e6eacc138c134c13402c4110dd729998272999827182a0008a5113370e901c00088010b1b8d375c00260960022c60ae0026ea8c124c120c120c114c124c120c11400458dd59823982318218009823182298210011bae304501016304200130413041304100130403040001303f001303e001303a303e005303d002162323232323232323232323303430470153750a66609066e20c13400ccdc12400000420022a66609066e1cc13400ccdc119b840030020021001133700900100099b840020013370400466e0c01800ccdc100099b830060025333044304a00414800054ccc110cdc480224000290008a4004666080444a66608c6098002200426600600266e180080054ccc10ccdc480100088008801299982199b8900200110021001302d002302c0023045375a607e607c00466e08008dd6981f000981c981e80518240009baa303a3039001303500c375a6070606e002606c002606a002606800260660026064002606200260606060002605e002605c00260540064604e604e60040024604c604c60040024604a604a600400246048604860040024604660466046002446604444a66605000205226603266ec0c0c8c098004c010c0ccc098004c008c0940040048c0b0cc054c0b0cc054c0b12f5c06602a600e9452f5c06602a600c00297ae022323253301b33005302400230240011330053024302300130243023002301f002301e002223232323232323232533302a533302a33710004002294454ccc0a8cdc38010008991929998161819802099b88375a60560046eb4c0ac004528181b802181b0020a5014a22a6660546603a00c00a266605460166052605001060166052605000e944528181a00118198011baa002375400460480046046004603c004603a0044604e60566ea80048c0a0cc044c008004cc044c0a0cc044cdd2a400897ae03301130034a297ae04bd7011813998081814198081ba80014bd701980818012514bd70119ba533301d0014800920004bd70111813198079ba90023300f375200297ae023300223233533301d35746002244a00224460040064644460040066e980044894004cc00c94ccc074cdd7800810091280089118010019bab001001223301822533301e00101f132333005302a301d002233011337606054603c00600200420026004603600200246444666032444a66604000426601246600e0486eacc0b00040044c94ccc08400854cc058cc01c0040904cc0288cc020dd59816800812980f0018991919299981199b8f00200115330193300a0040031330073021006302100515333023337200040022a660326601400804e26600e604200c00a2a660326601404e00626600e00c604200a6eb8c0b4c084010dd7181618100021bab302c301f00237566056603c00400400244666030444a66603e00426601046600e0106eb4c0ac0040044c94ccc08000854cc054cc01c0040204cc0248cc020dd69816000804980e8018991919299981119b8f00200115330183300a0040031330073020006302000515333022337200040022a660306601400801626600e604000c00a2a660306601401600626600e00c604000a6eb8c0b0c080010dd71815980f8021bad302b301e002375a6054603a00400400290001180a11299980d0008a51153300f3003301800113002301700125333016337120029000898050008800911919299980c19baf00301b01a133005002374c6600a002006602c602a6024006602a6022004446600e66ec0008004064888ccc01088dd3199803111ba833007375a0046eb4004dd58011bab0010020012223333011223300122533301900210011333300400830170023016002001222533301a00113300b0030021323232533301c3375e00400226601c66ec0008cc02cc0a0018c0a000cccc020034014c06801054ccc070cdc81bae002375c00226601c00c6666010018006603400800a26601c006666601001800c00a6034008604c004604a008603000200a0040024400244004ae8088c8c8c94ccc048c0640084c8c94ccc050c06cc07c0084cdd79ba7003374e0022940c07c004dd50020a999809180d00109919299980a180e180f801099baf374e0066e9c004528180f8009baa004132325333014301a301f00213375e6e9c00cdd38008a50301f0013754008603a00460360026ea8008dc0a400093111998060010008a5022333003002375c6014600c0026eb8c028c024c018004888cccc01000920002333300500248001d69bab0010032322223300922533300f00110051533300e3375e6032601a00200c260086034601a0022600460180020026ea400488cdd79ba73003002374e6006002460246ea8004c0048894ccc020004489400454ccc01cc008c0180044c888c00800cc0180044cc00c008c0140048c8c0088cc0080080048c0088cc0080080055d12ba15734aae7c40093010100004bd6f7b6301b8248008dc3a40006e1d2002370e90021ba548000dd2a4004aae7555cf1", + "cborHex": "590a3a590a370100003232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323222222323232323232323232323232325333038303e3042003132323232323232333303b23303a008303f303b0013758607c00c4646464666607e464a6607c6607e6088608000203e260966660786eacc110c10cc100004dd71822182000f1bae30443043304001e30433042303f0013758608401246464a66608c609a60a00042646464a666092609e66608000e00201226464646464646464a6660a260ac004264a6660a46609e44a6660aa002294054ccc150cdd798298008018a51130023052001375860a20282a6660a466e1c01cc11d20021048161637526eb8c14009854ccc144c15c0084c94ccc148cdc4240000022a6660a466e2000401854ccc148ccc101c49981d19981e380010301b001330440053750002666606260b46608c60a2609a0546608c60a260a0609a0546608c60a260a060a0609a0546608c60a26060609a0546608c6ea0cdc0803000998231828981798268151982318289828181798268151982318289817182681519823182898281817182681519823182898169826815198231ba8337006eb4c144c140c0b4c1340a920024bd70182898268088048040991919299982a982d982f80109919299982b982e18308010a99982b9981c181b9bad3056001005104d16104d3061001375460a80442a6660aa6606c60746eb4c15000400c4c8c94ccc15cc170c18400854ccc15ccc0e0c0dcdd6982b00080288268b082698308009baa305402216305f001375460a404260a202a2c2c2c6eb4c14000454ccc144cdc38031823240042a6660a266607ee24cc0e4cc0e4ccc0edc0007980d002998218021ba80053304330593304537520126608a6ea40452f5c098010101003333030019305002500800713232325333054305a305e002132325333056305b306000215333056330373036375a60aa00200a20982c209860c00026ea8c14c08454ccc150cc0d4c0e4dd6982980080189919299982b182d98300010a99982b1981b981b1bad3055001005104c16104c3060001375460a60422c60bc0026ea8c144080c1400505858c16c008c164004dd501298260101bad304b01e3330423756609401e0060166eb0c12403cdd5982418239823805881f9bae53330485333048304d00114a2266e1d2038001100216371a6eb8004c11400458c140004dd5182198211821181f98219821181f8008b1bab30413040303d0013040303f303c002375c607e01e2c607800260766076607600260746074002607200260700026068607000a606e0042c4646464646464646464646606860820266ea14ccc108cdc4182300199b8248000008400454ccc108cdc3982300199b82337080060040042002266e0120020013370800400266e08008cdc180300199b820013370600c004a66607c6086008290000a99981f19b890044800052001148008ccc0e88894ccc100c11400440084cc00c004cdc3001000a99981e99b8900200110011002533303d3371200400220042002605a0046058004607c6eb4c0e4c0e0008cdc10011bad3038001303330370083041001375460686066002605e01460620026060002605e002605c002605a0026058605800260560026054002604c006460486048600400246046604660040024604460446004002460426042604200244464604444a666050002052264a666050a6604266018604e604c604c0026062008266044604e00200c26eacc09cc098c08cc09c0084c00cc098008c088c098004cc060cc084894ccc09c004584c94ccc09ccdd798191813001003080089801981280118181812800800a5eb808c0a4cc054c0a4cc054c0a52f5c06602a60109452f5c06602a600e00297ae022323253301c33005302200230220011330053022302100130223021002301d002301c0022232323232323232325333028533302833710004002294454ccc0a0cdc38010008991929998151818002099b88375a60520046eb4c0a4004528181a00218198020a5014a22a6660506601800c00a26660506016604e604c0106016604e604c00e944528181880118180011baa002375400460440046042004603800460360044604860506ea800488c8c8c94ccc084c09c0084c8c94ccc08cc0a4c0b40084cdd79ba7003374e0022940c0b4004dd50020a999810981400109919299981198151816801099baf374e0066e9c00452818168009baa0041323253330233028302d00213375e6e9c00cdd38008a50302d0013754008605600460520026ea80088c090cc040c008004cc040c090cc040cdd2a400897ae03301030034a297ae04bd7011811998079812198079ba80014bd701980798012514bd70119ba533301a0014800920004bd7011199802380002330032374c6600846ea0c044dd68009bab001001223301622533301c00101d13300f33760604a60340026008604c603400260046032002002444666008446e98ccc01888dd4198039bad002375a0026eac008dd5800801000911199980a911980091299980e801080089999802004180d801180d001000911299980f0008998088018010991919299981019baf0020011330143376000466016605600c605600666601001a00a603c0082a66604066e40dd70011bae001133014006333300800c003301e004005133014003333300800c006005301e00430290023028004301c001005002001220012200223222333013222533301a00213300923300701d3756604a002002264a6660360042a660266600e00203a2660144660106eacc098004078c06000c4c8c8c94ccc074cdc78010008a9980b19805002001899803980d803180d8028a99980e99b9000200115330163300a004020133007301b00600515330163300a020003133007006301b005375c604c60360086eb8c094c068010dd59812980c8011bab30243018002002001223330122225333019002133008233007008375a6048002002264a6660340042a660246600e0020102660124660106eb4c094004024c05c00c4c8c8c94ccc070cdc78010008a9980a99805002001899803980d003180d0028a99980e19b9000200115330153300a00400b133007301a00600515330153300a00b003133007006301a005375c604a60340086eb8c090c064010dd69812180c0011bad30233017002002001480008c038894ccc0500045288a99806180198090008980118088009299980819b89001480044c014004400488c8c94ccc048cdd7801a601010000014133005002374c6600a0020066020601e6018006601e6016004446600666ec00080040495d01b8148001262223333004002480008cccc014009200075a6eac00400c8c8888cc028894ccc040004401454ccc03ccdd7980c980700080309802180d18070008980118068008009ba90012233300900200114a04466ebcdd398018011ba730030012301137540026002444a666010002244a0022a66600e6004600c002264446004006600c002266006004600a002464600446600400400246004466004004002ae895d0ab9a5573e200297adef6c60370490011b8748000dc3a40046e1d2004374a90001ba54800955ceaab9e01", "description": "DEX.PartialOrder", "params": [ "PlutusLedgerApi.V1.Address:Address", - "PlutusLedgerApi.V1.Value:AssetClass", - "GHC.Num.Integer:Integer" + "PlutusLedgerApi.V1.Value:AssetClass" ], - "rawHex": "590b9f0100003232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232222222323232323232323232323232323232533303e304530490031323232323232323333041233040008304530410013758608800c4646464666608a464a660826608a6094608c002044260a4660846eacc128c124c118004084c124c120c114004dd61824004919192999826182a182b80109919192999827982b1998238038008048991919191919191919299982c182f001899299982c9982b11299982e0008a501533305b3375e60b400200629444c008c164004dd6182c00a8a99982c99b87008304d4800841385858dd49bae305702913253330593060004132533305a3371090000008a99982d19b880010081533305a337126eb4c16409400454ccc168cc008c100ccc121c0180e800998231981fa4500488100375005ea0062a6660b4666084e24ccc121c00091981b91ba6330382375060a06eb4004dd58009998243803304600737500026608c6607e910100488100375066e000840bcc8c8c8cc168894ccc1800041844c94ccc1814cc158cc14cc17cc178c178004c1a80104cc168c17c0040144dd5982f982f182d982f80109801982f001182d182f000806998271982c91299982f8008b099299982f99baf306b305e002005100113003305d0023069305d00100d4bd70182d182b00a183199826182c982a81719826182c982c182a81719826182c982c182c182a81719826182c981b182a817198261ba8337020100026609860b2606a60aa05c6609860b260b0606a60aa05c6609860b2606860aa05c6609860b260b0606860aa05c6609860b2606660aa05c6609860b260b0606660aa05c6609860b2606460aa05c660986ea0cdc01bad305930583032305502e480092f5c02646464a6660ba60c860d000426464a6660be60ca60d40042a6660be6607c607a6eb4c1780040144150584150c1a8004dd5182e0128a99982e9981e181f9bad305c00100313232533305f3065306a0021533305f3303e303d375a60bc00200a20a82c20a860d40026ea8c17009458c1a0004dd5182d012182c80b8b0b0b0b0b1bad3058003153330593370e010609a90010a99982c99800981f999823b80301c007330453303e48900488100375066e04cdc0998280089981f2441004881003305033045006375000e6607c9110048810002050021323232533305c306230670021533305c3303b303e375a60b600200626464a6660bc60c860d20042a6660bc6607a60786eb4c174004014414c58414cc1a4004dd5182d8120b09919299982f183218348010a99982f1981e981e1bad305d00100510531610533069001375460b604860ce0026ea8c16408cc1600585858c101c48991919982b111299982e80088010991919802a99982f29982a19828982e982e182e000983400309982c182e8008038999826380004375660ba60b860b2004200860b800660b000260b60020ba01266094660aa44a6660b60022c264a6660b666ebcc19cc16800807440044c00cc164008c194c1640040252f5c060ac04e60c400460c00026ea809cc148088dd698288101998249bab305000f00300b3758609e01e6eacc138c134c13402c4110dd729998272999827182a0008a5113370e901c00088010b1b8d375c00260960022c60ae0026ea8c124c120c120c114c124c120c11400458dd59823982318218009823182298210011bae304501016304200130413041304100130403040001303f001303e001303a303e005303d002162323232323232323232323303430470153750a66609066e20c13400ccdc12400000420022a66609066e1cc13400ccdc119b840030020021001133700900100099b840020013370400466e0c01800ccdc100099b830060025333044304a00414800054ccc110cdc480224000290008a4004666080444a66608c6098002200426600600266e180080054ccc10ccdc480100088008801299982199b8900200110021001302d002302c0023045375a607e607c00466e08008dd6981f000981c981e80518240009baa303a3039001303500c375a6070606e002606c002606a002606800260660026064002606200260606060002605e002605c00260540064604e604e60040024604c604c60040024604a604a600400246048604860040024604660466046002446604444a66605000205226603266ec0c0c8c098004c010c0ccc098004c008c0940040048c0b0cc054c0b0cc054c0b12f5c06602a600e9452f5c06602a600c00297ae022323253301b33005302400230240011330053024302300130243023002301f002301e002223232323232323232533302a533302a33710004002294454ccc0a8cdc38010008991929998161819802099b88375a60560046eb4c0ac004528181b802181b0020a5014a22a6660546603a00c00a266605460166052605001060166052605000e944528181a00118198011baa002375400460480046046004603c004603a0044604e60566ea80048c0a0cc044c008004cc044c0a0cc044cdd2a400897ae03301130034a297ae04bd7011813998081814198081ba80014bd701980818012514bd70119ba533301d0014800920004bd70111813198079ba90023300f375200297ae023300223233533301d35746002244a00224460040064644460040066e980044894004cc00c94ccc074cdd7800810091280089118010019bab001001223301822533301e00101f132333005302a301d002233011337606054603c00600200420026004603600200246444666032444a66604000426601246600e0486eacc0b00040044c94ccc08400854cc058cc01c0040904cc0288cc020dd59816800812980f0018991919299981199b8f00200115330193300a0040031330073021006302100515333023337200040022a660326601400804e26600e604200c00a2a660326601404e00626600e00c604200a6eb8c0b4c084010dd7181618100021bab302c301f00237566056603c00400400244666030444a66603e00426601046600e0106eb4c0ac0040044c94ccc08000854cc054cc01c0040204cc0248cc020dd69816000804980e8018991919299981119b8f00200115330183300a0040031330073020006302000515333022337200040022a660306601400801626600e604000c00a2a660306601401600626600e00c604000a6eb8c0b0c080010dd71815980f8021bad302b301e002375a6054603a00400400290001180a11299980d0008a51153300f3003301800113002301700125333016337120029000898050008800911919299980c19baf00301b01a133005002374c6600a002006602c602a6024006602a6022004446600e66ec0008004064888ccc01088dd3199803111ba833007375a0046eb4004dd58011bab0010020012223333011223300122533301900210011333300400830170023016002001222533301a00113300b0030021323232533301c3375e00400226601c66ec0008cc02cc0a0018c0a000cccc020034014c06801054ccc070cdc81bae002375c00226601c00c6666010018006603400800a26601c006666601001800c00a6034008604c004604a008603000200a0040024400244004ae8088c8c8c94ccc048c0640084c8c94ccc050c06cc07c0084cdd79ba7003374e0022940c07c004dd50020a999809180d00109919299980a180e180f801099baf374e0066e9c004528180f8009baa004132325333014301a301f00213375e6e9c00cdd38008a50301f0013754008603a00460360026ea8008dc0a400093111998060010008a5022333003002375c6014600c0026eb8c028c024c018004888cccc01000920002333300500248001d69bab0010032322223300922533300f00110051533300e3375e6032601a00200c260086034601a0022600460180020026ea400488cdd79ba73003002374e6006002460246ea8004c0048894ccc020004489400454ccc01cc008c0180044c888c00800cc0180044cc00c008c0140048c8c0088cc0080080048c0088cc0080080055d12ba15734aae7c40093010100004bd6f7b6301b8248008dc3a40006e1d2002370e90021ba548000dd2a4004aae7555cf1", + "rawHex": "590a370100003232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323222222323232323232323232323232325333038303e3042003132323232323232333303b23303a008303f303b0013758607c00c4646464666607e464a6607c6607e6088608000203e260966660786eacc110c10cc100004dd71822182000f1bae30443043304001e30433042303f0013758608401246464a66608c609a60a00042646464a666092609e66608000e00201226464646464646464a6660a260ac004264a6660a46609e44a6660aa002294054ccc150cdd798298008018a51130023052001375860a20282a6660a466e1c01cc11d20021048161637526eb8c14009854ccc144c15c0084c94ccc148cdc4240000022a6660a466e2000401854ccc148ccc101c49981d19981e380010301b001330440053750002666606260b46608c60a2609a0546608c60a260a0609a0546608c60a260a060a0609a0546608c60a26060609a0546608c6ea0cdc0803000998231828981798268151982318289828181798268151982318289817182681519823182898281817182681519823182898169826815198231ba8337006eb4c144c140c0b4c1340a920024bd70182898268088048040991919299982a982d982f80109919299982b982e18308010a99982b9981c181b9bad3056001005104d16104d3061001375460a80442a6660aa6606c60746eb4c15000400c4c8c94ccc15cc170c18400854ccc15ccc0e0c0dcdd6982b00080288268b082698308009baa305402216305f001375460a404260a202a2c2c2c6eb4c14000454ccc144cdc38031823240042a6660a266607ee24cc0e4cc0e4ccc0edc0007980d002998218021ba80053304330593304537520126608a6ea40452f5c098010101003333030019305002500800713232325333054305a305e002132325333056305b306000215333056330373036375a60aa00200a20982c209860c00026ea8c14c08454ccc150cc0d4c0e4dd6982980080189919299982b182d98300010a99982b1981b981b1bad3055001005104c16104c3060001375460a60422c60bc0026ea8c144080c1400505858c16c008c164004dd501298260101bad304b01e3330423756609401e0060166eb0c12403cdd5982418239823805881f9bae53330485333048304d00114a2266e1d2038001100216371a6eb8004c11400458c140004dd5182198211821181f98219821181f8008b1bab30413040303d0013040303f303c002375c607e01e2c607800260766076607600260746074002607200260700026068607000a606e0042c4646464646464646464646606860820266ea14ccc108cdc4182300199b8248000008400454ccc108cdc3982300199b82337080060040042002266e0120020013370800400266e08008cdc180300199b820013370600c004a66607c6086008290000a99981f19b890044800052001148008ccc0e88894ccc100c11400440084cc00c004cdc3001000a99981e99b8900200110011002533303d3371200400220042002605a0046058004607c6eb4c0e4c0e0008cdc10011bad3038001303330370083041001375460686066002605e01460620026060002605e002605c002605a0026058605800260560026054002604c006460486048600400246046604660040024604460446004002460426042604200244464604444a666050002052264a666050a6604266018604e604c604c0026062008266044604e00200c26eacc09cc098c08cc09c0084c00cc098008c088c098004cc060cc084894ccc09c004584c94ccc09ccdd798191813001003080089801981280118181812800800a5eb808c0a4cc054c0a4cc054c0a52f5c06602a60109452f5c06602a600e00297ae022323253301c33005302200230220011330053022302100130223021002301d002301c0022232323232323232325333028533302833710004002294454ccc0a0cdc38010008991929998151818002099b88375a60520046eb4c0a4004528181a00218198020a5014a22a6660506601800c00a26660506016604e604c0106016604e604c00e944528181880118180011baa002375400460440046042004603800460360044604860506ea800488c8c8c94ccc084c09c0084c8c94ccc08cc0a4c0b40084cdd79ba7003374e0022940c0b4004dd50020a999810981400109919299981198151816801099baf374e0066e9c00452818168009baa0041323253330233028302d00213375e6e9c00cdd38008a50302d0013754008605600460520026ea80088c090cc040c008004cc040c090cc040cdd2a400897ae03301030034a297ae04bd7011811998079812198079ba80014bd701980798012514bd70119ba533301a0014800920004bd7011199802380002330032374c6600846ea0c044dd68009bab001001223301622533301c00101d13300f33760604a60340026008604c603400260046032002002444666008446e98ccc01888dd4198039bad002375a0026eac008dd5800801000911199980a911980091299980e801080089999802004180d801180d001000911299980f0008998088018010991919299981019baf0020011330143376000466016605600c605600666601001a00a603c0082a66604066e40dd70011bae001133014006333300800c003301e004005133014003333300800c006005301e00430290023028004301c001005002001220012200223222333013222533301a00213300923300701d3756604a002002264a6660360042a660266600e00203a2660144660106eacc098004078c06000c4c8c8c94ccc074cdc78010008a9980b19805002001899803980d803180d8028a99980e99b9000200115330163300a004020133007301b00600515330163300a020003133007006301b005375c604c60360086eb8c094c068010dd59812980c8011bab30243018002002001223330122225333019002133008233007008375a6048002002264a6660340042a660246600e0020102660124660106eb4c094004024c05c00c4c8c8c94ccc070cdc78010008a9980a99805002001899803980d003180d0028a99980e19b9000200115330153300a00400b133007301a00600515330153300a00b003133007006301a005375c604a60340086eb8c090c064010dd69812180c0011bad30233017002002001480008c038894ccc0500045288a99806180198090008980118088009299980819b89001480044c014004400488c8c94ccc048cdd7801a601010000014133005002374c6600a0020066020601e6018006601e6016004446600666ec00080040495d01b8148001262223333004002480008cccc014009200075a6eac00400c8c8888cc028894ccc040004401454ccc03ccdd7980c980700080309802180d18070008980118068008009ba90012233300900200114a04466ebcdd398018011ba730030012301137540026002444a666010002244a0022a66600e6004600c002264446004006600c002266006004600a002464600446600400400246004466004004002ae895d0ab9a5573e200297adef6c60370490011b8748000dc3a40046e1d2004374a90001ba54800955ceaab9e01", "role": "ValidatorRole", "type": "PlutusScriptV2", "version": "ScriptV2" diff --git a/config-files/bot-config.json b/config-files/bot-config.json index 4d23a80..f06c8aa 100644 --- a/config-files/bot-config.json +++ b/config-files/bot-config.json @@ -1,23 +1,23 @@ { - "signingKeyFP":"bot.skey", - "nftMintingPolicyFP":"compiled-scripts/minting-policy", - "orderValidatorFP":"compiled-scripts/partial-order", - "validatorRefs":{ - "refAddr":"addr_test1wpgexmeunzsykesf42d4eqet5yvzeap6trjnflxqtkcf66g0kpnxt", - "refNftAC":"fae686ea8f21d567841d703dea4d4221c2af071a6f2b433ff07c0af2.e6a295bb83d06f53fcf91151f54acec0a63fbd6f0d924206d5d012e6da3b72af", - "refNftUtxoRef":"39f987a6beb9cc4c45bba149a21c28068f640f3593f15f8157f0b6022b431977#0", - "scriptRef":"39f987a6beb9cc4c45bba149a21c28068f640f3593f15f8157f0b6022b431977#1", - "nftPolicyRef":"39f987a6beb9cc4c45bba149a21c28068f640f3593f15f8157f0b6022b431977#0" - }, - "strategy":"OneSellToManyBuy", - "scanDelay":40000000, - "maxOrderMatches":5, - "maxTxsPerIteration":5, - "randomizeMatchesFound":true, - "scanTokens":[ - { - "commodityAsset":"c6e65ba7878b2f8ea0ad39287d3e2fd256dc5c4160fc19bdf4c4d87e.7447454e53", - "currencyAsset":"lovelace" - } - ] + "signingKeyFP": "bot.skey", + "nftMintingPolicyFP": "compiled-scripts/minting-policy", + "orderValidatorFP": "compiled-scripts/partial-order", + "validatorRefs": { + "refAddr": "addr_test1wpgexmeunzsykesf42d4eqet5yvzeap6trjnflxqtkcf66g0kpnxt", + "refNftAC": "fae686ea8f21d567841d703dea4d4221c2af071a6f2b433ff07c0af2.6af3807634905a04be64a8dbe0ddb9da6ce52eed23cb428c7be5d6114eacc189", + "refNftUtxoRef": "aaaae7e568aab31db6f74faaf550867d58b2361868324567470862ecaaac7646#0", + "scriptRef": "aaaae7e568aab31db6f74faaf550867d58b2361868324567470862ecaaac7646#1", + "nftPolicyRef": "aaaae7e568aab31db6f74faaf550867d58b2361868324567470862ecaaac7646#0" + }, + "strategy": "OneSellToManyBuy", + "scanDelay": 40000000, + "maxOrderMatches": 5, + "maxTxsPerIteration": 5, + "randomizeMatchesFound": true, + "scanTokens": [ + { + "commodityAsset": "c6e65ba7878b2f8ea0ad39287d3e2fd256dc5c4160fc19bdf4c4d87e.7447454e53", + "currencyAsset": "lovelace" + } + ] } diff --git a/geniusyield-dex-api/src/GeniusYield/DEX/Api/Constants.hs b/geniusyield-dex-api/src/GeniusYield/DEX/Api/Constants.hs index f66a775..cc1eaea 100644 --- a/geniusyield-dex-api/src/GeniusYield/DEX/Api/Constants.hs +++ b/geniusyield-dex-api/src/GeniusYield/DEX/Api/Constants.hs @@ -13,4 +13,4 @@ import GeniusYield.Imports ( Natural ) -- | Altering this constant will result in a modification of the -- validator address. minDeposit :: Natural -minDeposit = 2_000_000 +minDeposit = 2_100_000 diff --git a/geniusyield-dex-api/src/GeniusYield/DEX/Api/PartialOrder.hs b/geniusyield-dex-api/src/GeniusYield/DEX/Api/PartialOrder.hs index 6d8d553..7ee292b 100644 --- a/geniusyield-dex-api/src/GeniusYield/DEX/Api/PartialOrder.hs +++ b/geniusyield-dex-api/src/GeniusYield/DEX/Api/PartialOrder.hs @@ -48,28 +48,24 @@ data PartialOrderDatum = PartialOrderDatum -- ^ The asset being offered. , podOfferedOriginalAmount :: !Integer -- ^ Original number of units being offered. Initially, this would be same as `podOfferedAmount`. - , podOfferedAmount :: !Integer + , podOfferedAmount :: !Integer -- ^ The number of units being offered. - , podAskedAsset :: !Plutus.AssetClass + , podAskedAsset :: !Plutus.AssetClass -- ^ The asset being asked for as payment. - , podPrice :: !PlutusTx.Rational + , podPrice :: !PlutusTx.Rational -- ^ The price for one unit of the offered asset. - , podMinFilling :: !Integer - -- ^ Minimal number of units of the offered asset that must be paid for in a partial filling. - , podNFT :: !Plutus.TokenName + , podNFT :: !Plutus.TokenName -- ^ Token name of the NFT identifying this order. - , podStart :: !(Maybe Plutus.POSIXTime) + , podStart :: !(Maybe Plutus.POSIXTime) -- ^ The time when the order can earliest be filled (optional). - , podEnd :: !(Maybe Plutus.POSIXTime) + , podEnd :: !(Maybe Plutus.POSIXTime) -- ^ The time when the order can latest be filled (optional). - , podFee :: Integer - -- ^ Fee the filler is entitled to take. - , podPartialFills :: Integer + , podPartialFills :: !Integer -- ^ Number of partial fills order has undergone, initially would be 0. } deriving stock (Show) -PlutusTx.makeIsDataIndexed ''PartialOrderDatum [ ('PartialOrderDatum, 0) ] +PlutusTx.makeIsDataIndexed ''PartialOrderDatum [('PartialOrderDatum, 0)] -- | Exceptions raised while (partially) filling (partial) orders. data FillOrderException @@ -83,16 +79,15 @@ data FillOrderException data PodException = PodNftNotAvailable | PodNonPositiveAmount !Integer | PodNonPositivePrice !GYRational - | PodNonPositiveMinFilling !Integer | PodRequestedAmountGreaterOrEqualToOfferedAmount { poeReqAmt:: !Natural , poeOfferedAmount :: !Natural } - | PodRequestedAmountLessThanMinFilling - { poeReqAmt:: !Natural - , poeMinFilling :: !Natural - } - | PodFeeNotEnough !Integer + | PodNonDifferentAssets !GYAssetClass + -- ^ Offered asset is same as asked asset. + | PodEndEarlierThanStart + !GYTime -- ^ Start time. + !GYTime -- ^ End time. deriving stock Show deriving anyclass (Exception, IsGYApiError) @@ -132,20 +127,18 @@ data PartialOrderInfo = PartialOrderInfo -- ^ The asset being asked for as payment. , poiPrice :: !GYRational -- ^ The price for one unit of the offered asset. - , poiMinFilling :: !Natural - -- ^ Minimal number of units of the asked-for asset that must be paid in a partial filling. , poiNFT :: !GYTokenName -- ^ Token name of the NFT identifying this partial order. - , poiFeesDeposits :: !Natural - -- ^ Number of lovelace included for fees and deposits. , poiStart :: !(Maybe GYTime) -- ^ The time when the order can earliest be filled (optional). , poiEnd :: !(Maybe GYTime) -- ^ The time when the order can latest be filled (optional). - , poiFee :: !Natural - -- ^ The fee for each filling. , poiPartialFills :: !Natural -- ^ The number of past partial fills. + , poiUTxOValue :: !GYValue + -- ^ Total value in the UTxO. + , poiNFTCS :: !GYMintingPolicyId + -- ^ Caching the CS to avoid recalculating for it. } deriving stock (Show, Eq, Generic) ------------------------------------------------------------------------------- @@ -199,17 +192,13 @@ completelyFillPartialOrder poiSource = do Left orderRef -> getPartialOrderInfo orderRef Right poi -> return poi - let price = partialOrderPrice oi poiOfferedAmount - feesAndDeposits = valueFromLovelace - $ max 0 - $ toInteger poiFeesDeposits - toInteger poiFee - refScript = maybe mempty mustHaveRefInput (porValidatorRef dexPORefs) + let refScript = maybe mempty mustHaveRefInput (porValidatorRef dexPORefs) refMinting = maybe mempty mustHaveRefInput (porNftPolicyRef dexPORefs) cs <- validFillRangeConstraints poiStart poiEnd return $ mconcat [ mustHaveInput (partialOrderInfoToIn oi CompleteFill di) - , mustHaveOutput (partialOrderInfoToPayment oi $ price <> feesAndDeposits) + , mustHaveOutput (partialOrderInfoToPayment oi $ expectedValueOut oi poiOfferedAmount) , mustMint (mintingScript di) nothingRedeemer poiNFT (-1) , cs , refScript @@ -226,7 +215,7 @@ partiallyFillPartialOrder -- ^ The amount of offered tokens to buy. -> m (GYTxSkeleton PlutusV2) partiallyFillPartialOrder poiSource amt = do - di@DEXInfo{dexNftPolicy, dexPartialOrderValidator, dexPORefs} <- ask + di@DEXInfo{dexPartialOrderValidator, dexPORefs} <- ask oi@PartialOrderInfo {..} <- case poiSource of Left orderRef -> getPartialOrderInfo orderRef @@ -238,33 +227,18 @@ partiallyFillPartialOrder poiSource amt = do $ PodNonPositiveAmount $ toInteger amt when (amt >= poiOfferedAmount) . throwAppError $ PodRequestedAmountGreaterOrEqualToOfferedAmount amt poiOfferedAmount - when (amt < poiMinFilling) . throwAppError - $ PodRequestedAmountLessThanMinFilling amt poiMinFilling let od = partialOrderInfoToPartialOrderDatum oi { poiOfferedAmount = poiOfferedAmount - amt , poiPartialFills = poiPartialFills + 1 } - price = partialOrderPrice oi amt - feesAndDeposits = valueFromLovelace - $ max 0 - $ toInteger poiFeesDeposits - - toInteger (poiFee + minDeposit) - v = mconcat - [ valueSingleton poiOfferedAsset (toInteger $ poiOfferedAmount - amt) - , feesAndDeposits - , valueSingleton (GYToken (mintingPolicyId dexNftPolicy) poiNFT) 1 - ] - payment = price <> valueFromLovelace (toInteger minDeposit) - - o = mkGYTxOut outAddr v (datumFromPlutusData od) + o = mkGYTxOut outAddr (expectedValueOut oi amt) (datumFromPlutusData od) refScript = maybe mempty mustHaveRefInput (porValidatorRef dexPORefs) cs <- validFillRangeConstraints poiStart poiEnd return $ mconcat [ mustHaveInput (partialOrderInfoToIn oi (PartialFill $ toInteger amt) di) , mustHaveOutput o - , mustHaveOutput (partialOrderInfoToPayment oi payment) , cs , refScript , mustHaveRefInput (porRefNftRef dexPORefs) @@ -330,11 +304,9 @@ partialOrderInfoToPartialOrderDatum PartialOrderInfo {..} = , podOfferedAmount = fromIntegral poiOfferedAmount , podAskedAsset = assetClassToPlutus poiAskedAsset , podPrice = PlutusTx.fromGHC $ toRational poiPrice - , podMinFilling = fromIntegral poiMinFilling , podNFT = tokenNameToPlutus poiNFT , podStart = timeToPlutus <$> poiStart , podEnd = timeToPlutus <$> poiEnd - , podFee = fromIntegral poiFee , podPartialFills = fromIntegral poiPartialFills } @@ -347,16 +319,15 @@ makePartialOrderInfo -> ExceptT GYTxMonadException m PartialOrderInfo makePartialOrderInfo orderRef (_, v, PartialOrderDatum {..}) = do DEXInfo{dexNftPolicy} <- ask - addr <- addressFromPlutus' podOwnerAddr - key <- pubKeyHashFromPlutus' podOwnerKey + addr <- addressFromPlutus' podOwnerAddr + + key <- pubKeyHashFromPlutus' podOwnerKey offeredAsset <- assetClassFromPlutus' podOfferedAsset nft <- tokenNameFromPlutus' podNFT askedAsset <- assetClassFromPlutus' podAskedAsset - let price = rationalFromPlutus podPrice - feesDeposits = flip valueAssetClass GYLovelace $ v `valueMinus` - valueSingleton offeredAsset podOfferedAmount + let price = rationalFromPlutus podPrice when (price <= 0) $ throwAppError (PodNonPositivePrice price) @@ -364,9 +335,6 @@ makePartialOrderInfo orderRef (_, v, PartialOrderDatum {..}) = do when (valueAssetClass v (GYToken (mintingPolicyId dexNftPolicy) nft) /= 1) $ throwAppError PodNftNotAvailable - when (podFee < 200_000) $ - throwAppError (PodFeeNotEnough podFee) - return PartialOrderInfo { poiRef = orderRef , poiOwnerKey = key @@ -376,13 +344,12 @@ makePartialOrderInfo orderRef (_, v, PartialOrderDatum {..}) = do , poiOfferedAmount = fromInteger podOfferedAmount , poiAskedAsset = askedAsset , poiPrice = price - , poiMinFilling = fromInteger podMinFilling , poiNFT = nft - , poiFeesDeposits = fromInteger feesDeposits , poiStart = timeFromPlutus <$> podStart , poiEnd = timeFromPlutus <$> podEnd - , poiFee = fromInteger podFee , poiPartialFills = fromInteger podPartialFills + , poiUTxOValue = v + , poiNFTCS = mintingPolicyId dexNftPolicy } validFillRangeConstraints @@ -411,3 +378,12 @@ validFillRangeConstraints mstart mend = do if now <= endSlot then return $ isInvalidAfter $ min endSlot $ unsafeAdvanceSlot now 120 else throwAppError $ TooLateFill {foeEnd = endSlot, foeNow = now} + +expectedValueOut :: PartialOrderInfo -> Natural -> GYValue +expectedValueOut poi@PartialOrderInfo {..} amnt = + poiUTxOValue + <> partialOrderPrice poi amnt `valueMinus` ( valueSingleton poiOfferedAsset (toInteger amnt) + <> if poiOfferedAmount == amnt + then valueSingleton (GYToken poiNFTCS poiNFT) 1 + else mempty + ) diff --git a/geniusyield-dex-api/src/GeniusYield/DEX/Api/Types.hs b/geniusyield-dex-api/src/GeniusYield/DEX/Api/Types.hs index 0e2902b..ba63a6e 100644 --- a/geniusyield-dex-api/src/GeniusYield/DEX/Api/Types.hs +++ b/geniusyield-dex-api/src/GeniusYield/DEX/Api/Types.hs @@ -70,14 +70,14 @@ mkDEXMintingPolicy mintingPolicyRaw v = mintingPolicyFromPly $ mintingPolicyRaw # toInteger minDeposit mkDEXValidator - :: TypedScript 'ValidatorRole '[Address, AssetClass, Integer] + :: TypedScript 'ValidatorRole '[Address, AssetClass] -> Address -> GYAssetClass -> GYValidator PlutusV2 mkDEXValidator validatorRaw addr ac = validatorFromPly $ validatorRaw # addr # assetClassToPlutus ac - # fromIntegral minDeposit + mkPORefs :: GYAddress -> GYAssetClass diff --git a/geniusyield-orderbot-framework/lib-common/GeniusYield/OrderBot/Types.hs b/geniusyield-orderbot-framework/lib-common/GeniusYield/OrderBot/Types.hs index 158d1c4..9fb2759 100644 --- a/geniusyield-orderbot-framework/lib-common/GeniusYield/OrderBot/Types.hs +++ b/geniusyield-orderbot-framework/lib-common/GeniusYield/OrderBot/Types.hs @@ -15,6 +15,8 @@ module GeniusYield.OrderBot.Types , Volume (..) , Price (..) , mkOrderInfo + , isSellOrder + , isBuyOrder , mkOrderAssetPair , equivalentAssetPair , mkEquivalentAssetPair @@ -81,8 +83,8 @@ asking for another. For sell orders, where the offered asset in the DEX order is deemed to be a 'commodityAsset', there is no conversion necessary. 'volume' is simply in terms -of the offered asset amount and minFilling. Similarly, 'price' is the same as the -DEX order's price. +of the offered asset amount and the minFill is simply 1. +Similarly, 'price' is the same as the DEX order's price. But what about buy orders? These are the orders that are offering an asset which is deemed to be a 'currencyAsset'. And they are asking for an asset which is deemed @@ -93,6 +95,8 @@ In that case, the price is simply the DEX order's price but flipped (e.g x % y - The volume conversion is slightly more involved, the max volume is the DEX order's price multiplied by the DEX order's offered amount. If the result is not a whole number, it is ceiled - because more payment is always accepted, but less is not. +The min volume is just the ceiling of the price, because that's the amount of +commodity assets you would need to pay to access 1 of the offered currencyAssets. -} mkOrderInfo @@ -104,12 +108,12 @@ mkOrderInfo mkOrderInfo oap poi@PartialOrderInfo{..} = case orderType of BuyOrder -> let maxVolume = ceiling $ (toInteger poiOfferedAmount % 1) * askedPrice - minVolume = ceiling $ (toInteger poiMinFilling % 1) * askedPrice + minVolume = ceiling askedPrice in builder SBuyOrder (Volume minVolume maxVolume) $ Price (denominator askedPrice % numerator askedPrice) SellOrder -> builder SSellOrder - (Volume poiMinFilling poiOfferedAmount) $ + (Volume 1 poiOfferedAmount) $ Price askedPrice where orderType = mkOrderType poiAskedAsset oap @@ -117,6 +121,14 @@ mkOrderInfo oap poi@PartialOrderInfo{..} = case orderType of builder :: SOrderType t -> Volume -> Price -> SomeOrderInfo builder t vol price = SomeOrderInfo $ OrderInfo poiRef t oap vol price (Just poi) +isSellOrder :: OrderInfo t -> Bool +isSellOrder OrderInfo { orderType = SSellOrder} = True +isSellOrder _ = False + +isBuyOrder :: OrderInfo t -> Bool +isBuyOrder OrderInfo { orderType = SBuyOrder} = True +isBuyOrder _ = False + ------------------------------------------------------------------------------- -- Order classification components. ------------------------------------------------------------------------------- @@ -134,22 +146,12 @@ deriving stock instance Show (SOrderType t) -- Order components ------------------------------------------------------------------------------- -{- | The amount of the commodity asset (being brought or sold), represented as a -closed interval. - -This is particularly relevant for orders that support partial filling. Indeed, -for a partially fillable order, the volume is _dynamic_. It has to be _at least_ -`minFilling`, and _at most_ `offeredAmount`. - -Say a partial order selling 30 A tokens for some B tokens. The order placer has -set the `minFilling` to 10 - suggesting that anyone wishing to buy some of these -A tokens (but not all) must buy _at least_ 10 A tokens. Therefore, its A token -'Volume' is (10, 30). +{- | The amount of the commodity asset (being brought or sold), represented as +a closed interval. -For regular orders, where partial fills are not permitted, and one must buy the -whole offered amount - 'volumeMin', and 'volumeMax' are the same, equal to the -`offeredAmount`. For example, a non-partially fillable order selling 30 A tokens -for some B tokens, will have its 'Volume' set to (30, 30). +Although the contract now permits fills as low a 1 indivisible token, +the volumeMin field is still needed, because Buy orders are normalized and you +can't always fill it for 1. The amount depends on the price of the order. volumeMin should always be <= volumeMax. Users are responsible for maintaining this invariant. diff --git a/geniusyield-orderbot/src/OrderBotConfig.hs b/geniusyield-orderbot/src/OrderBotConfig.hs index 7d2cbdb..6bd1012 100644 --- a/geniusyield-orderbot/src/OrderBotConfig.hs +++ b/geniusyield-orderbot/src/OrderBotConfig.hs @@ -264,5 +264,5 @@ getDexInfo OrderBotConfig{ botCFPNftPolicy readNftPolicy = readTypedScript botCFPNftPolicy readOrderValidator - :: IO (TypedScript 'ValidatorRole '[Address, AssetClass, Integer]) + :: IO (TypedScript 'ValidatorRole '[Address, AssetClass]) readOrderValidator = readTypedScript botCFPOrderValidator diff --git a/geniusyield-orderbot/test/Main.hs b/geniusyield-orderbot/test/Main.hs index 68602a1..574388c 100644 --- a/geniusyield-orderbot/test/Main.hs +++ b/geniusyield-orderbot/test/Main.hs @@ -31,8 +31,6 @@ qcTestsForStrategy strat = testGroup (show strat) mkStrategyTest iStrat propCanExecuteFill , testProperty "Can find only Match - Price" $ propCanFindOnlyMatching iStrat genOrderInfosWrongPrices - , testProperty "Can find only Match - Volume" $ - propCanFindOnlyMatching iStrat genOrderInfosWrongVolumes ] where iStrat = mkIndependentStrategy strat 10 diff --git a/geniusyield-orderbot/test/Tests/Prop/Strategies.hs b/geniusyield-orderbot/test/Tests/Prop/Strategies.hs index b60c001..67f8e78 100644 --- a/geniusyield-orderbot/test/Tests/Prop/Strategies.hs +++ b/geniusyield-orderbot/test/Tests/Prop/Strategies.hs @@ -98,70 +98,27 @@ genOrderInfosWrongPrices = do && volumeMin (volume bOrder) <= volumeMax (volume sOrder) genBuyOrder' :: OrderAssetPair -> Gen (OrderInfo 'BuyOrder) - genBuyOrder' oap = OrderInfo <$> genGYTxOutRef - <*> pure SBuyOrder - <*> pure oap - <*> genVolume - <*> genPrice `suchThat` ((< (50%1)) . getPrice) - <*> pure Nothing + genBuyOrder' oap = do + price <- genPrice `suchThat` ((< (50%1)) . getPrice) + volume <- genVolume (ceiling $ getPrice price) + utxoRef <- genGYTxOutRef + return $ OrderInfo utxoRef SBuyOrder oap volume price Nothing genSellOrder' :: OrderAssetPair -> Gen (OrderInfo 'SellOrder) genSellOrder' oap = OrderInfo <$> genGYTxOutRef <*> pure SSellOrder <*> pure oap - <*> genVolume + <*> genVolume 1 <*> genPrice `suchThat` ((> (50%1)) . getPrice) <*> pure Nothing -{- | Generates a fixes OrderAssetPair, a list of buy and sell orders that - don't generate any matches because the volume of the buy orders - can't fill any sell order. - - And an extra buy and sell orders that can be matched togheter. --} -genOrderInfosWrongVolumes :: Gen (OrderAssetPair, [OrderInfo 'BuyOrder], [OrderInfo 'SellOrder], OrderInfo 'BuyOrder, OrderInfo 'SellOrder) -genOrderInfosWrongVolumes = do - sellOrders <- listOf1 $ genSellOrder oap - let minMinVolume = minimum $ map (volumeMin . volume) sellOrders - buyOrders <- genBuys [] minMinVolume - - newBuyOrder <- genBuyOrder oap - newSellOrder <- genSellOrder oap `suchThat` sellOrderIsProfitable newBuyOrder - return (oap, buyOrders, sellOrders, newBuyOrder, newSellOrder) - where - goldPolicyId = "ff80aaaf03a273b8f5c558168dc0e2377eea810badbae6eceefc14ef" - oap = mkOrderAssetPair GYLovelace (GYToken goldPolicyId "GOLD") - - sellOrderIsProfitable :: OrderInfo 'BuyOrder -> OrderInfo 'SellOrder -> Bool - sellOrderIsProfitable bOrder sOrder = price sOrder <= price bOrder - && volumeMin (volume sOrder) <= volumeMax (volume bOrder) - && volumeMin (volume bOrder) <= volumeMax (volume sOrder) - - genBuyOrder' :: Natural -> Gen (OrderInfo 'BuyOrder) - genBuyOrder' max = OrderInfo <$> genGYTxOutRef - <*> pure SBuyOrder - <*> pure oap - <*> genVolume' 1 (fromIntegral max) - <*> genPrice - <*> pure Nothing - - genBuys :: [OrderInfo 'BuyOrder] -> Natural -> Gen [OrderInfo 'BuyOrder] - genBuys acc 0 = return acc - genBuys acc max = do - size <- getSize - order <- genBuyOrder' max - let nMax = max - volumeMax (volume order) - if size < length acc - then return acc - else oneof [genBuys (order : acc) nMax, genBuys acc nMax] - {- | Property that checks if the sum of the offered tokens in the buy orders is less than or equal to the sum of offered tokens in the sell orders. -} propOffered :: [MatchExecutionInfo] -> Bool propOffered [] = True -propOffered xs = let buys = filter isBuyOrder xs - sells = filter isSellOrder xs +propOffered xs = let buys = filter isBuyOrderMEI xs + sells = filter isSellOrderMEI xs in sumOfOffered buys <= sumOfOffered sells {- | Property that checks if the sum of the price tokens in the buy orders is @@ -172,8 +129,8 @@ propOffered xs = let buys = filter isBuyOrder xs -} propPrice :: [MatchExecutionInfo] -> Bool propPrice [] = True -propPrice xs = let buys = filter isBuyOrder xs - sells = filter isSellOrder xs +propPrice xs = let buys = filter isBuyOrderMEI xs + sells = filter isSellOrderMEI xs in sumOfPrice buys >= sumOfPrice sells {- | Property that checks if the matches generated by the strategy can be done @@ -195,14 +152,14 @@ propCanExecuteFill = all canFill -------------------------------------------------- -- | Checks if a MatchExecutionInfo is a sell order -isSellOrder :: MatchExecutionInfo -> Bool -isSellOrder (OrderExecutionInfo _ OrderInfo {orderType = SSellOrder}) = True -isSellOrder _ = False +isSellOrderMEI :: MatchExecutionInfo -> Bool +isSellOrderMEI (OrderExecutionInfo _ OrderInfo {orderType = SSellOrder}) = True +isSellOrderMEI _ = False -- | Checks if a MatchExecutionInfo is a buy order -isBuyOrder :: MatchExecutionInfo -> Bool -isBuyOrder (OrderExecutionInfo _ OrderInfo {orderType = SBuyOrder}) = True -isBuyOrder _ = False +isBuyOrderMEI :: MatchExecutionInfo -> Bool +isBuyOrderMEI (OrderExecutionInfo _ OrderInfo {orderType = SBuyOrder}) = True +isBuyOrderMEI _ = False -- | Given a list of MatchExecutionInfo, sums the offered tokens filled sumOfOffered :: [MatchExecutionInfo] -> Natural diff --git a/geniusyield-orderbot/test/Tests/Prop/Utils.hs b/geniusyield-orderbot/test/Tests/Prop/Utils.hs index f1c673f..346f81c 100644 --- a/geniusyield-orderbot/test/Tests/Prop/Utils.hs +++ b/geniusyield-orderbot/test/Tests/Prop/Utils.hs @@ -30,11 +30,11 @@ genGYTxOutRef = do genHexString :: Gen Char genHexString = elements $ ['a'..'f'] ++ ['0'..'9'] --- | Generator for the Volume. With a fixed minVolume of 34% -genVolume :: Gen Volume -genVolume = do - vh <- chooseInteger (100,100000000) - pure $ Volume (ceiling $ (vh % 1) * (34 % 100)) (fromIntegral vh) +-- | Given a min, generate the max Volume. +genVolume :: Integer -> Gen Volume +genVolume min = do + vh <- chooseInteger (min ,100000000) + pure $ Volume (fromIntegral min) (fromIntegral vh) {- | Generator for the Volume. With a fixed minVolume of 34%. with an specified minimum and maximum. @@ -53,19 +53,18 @@ genPrice = do -- | Generator for a buy order, using all previous generators genBuyOrder :: OrderAssetPair -> Gen (OrderInfo 'BuyOrder) -genBuyOrder oap = OrderInfo <$> genGYTxOutRef - <*> pure SBuyOrder - <*> pure oap - <*> genVolume - <*> genPrice - <*> pure Nothing +genBuyOrder oap = do + price <- genPrice + volume <- genVolume (ceiling $ getPrice price) + utxoRef <- genGYTxOutRef + return $ OrderInfo utxoRef SBuyOrder oap volume price Nothing -- | Generator for a sell order, using all previous generators genSellOrder :: OrderAssetPair -> Gen (OrderInfo 'SellOrder) genSellOrder oap = OrderInfo <$> genGYTxOutRef <*> pure SSellOrder <*> pure oap - <*> genVolume + <*> genVolume 1 <*> genPrice <*> pure Nothing @@ -87,8 +86,9 @@ shrinkOrderInfo :: forall t. OrderInfo t -> [OrderInfo t] shrinkOrderInfo order = [ order { volume = vol'} | vol' <- shrinkVolume (volume order) ] --- | Shrinks a Volume by making sure the min is positive and the max is over the min +{- | Shrinks a Volume by making sure the max is over the min. + The min is fixed, so no need to shrink it. +-} shrinkVolume :: Volume -> [Volume] shrinkVolume v@Volume{volumeMin, volumeMax} = - [ v { volumeMin = vl' } | vl' <- shrinkIntegral volumeMin, vl' > 0 ] ++ - [ v { volumeMax = vh' } | vh' <- shrinkIntegral volumeMax, vh' > volumeMin ] + [ v { volumeMax = vh' } | vh' <- shrinkIntegral volumeMax, vh' >= volumeMin ] diff --git a/impl/orderbook-list/GeniusYield/OrderBot/OrderBook/List.hs b/impl/orderbook-list/GeniusYield/OrderBot/OrderBook/List.hs index 84d482e..3ee625d 100644 --- a/impl/orderbook-list/GeniusYield/OrderBot/OrderBook/List.hs +++ b/impl/orderbook-list/GeniusYield/OrderBot/OrderBook/List.hs @@ -88,6 +88,8 @@ buildOrderBookList :: [(OrderAssetPair, OrderBook)] -> (# OrderAssetPair, [OrderInfo 'BuyOrder], [OrderInfo 'SellOrder] #) -> [(OrderAssetPair, OrderBook)] +buildOrderBookList acc (# _, _, [] #) = acc +buildOrderBookList acc (# _, [], _ #) = acc buildOrderBookList acc (# oap, buyOrders, sellOrders #) = (oap, OrderBook (Orders $ sortOn price sellOrders) (Orders $ sortOn (Down . price) buyOrders)) : acc