charli3_dendrite 1.5.13.dev0__tar.gz → 1.5.14.dev0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {charli3_dendrite-1.5.13.dev0 → charli3_dendrite-1.5.14.dev0}/PKG-INFO +1 -1
- {charli3_dendrite-1.5.13.dev0 → charli3_dendrite-1.5.14.dev0}/pyproject.toml +2 -2
- {charli3_dendrite-1.5.13.dev0 → charli3_dendrite-1.5.14.dev0}/src/charli3_dendrite/dexs/amm/sundae_v4.py +307 -33
- {charli3_dendrite-1.5.13.dev0 → charli3_dendrite-1.5.14.dev0}/src/charli3_dendrite/dexs/amm/sundae_v4_deployments.json +123 -5
- {charli3_dendrite-1.5.13.dev0 → charli3_dendrite-1.5.14.dev0}/src/charli3_dendrite/dexs/core/errors.py +4 -2
- {charli3_dendrite-1.5.13.dev0 → charli3_dendrite-1.5.14.dev0}/src/charli3_dendrite/lending/fluidtokens/constants.py +7 -21
- {charli3_dendrite-1.5.13.dev0 → charli3_dendrite-1.5.14.dev0}/src/charli3_dendrite/lending/fluidtokens/datums.py +44 -20
- {charli3_dendrite-1.5.13.dev0 → charli3_dendrite-1.5.14.dev0}/src/charli3_dendrite/lending/fluidtokens/state.py +8 -1
- {charli3_dendrite-1.5.13.dev0 → charli3_dendrite-1.5.14.dev0}/src/charli3_dendrite/lending/fluidtokens/transactions/datum_synth.py +3 -16
- charli3_dendrite-1.5.14.dev0/src/charli3_dendrite/lending/fluidtokens_v4/__init__.py +1 -0
- charli3_dendrite-1.5.14.dev0/src/charli3_dendrite/lending/fluidtokens_v4/constants.py +149 -0
- charli3_dendrite-1.5.14.dev0/src/charli3_dendrite/lending/fluidtokens_v4/datums.py +250 -0
- charli3_dendrite-1.5.14.dev0/src/charli3_dendrite/lending/fluidtokens_v4/indexing.py +191 -0
- charli3_dendrite-1.5.14.dev0/src/charli3_dendrite/lending/fluidtokens_v4/loader.py +163 -0
- charli3_dendrite-1.5.14.dev0/src/charli3_dendrite/lending/fluidtokens_v4/state.py +586 -0
- charli3_dendrite-1.5.14.dev0/src/charli3_dendrite/lending/plutus.py +71 -0
- {charli3_dendrite-1.5.13.dev0 → charli3_dendrite-1.5.14.dev0}/src/charli3_dendrite/lending/units.py +15 -0
- {charli3_dendrite-1.5.13.dev0 → charli3_dendrite-1.5.14.dev0}/LICENSE +0 -0
- {charli3_dendrite-1.5.13.dev0 → charli3_dendrite-1.5.14.dev0}/README.md +0 -0
- {charli3_dendrite-1.5.13.dev0 → charli3_dendrite-1.5.14.dev0}/src/charli3_dendrite/__init__.py +0 -0
- {charli3_dendrite-1.5.13.dev0 → charli3_dendrite-1.5.14.dev0}/src/charli3_dendrite/backend/__init__.py +0 -0
- {charli3_dendrite-1.5.13.dev0 → charli3_dendrite-1.5.14.dev0}/src/charli3_dendrite/backend/backend_base.py +0 -0
- {charli3_dendrite-1.5.13.dev0 → charli3_dendrite-1.5.14.dev0}/src/charli3_dendrite/backend/blockfrost/__init__.py +0 -0
- {charli3_dendrite-1.5.13.dev0 → charli3_dendrite-1.5.14.dev0}/src/charli3_dendrite/backend/blockfrost/models.py +0 -0
- {charli3_dendrite-1.5.13.dev0 → charli3_dendrite-1.5.14.dev0}/src/charli3_dendrite/backend/dbsync/__init__.py +0 -0
- {charli3_dendrite-1.5.13.dev0 → charli3_dendrite-1.5.14.dev0}/src/charli3_dendrite/backend/dbsync/models.py +0 -0
- {charli3_dendrite-1.5.13.dev0 → charli3_dendrite-1.5.14.dev0}/src/charli3_dendrite/backend/ogmios_kupo/__init__.py +0 -0
- {charli3_dendrite-1.5.13.dev0 → charli3_dendrite-1.5.14.dev0}/src/charli3_dendrite/backend/ogmios_kupo/models.py +0 -0
- {charli3_dendrite-1.5.13.dev0 → charli3_dendrite-1.5.14.dev0}/src/charli3_dendrite/backend/utils.py +0 -0
- {charli3_dendrite-1.5.13.dev0 → charli3_dendrite-1.5.14.dev0}/src/charli3_dendrite/dataclasses/__init__.py +0 -0
- {charli3_dendrite-1.5.13.dev0 → charli3_dendrite-1.5.14.dev0}/src/charli3_dendrite/dataclasses/datums.py +0 -0
- {charli3_dendrite-1.5.13.dev0 → charli3_dendrite-1.5.14.dev0}/src/charli3_dendrite/dataclasses/models.py +0 -0
- {charli3_dendrite-1.5.13.dev0 → charli3_dendrite-1.5.14.dev0}/src/charli3_dendrite/dexs/__init__.py +0 -0
- {charli3_dendrite-1.5.13.dev0 → charli3_dendrite-1.5.14.dev0}/src/charli3_dendrite/dexs/amm/__init__.py +0 -0
- {charli3_dendrite-1.5.13.dev0 → charli3_dendrite-1.5.14.dev0}/src/charli3_dendrite/dexs/amm/amm_base.py +0 -0
- {charli3_dendrite-1.5.13.dev0 → charli3_dendrite-1.5.14.dev0}/src/charli3_dendrite/dexs/amm/amm_types.py +0 -0
- {charli3_dendrite-1.5.13.dev0 → charli3_dendrite-1.5.14.dev0}/src/charli3_dendrite/dexs/amm/cswap.py +0 -0
- {charli3_dendrite-1.5.13.dev0 → charli3_dendrite-1.5.14.dev0}/src/charli3_dendrite/dexs/amm/dano.py +0 -0
- {charli3_dendrite-1.5.13.dev0 → charli3_dendrite-1.5.14.dev0}/src/charli3_dendrite/dexs/amm/minswap.py +0 -0
- {charli3_dendrite-1.5.13.dev0 → charli3_dendrite-1.5.14.dev0}/src/charli3_dendrite/dexs/amm/muesli.py +0 -0
- {charli3_dendrite-1.5.13.dev0 → charli3_dendrite-1.5.14.dev0}/src/charli3_dendrite/dexs/amm/multi_asset.py +0 -0
- {charli3_dendrite-1.5.13.dev0 → charli3_dendrite-1.5.14.dev0}/src/charli3_dendrite/dexs/amm/spectrum.py +0 -0
- {charli3_dendrite-1.5.13.dev0 → charli3_dendrite-1.5.14.dev0}/src/charli3_dendrite/dexs/amm/splash.py +0 -0
- {charli3_dendrite-1.5.13.dev0 → charli3_dendrite-1.5.14.dev0}/src/charli3_dendrite/dexs/amm/sundae.py +0 -0
- {charli3_dendrite-1.5.13.dev0 → charli3_dendrite-1.5.14.dev0}/src/charli3_dendrite/dexs/amm/vyfi.py +0 -0
- {charli3_dendrite-1.5.13.dev0 → charli3_dendrite-1.5.14.dev0}/src/charli3_dendrite/dexs/amm/wingriders.py +0 -0
- {charli3_dendrite-1.5.13.dev0 → charli3_dendrite-1.5.14.dev0}/src/charli3_dendrite/dexs/core/__init__.py +0 -0
- {charli3_dendrite-1.5.13.dev0 → charli3_dendrite-1.5.14.dev0}/src/charli3_dendrite/dexs/core/base.py +0 -0
- {charli3_dendrite-1.5.13.dev0 → charli3_dendrite-1.5.14.dev0}/src/charli3_dendrite/dexs/ob/__init__.py +0 -0
- {charli3_dendrite-1.5.13.dev0 → charli3_dendrite-1.5.14.dev0}/src/charli3_dendrite/dexs/ob/axo.py +0 -0
- {charli3_dendrite-1.5.13.dev0 → charli3_dendrite-1.5.14.dev0}/src/charli3_dendrite/dexs/ob/cardanoswaps.py +0 -0
- {charli3_dendrite-1.5.13.dev0 → charli3_dendrite-1.5.14.dev0}/src/charli3_dendrite/dexs/ob/chadswap.py +0 -0
- {charli3_dendrite-1.5.13.dev0 → charli3_dendrite-1.5.14.dev0}/src/charli3_dendrite/dexs/ob/djed.py +0 -0
- {charli3_dendrite-1.5.13.dev0 → charli3_dendrite-1.5.14.dev0}/src/charli3_dendrite/dexs/ob/geniusyield.py +0 -0
- {charli3_dendrite-1.5.13.dev0 → charli3_dendrite-1.5.14.dev0}/src/charli3_dendrite/dexs/ob/ob_base.py +0 -0
- {charli3_dendrite-1.5.13.dev0 → charli3_dendrite-1.5.14.dev0}/src/charli3_dendrite/dexs/ob/saturnswap.py +0 -0
- {charli3_dendrite-1.5.13.dev0 → charli3_dendrite-1.5.14.dev0}/src/charli3_dendrite/lending/__init__.py +0 -0
- {charli3_dendrite-1.5.13.dev0 → charli3_dendrite-1.5.14.dev0}/src/charli3_dendrite/lending/base.py +0 -0
- {charli3_dendrite-1.5.13.dev0 → charli3_dendrite-1.5.14.dev0}/src/charli3_dendrite/lending/danogo/__init__.py +0 -0
- {charli3_dendrite-1.5.13.dev0 → charli3_dendrite-1.5.14.dev0}/src/charli3_dendrite/lending/danogo/constants.py +0 -0
- {charli3_dendrite-1.5.13.dev0 → charli3_dendrite-1.5.14.dev0}/src/charli3_dendrite/lending/danogo/datums.py +0 -0
- {charli3_dendrite-1.5.13.dev0 → charli3_dendrite-1.5.14.dev0}/src/charli3_dendrite/lending/danogo/loader.py +0 -0
- {charli3_dendrite-1.5.13.dev0 → charli3_dendrite-1.5.14.dev0}/src/charli3_dendrite/lending/danogo/market.py +0 -0
- {charli3_dendrite-1.5.13.dev0 → charli3_dendrite-1.5.14.dev0}/src/charli3_dendrite/lending/danogo/math.py +0 -0
- {charli3_dendrite-1.5.13.dev0 → charli3_dendrite-1.5.14.dev0}/src/charli3_dendrite/lending/danogo/oracles/__init__.py +0 -0
- {charli3_dendrite-1.5.13.dev0 → charli3_dendrite-1.5.14.dev0}/src/charli3_dendrite/lending/danogo/oracles/aggregator.py +0 -0
- {charli3_dendrite-1.5.13.dev0 → charli3_dendrite-1.5.14.dev0}/src/charli3_dendrite/lending/danogo/oracles/aggregator_datums.py +0 -0
- {charli3_dendrite-1.5.13.dev0 → charli3_dendrite-1.5.14.dev0}/src/charli3_dendrite/lending/danogo/oracles/deployments.py +0 -0
- {charli3_dendrite-1.5.13.dev0 → charli3_dendrite-1.5.14.dev0}/src/charli3_dendrite/lending/danogo/oracles/forward.py +0 -0
- {charli3_dendrite-1.5.13.dev0 → charli3_dendrite-1.5.14.dev0}/src/charli3_dendrite/lending/danogo/oracles/leaves.py +0 -0
- {charli3_dendrite-1.5.13.dev0 → charli3_dendrite-1.5.14.dev0}/src/charli3_dendrite/lending/danogo/oracles/locator.py +0 -0
- {charli3_dendrite-1.5.13.dev0 → charli3_dendrite-1.5.14.dev0}/src/charli3_dendrite/lending/danogo/oracles/lp_pricing.py +0 -0
- {charli3_dendrite-1.5.13.dev0 → charli3_dendrite-1.5.14.dev0}/src/charli3_dendrite/lending/danogo/oracles/recipes.json +0 -0
- {charli3_dendrite-1.5.13.dev0 → charli3_dendrite-1.5.14.dev0}/src/charli3_dendrite/lending/danogo/oracles/redeemer.py +0 -0
- {charli3_dendrite-1.5.13.dev0 → charli3_dendrite-1.5.14.dev0}/src/charli3_dendrite/lending/danogo/oracles/reproduce.py +0 -0
- {charli3_dendrite-1.5.13.dev0 → charli3_dendrite-1.5.14.dev0}/src/charli3_dendrite/lending/danogo/oracles/structured_datums.py +0 -0
- {charli3_dendrite-1.5.13.dev0 → charli3_dendrite-1.5.14.dev0}/src/charli3_dendrite/lending/danogo/state.py +0 -0
- {charli3_dendrite-1.5.13.dev0 → charli3_dendrite-1.5.14.dev0}/src/charli3_dendrite/lending/danogo/transactions/__init__.py +0 -0
- {charli3_dendrite-1.5.13.dev0 → charli3_dendrite-1.5.14.dev0}/src/charli3_dendrite/lending/danogo/transactions/_common.py +0 -0
- {charli3_dendrite-1.5.13.dev0 → charli3_dendrite-1.5.14.dev0}/src/charli3_dendrite/lending/danogo/transactions/build.py +0 -0
- {charli3_dendrite-1.5.13.dev0 → charli3_dendrite-1.5.14.dev0}/src/charli3_dendrite/lending/danogo/transactions/builder.py +0 -0
- {charli3_dendrite-1.5.13.dev0 → charli3_dendrite-1.5.14.dev0}/src/charli3_dendrite/lending/danogo/transactions/context.py +0 -0
- {charli3_dendrite-1.5.13.dev0 → charli3_dendrite-1.5.14.dev0}/src/charli3_dendrite/lending/danogo/transactions/create_loan.py +0 -0
- {charli3_dendrite-1.5.13.dev0 → charli3_dendrite-1.5.14.dev0}/src/charli3_dendrite/lending/danogo/transactions/datum_synth.py +0 -0
- {charli3_dendrite-1.5.13.dev0 → charli3_dendrite-1.5.14.dev0}/src/charli3_dendrite/lending/danogo/transactions/increase_loan.py +0 -0
- {charli3_dendrite-1.5.13.dev0 → charli3_dendrite-1.5.14.dev0}/src/charli3_dendrite/lending/danogo/transactions/loan_ids.py +0 -0
- {charli3_dendrite-1.5.13.dev0 → charli3_dendrite-1.5.14.dev0}/src/charli3_dendrite/lending/danogo/transactions/modify_collateral.py +0 -0
- {charli3_dendrite-1.5.13.dev0 → charli3_dendrite-1.5.14.dev0}/src/charli3_dendrite/lending/danogo/transactions/oracle_redeemer.py +0 -0
- {charli3_dendrite-1.5.13.dev0 → charli3_dendrite-1.5.14.dev0}/src/charli3_dendrite/lending/danogo/transactions/oracle_synth.py +0 -0
- {charli3_dendrite-1.5.13.dev0 → charli3_dendrite-1.5.14.dev0}/src/charli3_dendrite/lending/danogo/transactions/redeemers.py +0 -0
- {charli3_dendrite-1.5.13.dev0 → charli3_dendrite-1.5.14.dev0}/src/charli3_dendrite/lending/danogo/transactions/repay.py +0 -0
- {charli3_dendrite-1.5.13.dev0 → charli3_dendrite-1.5.14.dev0}/src/charli3_dendrite/lending/danogo/transactions/topup_withdraw.py +0 -0
- {charli3_dendrite-1.5.13.dev0 → charli3_dendrite-1.5.14.dev0}/src/charli3_dendrite/lending/danogo/transactions/verify.py +0 -0
- {charli3_dendrite-1.5.13.dev0 → charli3_dendrite-1.5.14.dev0}/src/charli3_dendrite/lending/fluidtokens/__init__.py +0 -0
- {charli3_dendrite-1.5.13.dev0 → charli3_dendrite-1.5.14.dev0}/src/charli3_dendrite/lending/fluidtokens/loader.py +0 -0
- {charli3_dendrite-1.5.13.dev0 → charli3_dendrite-1.5.14.dev0}/src/charli3_dendrite/lending/fluidtokens/market.py +0 -0
- {charli3_dendrite-1.5.13.dev0 → charli3_dendrite-1.5.14.dev0}/src/charli3_dendrite/lending/fluidtokens/math.py +0 -0
- {charli3_dendrite-1.5.13.dev0 → charli3_dendrite-1.5.14.dev0}/src/charli3_dendrite/lending/fluidtokens/oracles/__init__.py +0 -0
- {charli3_dendrite-1.5.13.dev0 → charli3_dendrite-1.5.14.dev0}/src/charli3_dendrite/lending/fluidtokens/oracles/feeds.py +0 -0
- {charli3_dendrite-1.5.13.dev0 → charli3_dendrite-1.5.14.dev0}/src/charli3_dendrite/lending/fluidtokens/oracles/fluid_api.py +0 -0
- {charli3_dendrite-1.5.13.dev0 → charli3_dendrite-1.5.14.dev0}/src/charli3_dendrite/lending/fluidtokens/oracles/witness.py +0 -0
- {charli3_dendrite-1.5.13.dev0 → charli3_dendrite-1.5.14.dev0}/src/charli3_dendrite/lending/fluidtokens/transactions/__init__.py +0 -0
- {charli3_dendrite-1.5.13.dev0 → charli3_dendrite-1.5.14.dev0}/src/charli3_dendrite/lending/fluidtokens/transactions/_common.py +0 -0
- {charli3_dendrite-1.5.13.dev0 → charli3_dendrite-1.5.14.dev0}/src/charli3_dendrite/lending/fluidtokens/transactions/borrow.py +0 -0
- {charli3_dendrite-1.5.13.dev0 → charli3_dendrite-1.5.14.dev0}/src/charli3_dendrite/lending/fluidtokens/transactions/builder.py +0 -0
- {charli3_dendrite-1.5.13.dev0 → charli3_dendrite-1.5.14.dev0}/src/charli3_dendrite/lending/fluidtokens/transactions/change_collateral.py +0 -0
- {charli3_dendrite-1.5.13.dev0 → charli3_dendrite-1.5.14.dev0}/src/charli3_dendrite/lending/fluidtokens/transactions/context.py +0 -0
- {charli3_dendrite-1.5.13.dev0 → charli3_dendrite-1.5.14.dev0}/src/charli3_dendrite/lending/fluidtokens/transactions/lend.py +0 -0
- {charli3_dendrite-1.5.13.dev0 → charli3_dendrite-1.5.14.dev0}/src/charli3_dendrite/lending/fluidtokens/transactions/pool.py +0 -0
- {charli3_dendrite-1.5.13.dev0 → charli3_dendrite-1.5.14.dev0}/src/charli3_dendrite/lending/fluidtokens/transactions/recast.py +0 -0
- {charli3_dendrite-1.5.13.dev0 → charli3_dendrite-1.5.14.dev0}/src/charli3_dendrite/lending/fluidtokens/transactions/redeemers.py +0 -0
- {charli3_dendrite-1.5.13.dev0 → charli3_dendrite-1.5.14.dev0}/src/charli3_dendrite/lending/fluidtokens/transactions/repay.py +0 -0
- {charli3_dendrite-1.5.13.dev0 → charli3_dendrite-1.5.14.dev0}/src/charli3_dendrite/lending/fluidtokens/transactions/request.py +0 -0
- {charli3_dendrite-1.5.13.dev0 → charli3_dendrite-1.5.14.dev0}/src/charli3_dendrite/lending/fluidtokens/transactions/resolve.py +0 -0
- {charli3_dendrite-1.5.13.dev0 → charli3_dendrite-1.5.14.dev0}/src/charli3_dendrite/lending/math.py +0 -0
- {charli3_dendrite-1.5.13.dev0 → charli3_dendrite-1.5.14.dev0}/src/charli3_dendrite/lending/oracles/__init__.py +0 -0
- {charli3_dendrite-1.5.13.dev0 → charli3_dendrite-1.5.14.dev0}/src/charli3_dendrite/lending/oracles/charli3.py +0 -0
- {charli3_dendrite-1.5.13.dev0 → charli3_dendrite-1.5.14.dev0}/src/charli3_dendrite/lending/oracles/dex_pooled.py +0 -0
- {charli3_dendrite-1.5.13.dev0 → charli3_dendrite-1.5.14.dev0}/src/charli3_dendrite/lending/oracles/fluid.py +0 -0
- {charli3_dendrite-1.5.13.dev0 → charli3_dendrite-1.5.14.dev0}/src/charli3_dendrite/lending/oracles/models.py +0 -0
- {charli3_dendrite-1.5.13.dev0 → charli3_dendrite-1.5.14.dev0}/src/charli3_dendrite/lending/oracles/orcfax.py +0 -0
- {charli3_dendrite-1.5.13.dev0 → charli3_dendrite-1.5.14.dev0}/src/charli3_dendrite/lending/oracles/qtoken.py +0 -0
- {charli3_dendrite-1.5.13.dev0 → charli3_dendrite-1.5.14.dev0}/src/charli3_dendrite/lending/registry.py +0 -0
- {charli3_dendrite-1.5.13.dev0 → charli3_dendrite-1.5.14.dev0}/src/charli3_dendrite/lending/transactions/__init__.py +0 -0
- {charli3_dendrite-1.5.13.dev0 → charli3_dendrite-1.5.14.dev0}/src/charli3_dendrite/lending/transactions/base.py +0 -0
- {charli3_dendrite-1.5.13.dev0 → charli3_dendrite-1.5.14.dev0}/src/charli3_dendrite/lending/transactions/infra.py +0 -0
- {charli3_dendrite-1.5.13.dev0 → charli3_dendrite-1.5.14.dev0}/src/charli3_dendrite/lending/transactions/snapshot.py +0 -0
- {charli3_dendrite-1.5.13.dev0 → charli3_dendrite-1.5.14.dev0}/src/charli3_dendrite/utility.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "charli3_dendrite"
|
|
3
|
-
version = "1.5.
|
|
3
|
+
version = "1.5.14-dev0"
|
|
4
4
|
description = ""
|
|
5
5
|
authors = ["Elder Millenial <eldermillenial@protonmail.com>"]
|
|
6
6
|
readme = "README.md"
|
|
@@ -50,7 +50,7 @@ module = ["pycardano", "pycardano.*", "dotenv", "nox", "uplc", "uplc.*"]
|
|
|
50
50
|
ignore_missing_imports = true
|
|
51
51
|
|
|
52
52
|
[tool.bumpversion]
|
|
53
|
-
current_version = "1.5.
|
|
53
|
+
current_version = "1.5.14-dev0"
|
|
54
54
|
parse = """(?x)
|
|
55
55
|
(?P<major>\\d+)\\.
|
|
56
56
|
(?P<minor>\\d+)\\.
|
|
@@ -62,6 +62,8 @@ import functools
|
|
|
62
62
|
import hashlib
|
|
63
63
|
import importlib.resources
|
|
64
64
|
import json
|
|
65
|
+
import logging
|
|
66
|
+
import time
|
|
65
67
|
from dataclasses import dataclass
|
|
66
68
|
from enum import IntEnum
|
|
67
69
|
from typing import TYPE_CHECKING
|
|
@@ -90,10 +92,13 @@ from pydantic import model_validator
|
|
|
90
92
|
|
|
91
93
|
from charli3_dendrite.backend import get_backend
|
|
92
94
|
from charli3_dendrite.dataclasses.datums import AssetClass
|
|
95
|
+
from charli3_dendrite.dataclasses.datums import OrderDatum
|
|
93
96
|
from charli3_dendrite.dataclasses.datums import PlutusFullAddress
|
|
94
97
|
from charli3_dendrite.dataclasses.models import Assets
|
|
95
98
|
from charli3_dendrite.dataclasses.models import DendriteBaseModel
|
|
99
|
+
from charli3_dendrite.dataclasses.models import OrderType
|
|
96
100
|
from charli3_dendrite.dataclasses.models import PoolSelector
|
|
101
|
+
from charli3_dendrite.dataclasses.models import RedeemerRecord
|
|
97
102
|
from charli3_dendrite.dexs.amm.multi_asset import AbstractMultiAssetPoolState
|
|
98
103
|
from charli3_dendrite.dexs.core.errors import InvalidPoolError
|
|
99
104
|
from charli3_dendrite.dexs.core.errors import ModuleConfigUnavailableError
|
|
@@ -420,7 +425,7 @@ PoolRedeemer = Union[EscapeHatch, Upgrade, EmergencyDisable, PoolAction, Destroy
|
|
|
420
425
|
|
|
421
426
|
|
|
422
427
|
@dataclass
|
|
423
|
-
class SundaeV4OrderDatum(
|
|
428
|
+
class SundaeV4OrderDatum(OrderDatum):
|
|
424
429
|
"""An order's constraints (constructor 0); never an executed trade.
|
|
425
430
|
|
|
426
431
|
This models the *deployed* order datum, which carries seven fields. An order
|
|
@@ -460,6 +465,13 @@ class SundaeV4OrderDatum(PlutusData):
|
|
|
460
465
|
modelled as a CBOR array, which matches the deployed modular-order shape; an
|
|
461
466
|
order whose ``constraints`` body were instead a non-list ``Data`` value would
|
|
462
467
|
need this field relaxed to :class:`~pycardano.RawPlutusData`.
|
|
468
|
+
|
|
469
|
+
Implements dendrite's :class:`~charli3_dendrite.dataclasses.datums.OrderDatum`
|
|
470
|
+
interface: :meth:`basic_constraint` and :meth:`is_strategy` identify a
|
|
471
|
+
``constraints`` entry by its module-hash KEY (never by payload shape — a
|
|
472
|
+
:class:`StrategyConstraint` and a :class:`BasicDeposit` are both
|
|
473
|
+
constructor 0 with two fields), and :meth:`order_type`,
|
|
474
|
+
:meth:`requested_amount`, :meth:`address_source` build on that.
|
|
463
475
|
"""
|
|
464
476
|
|
|
465
477
|
CONSTR_ID = 0
|
|
@@ -471,6 +483,83 @@ class SundaeV4OrderDatum(PlutusData):
|
|
|
471
483
|
constraints: IndefiniteList
|
|
472
484
|
extension: RawPlutusData
|
|
473
485
|
|
|
486
|
+
def basic_constraint(self) -> BasicConstraint | None:
|
|
487
|
+
"""This order's basic-order constraint payload, if it carries one.
|
|
488
|
+
|
|
489
|
+
Identified by KEY: the ``constraints`` entry whose module hash is the
|
|
490
|
+
``basic_order.withdraw`` hash of any deployed network.
|
|
491
|
+
"""
|
|
492
|
+
for entry in _list_items(self.constraints):
|
|
493
|
+
key, payload = _list_items(entry)
|
|
494
|
+
if bytes(key) in _BASIC_ORDER_HASHES:
|
|
495
|
+
return parse_basic_constraint(payload)
|
|
496
|
+
return None
|
|
497
|
+
|
|
498
|
+
def is_strategy(self) -> bool:
|
|
499
|
+
"""Whether this order carries the strategy-order constraint, by KEY."""
|
|
500
|
+
return any(
|
|
501
|
+
bytes(_list_items(entry)[0]) in _STRATEGY_ORDER_HASHES
|
|
502
|
+
for entry in _list_items(self.constraints)
|
|
503
|
+
)
|
|
504
|
+
|
|
505
|
+
def order_type(self) -> OrderType:
|
|
506
|
+
"""The dendrite order kind.
|
|
507
|
+
|
|
508
|
+
A basic deposit/withdraw maps directly; a basic swap or claim, and
|
|
509
|
+
every strategy order (its signed executions are the actual swaps),
|
|
510
|
+
map to ``swap``.
|
|
511
|
+
|
|
512
|
+
Raises:
|
|
513
|
+
ValueError: no recognised basic or strategy constraint is present.
|
|
514
|
+
"""
|
|
515
|
+
basic = self.basic_constraint()
|
|
516
|
+
if isinstance(basic, BasicDeposit):
|
|
517
|
+
return OrderType.deposit
|
|
518
|
+
if isinstance(basic, BasicWithdraw):
|
|
519
|
+
return OrderType.withdraw
|
|
520
|
+
if isinstance(basic, (BasicSwap, BasicClaim)):
|
|
521
|
+
return OrderType.swap
|
|
522
|
+
if self.is_strategy():
|
|
523
|
+
return OrderType.swap
|
|
524
|
+
msg = "SundaeV4OrderDatum: no recognised basic or strategy constraint."
|
|
525
|
+
raise ValueError(msg)
|
|
526
|
+
|
|
527
|
+
def requested_amount(self) -> Assets:
|
|
528
|
+
"""The floor this order requires.
|
|
529
|
+
|
|
530
|
+
A basic order's ``min_received`` as dendrite :class:`Assets`. A
|
|
531
|
+
strategy order commits to no floor in its datum — its signed
|
|
532
|
+
executions carry the floor per fill — so it requests the empty
|
|
533
|
+
``Assets``.
|
|
534
|
+
|
|
535
|
+
Raises:
|
|
536
|
+
ValueError: no recognised basic or strategy constraint is present.
|
|
537
|
+
"""
|
|
538
|
+
basic = self.basic_constraint()
|
|
539
|
+
if basic is not None:
|
|
540
|
+
out: dict[str, int] = {}
|
|
541
|
+
for entry in _list_items(basic.min_received):
|
|
542
|
+
asset_class, amount = _list_items(entry)
|
|
543
|
+
unit = _reserve_unit(AssetClass.from_primitive(asset_class))
|
|
544
|
+
out[unit] = int(amount)
|
|
545
|
+
return Assets(**out)
|
|
546
|
+
if self.is_strategy():
|
|
547
|
+
return Assets({})
|
|
548
|
+
msg = "SundaeV4OrderDatum: no recognised basic or strategy constraint."
|
|
549
|
+
raise ValueError(msg)
|
|
550
|
+
|
|
551
|
+
def address_source(self) -> Address | None:
|
|
552
|
+
"""The order's own source address, if the datum names one.
|
|
553
|
+
|
|
554
|
+
A :class:`DestinationFixed` resolves to its destination address. A
|
|
555
|
+
:class:`DestinationSelf` continuation pays back to the order's own
|
|
556
|
+
script address rather than a wallet, so it has no source address and
|
|
557
|
+
returns ``None``.
|
|
558
|
+
"""
|
|
559
|
+
if isinstance(self.destination, DestinationFixed):
|
|
560
|
+
return self.destination.address.to_address()
|
|
561
|
+
return None
|
|
562
|
+
|
|
474
563
|
|
|
475
564
|
@dataclass
|
|
476
565
|
class SwapConstraint(PlutusData):
|
|
@@ -1310,6 +1399,12 @@ _DEPLOYMENTS_RESOURCE = "sundae_v4_deployments.json"
|
|
|
1310
1399
|
# payout output and is returned with the fill (or the cancel).
|
|
1311
1400
|
_ORDER_RIDER = 2_000_000
|
|
1312
1401
|
|
|
1402
|
+
# How long a live (or fallback) SundaeV4Vault.base_fee() reading is cached, per
|
|
1403
|
+
# network, before the fee-settings node is read again.
|
|
1404
|
+
_BASE_FEE_TTL_S = 300
|
|
1405
|
+
|
|
1406
|
+
_logger = logging.getLogger(__name__)
|
|
1407
|
+
|
|
1313
1408
|
|
|
1314
1409
|
@functools.lru_cache(maxsize=1)
|
|
1315
1410
|
def _load_deployments() -> dict[str, Any]:
|
|
@@ -1318,6 +1413,26 @@ def _load_deployments() -> dict[str, Any]:
|
|
|
1318
1413
|
return {key: value for key, value in data.items() if not key.startswith("_")}
|
|
1319
1414
|
|
|
1320
1415
|
|
|
1416
|
+
def _validator_hashes(title: str) -> frozenset[bytes]:
|
|
1417
|
+
"""The applied hash of the validator ``title`` on every deployed network.
|
|
1418
|
+
|
|
1419
|
+
Used to identify an order datum's constraint entries by KEY rather than by
|
|
1420
|
+
network, so decoding one is network-independent.
|
|
1421
|
+
"""
|
|
1422
|
+
return frozenset(
|
|
1423
|
+
bytes.fromhex(data["validators"][title])
|
|
1424
|
+
for data in _load_deployments().values()
|
|
1425
|
+
)
|
|
1426
|
+
|
|
1427
|
+
|
|
1428
|
+
# The basic-order / strategy-order constraint module hashes across every
|
|
1429
|
+
# deployed network: an order datum's constraint KEY is checked against these,
|
|
1430
|
+
# never against the class family's currently selected deployment, so decoding
|
|
1431
|
+
# a recorded order never depends on which network is selected.
|
|
1432
|
+
_BASIC_ORDER_HASHES: frozenset[bytes] = _validator_hashes("basic_order.withdraw")
|
|
1433
|
+
_STRATEGY_ORDER_HASHES: frozenset[bytes] = _validator_hashes("strategy_order.withdraw")
|
|
1434
|
+
|
|
1435
|
+
|
|
1321
1436
|
@dataclass(frozen=True)
|
|
1322
1437
|
class SundaeV4Deployment:
|
|
1323
1438
|
"""The applied V4 deployment on one Cardano network.
|
|
@@ -1326,7 +1441,10 @@ class SundaeV4Deployment:
|
|
|
1326
1441
|
``basic_order.withdraw``, ...) to its applied script hash; ``references``
|
|
1327
1442
|
maps the same titles to the published reference-script UTxO; ``settings``
|
|
1328
1443
|
maps a settings-node label (``basic-order``, ``strategy-order``,
|
|
1329
|
-
``cs-pool``, ``fee-settings``,
|
|
1444
|
+
``cs-pool``, ``fee-settings``, ``migration-authority``, ``stake-list``,
|
|
1445
|
+
...) to its UTxO and decoded values. A network whose API lists more than
|
|
1446
|
+
one node under the same label stores the duplicate under ``<label>#2``
|
|
1447
|
+
(mainnet's two ``cs-pool`` nodes are ``cs-pool`` and ``cs-pool#2``).
|
|
1330
1448
|
"""
|
|
1331
1449
|
|
|
1332
1450
|
network: str
|
|
@@ -1423,9 +1541,20 @@ class SundaeV4Deployment:
|
|
|
1423
1541
|
"""The order-config token a strategy order binds (``[strategy_order, fee]``)."""
|
|
1424
1542
|
return self.config_token("strategy-order")
|
|
1425
1543
|
|
|
1544
|
+
@property
|
|
1545
|
+
def fee_settings_unit(self) -> str:
|
|
1546
|
+
"""The dendrite unit of the fee-settings node's token."""
|
|
1547
|
+
return self.settings_policy.hex() + self.settings["fee-settings"]["token"]
|
|
1548
|
+
|
|
1426
1549
|
@property
|
|
1427
1550
|
def base_fee(self) -> int:
|
|
1428
|
-
"""The flat service fee (lovelace)
|
|
1551
|
+
"""The manifest-snapshot flat service fee (lovelace) per order execution.
|
|
1552
|
+
|
|
1553
|
+
This is the value captured in the manifest at build time, not a live
|
|
1554
|
+
read; a governance change to the fee-settings node would leave it
|
|
1555
|
+
stale. For the current on-chain value, see :meth:`SundaeV4Vault.base_fee`,
|
|
1556
|
+
which reads the fee-settings node and falls back to this snapshot.
|
|
1557
|
+
"""
|
|
1429
1558
|
return int(self.settings["fee-settings"]["base_fee"])
|
|
1430
1559
|
|
|
1431
1560
|
@property
|
|
@@ -1449,6 +1578,14 @@ class SundaeV4Deployment:
|
|
|
1449
1578
|
network=self.cardano_network,
|
|
1450
1579
|
)
|
|
1451
1580
|
|
|
1581
|
+
@property
|
|
1582
|
+
def settings_address(self) -> Address:
|
|
1583
|
+
"""The settings validator address (enterprise) holding the settings nodes."""
|
|
1584
|
+
return Address(
|
|
1585
|
+
payment_part=ScriptHash(self.validator("settings.spend")),
|
|
1586
|
+
network=self.cardano_network,
|
|
1587
|
+
)
|
|
1588
|
+
|
|
1452
1589
|
|
|
1453
1590
|
INVARIANT_MODULE_KINDS: frozenset[str] = frozenset(
|
|
1454
1591
|
{"constant_sum", "constant_product", "concentrated_liquidity"},
|
|
@@ -1514,6 +1651,29 @@ def _config_candidates(data_cbor: str, kind: str | None) -> list[Any]:
|
|
|
1514
1651
|
return candidates
|
|
1515
1652
|
|
|
1516
1653
|
|
|
1654
|
+
def _matching_config(
|
|
1655
|
+
records: list[RedeemerRecord],
|
|
1656
|
+
module_hash: bytes,
|
|
1657
|
+
kind: str | None,
|
|
1658
|
+
commitment: bytes,
|
|
1659
|
+
) -> Any | None: # noqa: ANN401
|
|
1660
|
+
"""The first config among ``records`` for ``module_hash`` hashing to ``commitment``.
|
|
1661
|
+
|
|
1662
|
+
Shared by both legs of :meth:`SundaeV4Vault._resolve_from_backend`: the
|
|
1663
|
+
producing transaction's own redeemers and, failing that, each past
|
|
1664
|
+
transaction's redeemers visited while walking the pool NFT's history.
|
|
1665
|
+
"""
|
|
1666
|
+
for record in records:
|
|
1667
|
+
if not record.script_hash:
|
|
1668
|
+
continue
|
|
1669
|
+
if bytes.fromhex(record.script_hash) != module_hash:
|
|
1670
|
+
continue
|
|
1671
|
+
for candidate in _config_candidates(record.data_cbor, kind):
|
|
1672
|
+
if module_config_hash(candidate) == commitment:
|
|
1673
|
+
return candidate
|
|
1674
|
+
return None
|
|
1675
|
+
|
|
1676
|
+
|
|
1517
1677
|
class SundaeV4Vault(DendriteBaseModel):
|
|
1518
1678
|
"""A SundaeSwap V4 pool UTxO: the N-asset vault every pool type is bound to.
|
|
1519
1679
|
|
|
@@ -1557,9 +1717,10 @@ class SundaeV4Vault(DendriteBaseModel):
|
|
|
1557
1717
|
module_configs: dict[bytes, Any] = Field(default_factory=dict)
|
|
1558
1718
|
|
|
1559
1719
|
_deployment: ClassVar[SundaeV4Deployment] = SundaeV4Deployment.for_network(
|
|
1560
|
-
"
|
|
1720
|
+
"mainnet",
|
|
1561
1721
|
)
|
|
1562
1722
|
_config_cache: ClassVar[dict[bytes, Any]] = {}
|
|
1723
|
+
_base_fee_cache: ClassVar[dict[str, tuple[int, float]]] = {}
|
|
1563
1724
|
_datum: SundaeV4PoolDatum | None = PrivateAttr(default=None)
|
|
1564
1725
|
|
|
1565
1726
|
# -- class family ---------------------------------------------------------
|
|
@@ -1574,6 +1735,60 @@ class SundaeV4Vault(DendriteBaseModel):
|
|
|
1574
1735
|
"""The deployment the class family currently targets."""
|
|
1575
1736
|
return cls._deployment
|
|
1576
1737
|
|
|
1738
|
+
@classmethod
|
|
1739
|
+
def clear_base_fee_cache(cls) -> None:
|
|
1740
|
+
"""Drop every cached live (or fallback) base-fee reading."""
|
|
1741
|
+
SundaeV4Vault._base_fee_cache.clear()
|
|
1742
|
+
|
|
1743
|
+
@classmethod
|
|
1744
|
+
def base_fee(cls) -> int:
|
|
1745
|
+
"""The live per-execution base fee, manifest snapshot as the fallback.
|
|
1746
|
+
|
|
1747
|
+
Reads the deployment's fee-settings node (an unspent UTxO at
|
|
1748
|
+
:attr:`SundaeV4Deployment.settings_address` holding
|
|
1749
|
+
:attr:`SundaeV4Deployment.fee_settings_unit`) through the active
|
|
1750
|
+
backend and decodes its :class:`FeeSettings.base_fee`, so a governance
|
|
1751
|
+
change to the fee is picked up without a manifest refresh. The result
|
|
1752
|
+
is cached per network name for :data:`_BASE_FEE_TTL_S` seconds.
|
|
1753
|
+
|
|
1754
|
+
Any failure to read or decode the node — no backend set, a backend
|
|
1755
|
+
that cannot serve the datum, a missing datum, one that fails to
|
|
1756
|
+
decode as :class:`FeeSettings`, a backend indexing bug (e.g. an
|
|
1757
|
+
unguarded ``result[0]`` on an empty row set), or a transport failure
|
|
1758
|
+
(a database timeout, a connection error, an API error) — falls back
|
|
1759
|
+
to the deployment's manifest-snapshot
|
|
1760
|
+
:attr:`SundaeV4Deployment.base_fee`, which is cached for the same TTL
|
|
1761
|
+
and logged once as a warning. The backend surface is third-party and
|
|
1762
|
+
open-ended, so the catch is deliberately unbounded: no read failure
|
|
1763
|
+
may ever propagate out of a fee lookup and break order building.
|
|
1764
|
+
"""
|
|
1765
|
+
deployment = cls._deployment
|
|
1766
|
+
now = time.monotonic()
|
|
1767
|
+
cached = cls._base_fee_cache.get(deployment.network)
|
|
1768
|
+
if cached is not None and now - cached[1] < _BASE_FEE_TTL_S:
|
|
1769
|
+
return cached[0]
|
|
1770
|
+
try:
|
|
1771
|
+
ref = get_backend().get_datum_from_address(
|
|
1772
|
+
address=deployment.settings_address,
|
|
1773
|
+
asset=deployment.fee_settings_unit,
|
|
1774
|
+
)
|
|
1775
|
+
if ref is None or not ref.datum_cbor:
|
|
1776
|
+
msg = f"no fee-settings datum found for {deployment.network}"
|
|
1777
|
+
raise ValueError(msg)
|
|
1778
|
+
fee = FeeSettings.from_cbor(ref.datum_cbor).base_fee
|
|
1779
|
+
except Exception as e: # noqa: BLE001
|
|
1780
|
+
# Any read/decode failure falls back to the manifest snapshot by
|
|
1781
|
+
# design: an unsupported or misbehaving backend, a missing or
|
|
1782
|
+
# undecodable node, or a transport error must never surface here.
|
|
1783
|
+
fee = deployment.base_fee
|
|
1784
|
+
_logger.warning(
|
|
1785
|
+
"SundaeV4Vault: falling back to the manifest base fee for %s (%s).",
|
|
1786
|
+
deployment.network,
|
|
1787
|
+
e,
|
|
1788
|
+
)
|
|
1789
|
+
cls._base_fee_cache[deployment.network] = (fee, now)
|
|
1790
|
+
return fee
|
|
1791
|
+
|
|
1577
1792
|
@classmethod
|
|
1578
1793
|
def dex(cls) -> str:
|
|
1579
1794
|
"""Get the DEX name."""
|
|
@@ -1783,9 +1998,12 @@ class SundaeV4Vault(DendriteBaseModel):
|
|
|
1783
1998
|
|
|
1784
1999
|
Resolution order: supplied (constructor ``module_configs`` or
|
|
1785
2000
|
:meth:`supply_module_config`), then the class-level cache keyed by the
|
|
1786
|
-
commitment hash, then the
|
|
1787
|
-
active backend
|
|
1788
|
-
|
|
2001
|
+
commitment hash, then the last transaction that ran the module via the
|
|
2002
|
+
active backend — usually the transaction that produced this vault's own
|
|
2003
|
+
UTxO, else found by walking the pool NFT's UTxO history (see
|
|
2004
|
+
:meth:`_resolve_from_backend`). A config-less module (its slot holds the
|
|
2005
|
+
serialised empty list) resolves to ``None``. Every resolved config is
|
|
2006
|
+
hash-verified.
|
|
1789
2007
|
|
|
1790
2008
|
Raises:
|
|
1791
2009
|
KeyError: ``module_hash`` is not installed on this vault.
|
|
@@ -1830,29 +2048,80 @@ class SundaeV4Vault(DendriteBaseModel):
|
|
|
1830
2048
|
module_hash: bytes,
|
|
1831
2049
|
commitment: bytes,
|
|
1832
2050
|
) -> Any: # noqa: ANN401
|
|
1833
|
-
"""
|
|
2051
|
+
"""Find the config preimage in the last transaction that ran this module.
|
|
2052
|
+
|
|
2053
|
+
The transaction that produced this vault's own UTxO carries the
|
|
2054
|
+
module's redeemer whenever that spend was itself a scoop (an
|
|
2055
|
+
``Operate`` entry) or the pool's own creation (a ``Create``). A purely
|
|
2056
|
+
administrative spend — a treasury sweep, an upgrade, an
|
|
2057
|
+
emergency-disable — need not touch a given module at all, so when the
|
|
2058
|
+
producing transaction carries no matching redeemer the pool NFT's UTxO
|
|
2059
|
+
history is walked newest to oldest, via the active backend's
|
|
2060
|
+
``get_pool_utxos``, until a past transaction's redeemers commit to this
|
|
2061
|
+
config; the pool's creation transaction, at the bottom of that history,
|
|
2062
|
+
always carries the module's ``Create`` redeemer.
|
|
2063
|
+
|
|
2064
|
+
Raises:
|
|
2065
|
+
ModuleConfigUnavailableError: the active backend cannot read
|
|
2066
|
+
redeemers or pool history, or no transaction in the pool's
|
|
2067
|
+
history carries a redeemer committing to ``commitment``.
|
|
2068
|
+
"""
|
|
2069
|
+
kind = self.module_kind(module_hash)
|
|
2070
|
+
records = self._redeemers_or_unavailable(self.tx_hash, module_hash)
|
|
2071
|
+
config = _matching_config(records, module_hash, kind, commitment)
|
|
2072
|
+
if config is not None:
|
|
2073
|
+
return config
|
|
2074
|
+
for tx_hash in self._history_tx_hashes(module_hash):
|
|
2075
|
+
records = self._redeemers_or_unavailable(tx_hash, module_hash)
|
|
2076
|
+
config = _matching_config(records, module_hash, kind, commitment)
|
|
2077
|
+
if config is not None:
|
|
2078
|
+
return config
|
|
2079
|
+
msg = (
|
|
2080
|
+
f"SundaeV4Vault: no transaction in {self.pool_nft.unit()}'s history "
|
|
2081
|
+
f"carries the config committed for module {module_hash.hex()}."
|
|
2082
|
+
)
|
|
2083
|
+
raise ModuleConfigUnavailableError(msg)
|
|
2084
|
+
|
|
2085
|
+
@staticmethod
|
|
2086
|
+
def _redeemers_or_unavailable(
|
|
2087
|
+
tx_hash: str,
|
|
2088
|
+
module_hash: bytes,
|
|
2089
|
+
) -> list[RedeemerRecord]:
|
|
2090
|
+
"""``get_redeemers(tx_hash)``, translating a backend that can't serve them."""
|
|
1834
2091
|
try:
|
|
1835
|
-
|
|
2092
|
+
return get_backend().get_redeemers(tx_hash)
|
|
1836
2093
|
except NotImplementedError as e:
|
|
1837
2094
|
msg = (
|
|
1838
2095
|
f"SundaeV4Vault: the active backend cannot read redeemers, so the "
|
|
1839
2096
|
f"config for module {module_hash.hex()} must be supplied."
|
|
1840
2097
|
)
|
|
1841
2098
|
raise ModuleConfigUnavailableError(msg) from e
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
2099
|
+
|
|
2100
|
+
def _history_tx_hashes(self, module_hash: bytes) -> list[str]:
|
|
2101
|
+
"""This pool NFT's past producing transactions, newest first.
|
|
2102
|
+
|
|
2103
|
+
Excludes this vault's own ``tx_hash``. Raises
|
|
2104
|
+
``ModuleConfigUnavailableError`` if the active backend cannot list
|
|
2105
|
+
historical pool UTxOs.
|
|
2106
|
+
"""
|
|
2107
|
+
try:
|
|
2108
|
+
states = get_backend().get_pool_utxos(
|
|
2109
|
+
addresses=[self._deployment.pool_address.encode()],
|
|
2110
|
+
assets=[self.pool_nft.unit()],
|
|
2111
|
+
historical=True,
|
|
2112
|
+
)
|
|
2113
|
+
except NotImplementedError as e:
|
|
2114
|
+
msg = (
|
|
2115
|
+
f"SundaeV4Vault: the active backend cannot read pool history, so "
|
|
2116
|
+
f"the config for module {module_hash.hex()} must be supplied."
|
|
2117
|
+
)
|
|
2118
|
+
raise ModuleConfigUnavailableError(msg) from e
|
|
2119
|
+
history = sorted(
|
|
2120
|
+
states,
|
|
2121
|
+
key=lambda state: (state.block_time, state.block_index),
|
|
2122
|
+
reverse=True,
|
|
1854
2123
|
)
|
|
1855
|
-
|
|
2124
|
+
return [state.tx_hash for state in history if state.tx_hash != self.tx_hash]
|
|
1856
2125
|
|
|
1857
2126
|
|
|
1858
2127
|
class _SundaeV4OrderBuilders:
|
|
@@ -1928,19 +2197,24 @@ class _SundaeV4OrderBuilders:
|
|
|
1928
2197
|
) -> SundaeV4OrderDatum:
|
|
1929
2198
|
"""Assemble an order datum around a constraint list.
|
|
1930
2199
|
|
|
1931
|
-
Both fee fields default to the
|
|
1932
|
-
order then pays exactly the current
|
|
1933
|
-
the caller's explicit choice (a
|
|
1934
|
-
``min(max_per_execution,
|
|
2200
|
+
Both fee fields default to the live base fee (fee-settings node,
|
|
2201
|
+
manifest fallback): a single-shot order then pays exactly the current
|
|
2202
|
+
fee, and any headroom above it is the caller's explicit choice (a
|
|
2203
|
+
basic order's terminal fill takes ``min(max_per_execution,
|
|
2204
|
+
service_budget)`` in full). The live lookup runs only when at least
|
|
2205
|
+
one fee field is left to default.
|
|
1935
2206
|
"""
|
|
1936
|
-
|
|
2207
|
+
resolved_budget = service_budget
|
|
2208
|
+
resolved_max = max_per_execution
|
|
2209
|
+
if resolved_budget is None or resolved_max is None:
|
|
2210
|
+
base_fee = SundaeV4Vault.base_fee()
|
|
2211
|
+
resolved_budget = base_fee if resolved_budget is None else resolved_budget
|
|
2212
|
+
resolved_max = base_fee if resolved_max is None else resolved_max
|
|
1937
2213
|
return SundaeV4OrderDatum(
|
|
1938
2214
|
owner=owner if owner is not None else self.order_owner(address_source),
|
|
1939
2215
|
destination=destination,
|
|
1940
|
-
service_budget=
|
|
1941
|
-
max_per_execution=
|
|
1942
|
-
base_fee if max_per_execution is None else max_per_execution
|
|
1943
|
-
),
|
|
2216
|
+
service_budget=resolved_budget,
|
|
2217
|
+
max_per_execution=resolved_max,
|
|
1944
2218
|
config_token=config_token,
|
|
1945
2219
|
constraints=IndefiniteList(
|
|
1946
2220
|
[IndefiniteList([key, payload]) for key, payload in constraints],
|
|
@@ -2266,8 +2540,8 @@ class SundaeV4ConstantSumPool(_SundaeV4OrderBuilders, AbstractMultiAssetPoolStat
|
|
|
2266
2540
|
out_assets: Assets | None = None,
|
|
2267
2541
|
extra_assets: Assets | None = None,
|
|
2268
2542
|
) -> Assets:
|
|
2269
|
-
"""The
|
|
2270
|
-
return Assets(lovelace=
|
|
2543
|
+
"""The live base fee (fee-settings node, manifest fallback) an order locks."""
|
|
2544
|
+
return Assets(lovelace=SundaeV4Vault.base_fee())
|
|
2271
2545
|
|
|
2272
2546
|
def deposit(
|
|
2273
2547
|
self,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"_comment": "SundaeSwap V4 deployments, per Cardano network. Applied validator hashes (blake2b-224 of the parameterised PlutusV3 script), the published reference-script UTxOs, and the token-named settings nodes, as served by the Sundae API `protocols` query and verified against the chain. A network absent here has no V4 deployment.",
|
|
2
|
+
"_comment": "SundaeSwap V4 deployments, per Cardano network. Applied validator hashes (blake2b-224 of the parameterised PlutusV3 script), the published reference-script UTxOs, and the token-named settings nodes, as served by the Sundae API `protocols` query and verified against the chain. A network absent here has no V4 deployment. A settings label the API lists more than once (mainnet has two `cs-pool` nodes) is stored with a `#2` suffix on the duplicate.",
|
|
3
3
|
"preview": {
|
|
4
4
|
"validators": {
|
|
5
5
|
"pool.spend": "f577d24cfa393efdb85482554acbdd5082f99acba9c17eab916cf87a",
|
|
@@ -82,9 +82,10 @@
|
|
|
82
82
|
"index": 0
|
|
83
83
|
},
|
|
84
84
|
"fee-settings": {
|
|
85
|
-
"tx_hash": "
|
|
85
|
+
"tx_hash": "d9f8a3f4f66565ce81031d5fedeea0ba741c8833223741f06b1ee7970a67ac95",
|
|
86
86
|
"index": 0,
|
|
87
|
-
"
|
|
87
|
+
"token": "007e873372b3f5f3f8c6c70866acdf2644e7c9af64fa6aa4cff3ff094b417264",
|
|
88
|
+
"base_fee": 1280000,
|
|
88
89
|
"fee_per_step": 0
|
|
89
90
|
},
|
|
90
91
|
"basic-order": {
|
|
@@ -186,9 +187,10 @@
|
|
|
186
187
|
"index": 0
|
|
187
188
|
},
|
|
188
189
|
"fee-settings": {
|
|
189
|
-
"tx_hash": "
|
|
190
|
+
"tx_hash": "020c28f4669e881499d21af8269eac57293d983317048062925e2b7309f0d569",
|
|
190
191
|
"index": 0,
|
|
191
|
-
"
|
|
192
|
+
"token": "00c319c0435c4eaf30da4efe0251c9e715766d90840582a64969f10350222b3e",
|
|
193
|
+
"base_fee": 1280000,
|
|
192
194
|
"fee_per_step": 0
|
|
193
195
|
},
|
|
194
196
|
"basic-order": {
|
|
@@ -207,5 +209,121 @@
|
|
|
207
209
|
"token": "00d18c29fb9bd2d27b95a055b5c821a10aee09dc9aa8347bb4b1dca38ddbf585"
|
|
208
210
|
}
|
|
209
211
|
}
|
|
212
|
+
},
|
|
213
|
+
"mainnet": {
|
|
214
|
+
"validators": {
|
|
215
|
+
"pool.spend": "21c9b7b965646069f9becebf8b4c3cedaf84c19b109eaa5980a14a26",
|
|
216
|
+
"pool.mint": "d9d5985e0657933005d6eb953aeadad29aa8c36f17e493e2962584ec",
|
|
217
|
+
"order.spend": "07eb2fb09d9dd6603870ce6f84c8f8506249152173ddf0c77f1f07ec",
|
|
218
|
+
"basic_order.withdraw": "30f1fac08a15ef84ea6a5aa04989b1c2ceeb3b437f2c3103df5aca68",
|
|
219
|
+
"settings.spend": "808db58d7d66d348b0cc7d83c202ef1d19534d00bf6c463a531020ad",
|
|
220
|
+
"settings.mint": "371738e95ab3f0afba69c6b0896df05d7851a5307a830677b77c2ead",
|
|
221
|
+
"constant_sum.withdraw": "4e1a435f8d55f26068150579c18964e58078082b899e6bb560be7cd5",
|
|
222
|
+
"fee_split.withdraw": "1351c687e6359b0030086fc7ddd6cd389f55f97faba3f531c5535688",
|
|
223
|
+
"fairness.withdraw": "31d2328d6ddc3d5dfc48c5b827aa922506a80e7db40f25ef807d0fd5",
|
|
224
|
+
"strategy_order.withdraw": "35a9eebba5ea685d1deb20e269ca0045b9ff35df85cedde95c619a70",
|
|
225
|
+
"fee_constraint.withdraw": "267eabb980be6699144e85b24283659838b0746e0fd2f08be1423e70",
|
|
226
|
+
"governance.withdraw": "518c4a6ef444c2f0631b3a7adb7514d80212dff988e35c1318da88a2",
|
|
227
|
+
"treasury_policy.withdraw": "bcdca3ffc967ed2a5bf2dc9040f9f17d97f574122f7561fe26ef565b"
|
|
228
|
+
},
|
|
229
|
+
"references": {
|
|
230
|
+
"settings.mint": {
|
|
231
|
+
"tx_hash": "a1c05cdfd4987731673c49476d90b283c62ed528476e7267ad3dafeb4411d1ae",
|
|
232
|
+
"index": 0
|
|
233
|
+
},
|
|
234
|
+
"settings.spend": {
|
|
235
|
+
"tx_hash": "ee4da0e8f33f484c585f845811aee1a4e191fcdc002e0b3114ca6d2d4f320f22",
|
|
236
|
+
"index": 0
|
|
237
|
+
},
|
|
238
|
+
"pool.mint": {
|
|
239
|
+
"tx_hash": "9da7939c9ce65d2a4ea36de9dd7ae4fb0b8502a364d5144b7a3edda488d559b8",
|
|
240
|
+
"index": 0
|
|
241
|
+
},
|
|
242
|
+
"pool.spend": {
|
|
243
|
+
"tx_hash": "8f6b0905dba827dc47435645b1393c4efadf8aeaf1c92f5451f79cac4d776eb0",
|
|
244
|
+
"index": 0
|
|
245
|
+
},
|
|
246
|
+
"order.spend": {
|
|
247
|
+
"tx_hash": "c1ecddd68eaa61a3fb4c7af2fac6388d7c8fe0065da359943bdfb976e0f4be9a",
|
|
248
|
+
"index": 0
|
|
249
|
+
},
|
|
250
|
+
"basic_order.withdraw": {
|
|
251
|
+
"tx_hash": "5df8cb82c9205699cc5187cff8dad47b7ef84cd42faa8c29c7ecc6337b591273",
|
|
252
|
+
"index": 0
|
|
253
|
+
},
|
|
254
|
+
"strategy_order.withdraw": {
|
|
255
|
+
"tx_hash": "634e0c01004398316af24a8af40dc459befd002f1df4058fda86fd23252b81f6",
|
|
256
|
+
"index": 0
|
|
257
|
+
},
|
|
258
|
+
"constant_sum.withdraw": {
|
|
259
|
+
"tx_hash": "59858eb0271e1c2a2ee7238e1b2406f91a1c748e03d26e4bd06d626a761073f2",
|
|
260
|
+
"index": 0
|
|
261
|
+
},
|
|
262
|
+
"fee_split.withdraw": {
|
|
263
|
+
"tx_hash": "a13a049fe23608b553eaeb61ff85f808315d94e3ff637920e11d86ec6a2dc824",
|
|
264
|
+
"index": 0
|
|
265
|
+
},
|
|
266
|
+
"fairness.withdraw": {
|
|
267
|
+
"tx_hash": "037fbfafbda8f90411035ef6f3c37decbbeb5976a04dd38a6c9575a9cb8d0b05",
|
|
268
|
+
"index": 0
|
|
269
|
+
},
|
|
270
|
+
"treasury_policy.withdraw": {
|
|
271
|
+
"tx_hash": "5680e9afe490af23a66ddc557f8afa857fa6692b259dcd74667d35305efa69e7",
|
|
272
|
+
"index": 0
|
|
273
|
+
},
|
|
274
|
+
"fee_constraint.withdraw": {
|
|
275
|
+
"tx_hash": "ad6d1e268bb531b675ca105b4fecf6bf84f3dac3fecd09b109c1b52fad8baf10",
|
|
276
|
+
"index": 0
|
|
277
|
+
},
|
|
278
|
+
"governance.withdraw": {
|
|
279
|
+
"tx_hash": "88f35f925515e9fa9f5e119cff380b8b17934590973a4a031c0f2955b15bf64f",
|
|
280
|
+
"index": 0
|
|
281
|
+
}
|
|
282
|
+
},
|
|
283
|
+
"settings_policy": "371738e95ab3f0afba69c6b0896df05d7851a5307a830677b77c2ead",
|
|
284
|
+
"pool_nft_policy": "d9d5985e0657933005d6eb953aeadad29aa8c36f17e493e2962584ec",
|
|
285
|
+
"settings": {
|
|
286
|
+
"settings": {
|
|
287
|
+
"tx_hash": "fb421368fd0f426f481bb9e7ed024fdd840386c951de80eef37fa4493302bfbb",
|
|
288
|
+
"index": 0
|
|
289
|
+
},
|
|
290
|
+
"fee-settings": {
|
|
291
|
+
"tx_hash": "f96a11786ff97ad66ee982f210a79334a60d385b6d3aa3d56a40939cc03dbe0b",
|
|
292
|
+
"index": 0,
|
|
293
|
+
"token": "0019b58b8d626ebe1f2ad80fbc01f9125f54b6c6a4d2b45d31178bc72c337f35",
|
|
294
|
+
"base_fee": 1280000,
|
|
295
|
+
"fee_per_step": 0
|
|
296
|
+
},
|
|
297
|
+
"cs-pool": {
|
|
298
|
+
"tx_hash": "f83775313fc389d7e9c91cab058afbf72a0a619fa554ed4c7d40bbdecede98ac",
|
|
299
|
+
"index": 0,
|
|
300
|
+
"token": "00485088de995ad686cab8f1ecf42540ec7dea0cd990b9d5b057cdf4e9e02c05"
|
|
301
|
+
},
|
|
302
|
+
"cs-pool#2": {
|
|
303
|
+
"tx_hash": "65e1961153e97279453ce8923e5c403b06567235c9d221f2544a8bd0a9fc37d0",
|
|
304
|
+
"index": 0,
|
|
305
|
+
"token": "008999f2135b0fe4deda19c084cc9b497b9c9beb74b8df0c565656289d0ef235"
|
|
306
|
+
},
|
|
307
|
+
"migration-authority": {
|
|
308
|
+
"tx_hash": "e7796098eeb2d84c277d0c107a64a7125ced4e856fa58b8d21ce179f7376e436",
|
|
309
|
+
"index": 0,
|
|
310
|
+
"token": "0099b82a10940ece5e70355977fd89c5b4b7d7770b200781e2adbad4d94cec1a"
|
|
311
|
+
},
|
|
312
|
+
"basic-order": {
|
|
313
|
+
"tx_hash": "bcc21fecadb19cdf6b2eae9fc233bad3ecdb2c43684844dd1e74882140b8f2aa",
|
|
314
|
+
"index": 0,
|
|
315
|
+
"token": "012dd204b7a3c6d5d410290631d135f95703fc7247a0954067c9dbf32838d0fb"
|
|
316
|
+
},
|
|
317
|
+
"strategy-order": {
|
|
318
|
+
"tx_hash": "9b9344a58c077cadbdef932d5d5adfdee914d0cd83c8109741e30b9bbe92ad1e",
|
|
319
|
+
"index": 0,
|
|
320
|
+
"token": "015e3f549a4d1dd6324441a60b27ed156bba816921fc3854a8ad15838a592da9"
|
|
321
|
+
},
|
|
322
|
+
"stake-list": {
|
|
323
|
+
"tx_hash": "35dcd33ba9d3d52417398ee082b985c8c08fabb22c8e21a776bc10a75caf03d5",
|
|
324
|
+
"index": 0,
|
|
325
|
+
"token": "025fb43112751939720577e60909603f20e3756295f415de490d9785c019b4d9"
|
|
326
|
+
}
|
|
327
|
+
}
|
|
210
328
|
}
|
|
211
329
|
}
|
|
@@ -28,6 +28,8 @@ class NoAssetsError(Exception):
|
|
|
28
28
|
class ModuleConfigUnavailableError(Exception):
|
|
29
29
|
"""A module config preimage could not be resolved for a vault.
|
|
30
30
|
|
|
31
|
-
Raised when a config is neither supplied nor cached and the active
|
|
32
|
-
cannot serve
|
|
31
|
+
Raised when a config is neither supplied nor cached, and the active
|
|
32
|
+
backend either cannot serve redeemers or pool history, or no transaction
|
|
33
|
+
in the pool's history (its own producing transaction, then its NFT's past
|
|
34
|
+
states newest to oldest) carries a redeemer committing to the config.
|
|
33
35
|
"""
|