charli3_dendrite 1.6.11.dev0__tar.gz → 1.6.12.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.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/PKG-INFO +1 -1
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/pyproject.toml +2 -2
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/dexs/amm/sundae.py +267 -8
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/dexs/amm/sundae_v4_stableswap_math.py +11 -8
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/LICENSE +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/README.md +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/__init__.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/backend/__init__.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/backend/backend_base.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/backend/blockfrost/__init__.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/backend/blockfrost/models.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/backend/dbsync/__init__.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/backend/dbsync/models.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/backend/ogmios_kupo/__init__.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/backend/ogmios_kupo/models.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/backend/utils.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/dataclasses/__init__.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/dataclasses/datums.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/dataclasses/models.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/dexs/__init__.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/dexs/amm/__init__.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/dexs/amm/amm_base.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/dexs/amm/amm_types.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/dexs/amm/cswap.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/dexs/amm/dano.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/dexs/amm/minswap.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/dexs/amm/muesli.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/dexs/amm/multi_asset.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/dexs/amm/spectrum.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/dexs/amm/splash.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/dexs/amm/sundae_v4.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/dexs/amm/sundae_v4_banded_cl_math.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/dexs/amm/sundae_v4_deployments.json +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/dexs/amm/vyfi.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/dexs/amm/wingriders.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/dexs/core/__init__.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/dexs/core/base.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/dexs/core/errors.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/dexs/ob/__init__.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/dexs/ob/axo.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/dexs/ob/cardanoswaps.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/dexs/ob/cardanoswaps_two_way.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/dexs/ob/chadswap.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/dexs/ob/djed.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/dexs/ob/geniusyield.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/dexs/ob/ob_base.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/dexs/ob/saturnswap.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/__init__.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/base.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/builtins.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/danogo/__init__.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/danogo/constants.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/danogo/datums.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/danogo/loader.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/danogo/market.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/danogo/math.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/danogo/oracles/__init__.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/danogo/oracles/aggregator.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/danogo/oracles/aggregator_datums.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/danogo/oracles/deployments.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/danogo/oracles/forward.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/danogo/oracles/leaves.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/danogo/oracles/locator.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/danogo/oracles/lp_pricing.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/danogo/oracles/recipes.json +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/danogo/oracles/redeemer.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/danogo/oracles/reproduce.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/danogo/oracles/structured_datums.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/danogo/state.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/danogo/transactions/__init__.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/danogo/transactions/_common.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/danogo/transactions/build.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/danogo/transactions/builder.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/danogo/transactions/context.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/danogo/transactions/create_loan.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/danogo/transactions/datum_synth.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/danogo/transactions/increase_loan.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/danogo/transactions/loan_ids.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/danogo/transactions/modify_collateral.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/danogo/transactions/oracle_redeemer.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/danogo/transactions/oracle_synth.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/danogo/transactions/redeemers.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/danogo/transactions/repay.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/danogo/transactions/topup_withdraw.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/danogo/transactions/verify.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/fetch.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/fluidtokens/__init__.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/fluidtokens/constants.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/fluidtokens/datums.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/fluidtokens/loader.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/fluidtokens/market.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/fluidtokens/math.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/fluidtokens/oracles/__init__.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/fluidtokens/oracles/feeds.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/fluidtokens/oracles/fluid_api.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/fluidtokens/oracles/witness.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/fluidtokens/state.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/fluidtokens/transactions/__init__.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/fluidtokens/transactions/_common.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/fluidtokens/transactions/borrow.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/fluidtokens/transactions/borrow_terms.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/fluidtokens/transactions/builder.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/fluidtokens/transactions/change_collateral.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/fluidtokens/transactions/context.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/fluidtokens/transactions/datum_synth.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/fluidtokens/transactions/lend.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/fluidtokens/transactions/pool.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/fluidtokens/transactions/recast.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/fluidtokens/transactions/redeemers.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/fluidtokens/transactions/repay.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/fluidtokens/transactions/request.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/fluidtokens/transactions/resolve.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/fluidtokens/transactions/utxos.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/fluidtokens_v4/__init__.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/fluidtokens_v4/constants.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/fluidtokens_v4/datums.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/fluidtokens_v4/indexing.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/fluidtokens_v4/loader.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/fluidtokens_v4/market.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/fluidtokens_v4/rates.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/fluidtokens_v4/state.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/fluidtokens_v4/transactions/__init__.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/fluidtokens_v4/transactions/borrow.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/fluidtokens_v4/transactions/builder.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/fluidtokens_v4/transactions/change_collateral.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/fluidtokens_v4/transactions/claim.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/fluidtokens_v4/transactions/common.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/fluidtokens_v4/transactions/lender_bond.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/fluidtokens_v4/transactions/loan_action.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/fluidtokens_v4/transactions/loan_terms.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/fluidtokens_v4/transactions/oracle.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/fluidtokens_v4/transactions/pool_action.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/fluidtokens_v4/transactions/pool_cancel.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/fluidtokens_v4/transactions/pool_create.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/fluidtokens_v4/transactions/pool_edit.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/fluidtokens_v4/transactions/pool_terms.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/fluidtokens_v4/transactions/recast.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/fluidtokens_v4/transactions/redeemers.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/fluidtokens_v4/transactions/repay.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/fluidtokens_v4/transactions/resolve.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/liqwid/__init__.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/liqwid/datums.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/liqwid/deployment.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/liqwid/indexing.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/liqwid/lifecycle.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/liqwid/loader.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/liqwid/market.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/liqwid/math.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/liqwid/oracles.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/liqwid/rates.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/liqwid/registry_v6.json +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/liqwid/transactions/__init__.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/liqwid/transactions/_flow.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/liqwid/transactions/borrow.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/liqwid/transactions/borrow_more.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/liqwid/transactions/builder.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/liqwid/transactions/capture.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/liqwid/transactions/collateral.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/liqwid/transactions/combos.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/liqwid/transactions/errors.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/liqwid/transactions/legs.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/liqwid/transactions/repay.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/liqwid/transactions/resolve.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/liqwid/transactions/supply.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/liqwid/transactions/terms.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/markets.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/math.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/normalized.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/oracles/__init__.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/oracles/charli3.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/oracles/dex_pooled.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/oracles/fluid.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/oracles/models.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/oracles/orcfax.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/oracles/qtoken.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/plutus.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/rates.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/registry.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/transactions/__init__.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/transactions/base.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/transactions/common.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/transactions/errors.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/transactions/infra.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/transactions/resolve.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/transactions/snapshot.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/transactions/utxos.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/transactions/validity.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/units.py +0 -0
- {charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/utility.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "charli3_dendrite"
|
|
3
|
-
version = "1.6.
|
|
3
|
+
version = "1.6.12-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.6.
|
|
53
|
+
current_version = "1.6.12-dev0"
|
|
54
54
|
parse = """(?x)
|
|
55
55
|
(?P<major>\\d+)\\.
|
|
56
56
|
(?P<minor>\\d+)\\.
|
|
@@ -7,6 +7,7 @@ from typing import Any
|
|
|
7
7
|
from typing import ClassVar
|
|
8
8
|
from typing import List
|
|
9
9
|
from typing import Union
|
|
10
|
+
from typing import cast
|
|
10
11
|
|
|
11
12
|
from pycardano import Address
|
|
12
13
|
from pycardano import Datum
|
|
@@ -30,6 +31,10 @@ from charli3_dendrite.dataclasses.models import OrderType
|
|
|
30
31
|
from charli3_dendrite.dataclasses.models import PoolSelector
|
|
31
32
|
from charli3_dendrite.dexs.amm.amm_types import AbstractConstantProductPoolState
|
|
32
33
|
from charli3_dendrite.dexs.amm.amm_types import AbstractStableSwapPoolState
|
|
34
|
+
from charli3_dendrite.dexs.amm.sundae_v4_stableswap_math import STABLESWAP_PRECISION
|
|
35
|
+
from charli3_dendrite.dexs.amm.sundae_v4_stableswap_math import stableswap_d
|
|
36
|
+
from charli3_dendrite.dexs.amm.sundae_v4_stableswap_math import stableswap_swap
|
|
37
|
+
from charli3_dendrite.dexs.amm.sundae_v4_stableswap_math import stableswap_y
|
|
33
38
|
from charli3_dendrite.dexs.core.errors import InvalidPoolError
|
|
34
39
|
from charli3_dendrite.dexs.core.errors import NoAssetsError
|
|
35
40
|
from charli3_dendrite.dexs.core.errors import NotAPoolError
|
|
@@ -38,6 +43,11 @@ from charli3_dendrite.dexs.core.errors import NotAPoolError
|
|
|
38
43
|
# input, so any realistic delivery is swapped in full.
|
|
39
44
|
SWAP_ALL_OFFER_MULTIPLE = 2
|
|
40
45
|
|
|
46
|
+
# The largest quantity of one asset a ledger value can hold.
|
|
47
|
+
_LEDGER_MAX = 2**64 - 1
|
|
48
|
+
# Swap fees are quoted in basis points.
|
|
49
|
+
_FEE_BASIS = 10_000
|
|
50
|
+
|
|
41
51
|
|
|
42
52
|
@dataclass
|
|
43
53
|
class AtoB(PlutusData):
|
|
@@ -806,7 +816,35 @@ class SundaeSwapV3CPPState(AbstractConstantProductPoolState):
|
|
|
806
816
|
return datum
|
|
807
817
|
|
|
808
818
|
|
|
819
|
+
@dataclass(frozen=True)
|
|
820
|
+
class SundaeV3StableSwapResult:
|
|
821
|
+
"""One swap against a SundaeSwap V3 stableswap pool, as the contract settles it.
|
|
822
|
+
|
|
823
|
+
``gross`` is the out-side amount the curve releases, ``fee`` the swap fee taken
|
|
824
|
+
from it (rounded up), ``takes`` what the trader receives (``gross - fee``) and
|
|
825
|
+
``protocol_share`` the part of ``fee`` the pool books as protocol fees. The
|
|
826
|
+
out-side reserve drops by ``takes + protocol_share``; the rest of the fee stays
|
|
827
|
+
with liquidity providers.
|
|
828
|
+
"""
|
|
829
|
+
|
|
830
|
+
takes: int
|
|
831
|
+
gross: int
|
|
832
|
+
fee: int
|
|
833
|
+
protocol_share: int
|
|
834
|
+
|
|
835
|
+
|
|
809
836
|
class SundaeSwapV3StableSwap(AbstractStableSwapPoolState):
|
|
837
|
+
"""SundaeSwap V3 stableswap pool.
|
|
838
|
+
|
|
839
|
+
The pool prices two reserves on the curve ``4A(x + y) + D = 4AD + D^3 / (4xy)``
|
|
840
|
+
over reserves scaled by :data:`STABLESWAP_PRECISION`, with the contract's exact
|
|
841
|
+
integer rounding: the swap fee is taken from the output, rounded up. Reserves
|
|
842
|
+
are the pool UTxO's holdings net of the asset-side protocol fees its datum has
|
|
843
|
+
accrued (``protocol_fees[1]`` and ``protocol_fees[2]``). The scooper ADA
|
|
844
|
+
accrual (``protocol_fees[0]``) is not netted, so on an ADA-paired pool the
|
|
845
|
+
lovelace reserve still holds it.
|
|
846
|
+
"""
|
|
847
|
+
|
|
810
848
|
_batcher = Assets(lovelace=500000)
|
|
811
849
|
_deposit = Assets(lovelace=2000000)
|
|
812
850
|
_stake_address: ClassVar[Address] = Address.from_primitive(
|
|
@@ -814,7 +852,8 @@ class SundaeSwapV3StableSwap(AbstractStableSwapPoolState):
|
|
|
814
852
|
)
|
|
815
853
|
|
|
816
854
|
_amp: int | None = None
|
|
817
|
-
|
|
855
|
+
_protocol_bps: tuple[int, int] | None = None
|
|
856
|
+
_d_memo: tuple[tuple[int, int, int], int] | None = None
|
|
818
857
|
|
|
819
858
|
def batcher_fee(
|
|
820
859
|
self,
|
|
@@ -907,7 +946,13 @@ class SundaeSwapV3StableSwap(AbstractStableSwapPoolState):
|
|
|
907
946
|
else:
|
|
908
947
|
values["assets"]["lovelace"] = values["assets"].pop("lovelace")
|
|
909
948
|
|
|
910
|
-
|
|
949
|
+
# Already-parsed reserves are net of protocol fees: never subtract them.
|
|
950
|
+
values["assets"] = Assets.model_validate(values["assets"])
|
|
951
|
+
super().post_init(values)
|
|
952
|
+
datum = SundaeV3StablePoolDatum.from_cbor(values["datum_cbor"])
|
|
953
|
+
values["fee"] = cls._datum_fees(datum)
|
|
954
|
+
|
|
955
|
+
cls.get_batcher_fee()
|
|
911
956
|
return True
|
|
912
957
|
else:
|
|
913
958
|
return False
|
|
@@ -922,8 +967,20 @@ class SundaeSwapV3StableSwap(AbstractStableSwapPoolState):
|
|
|
922
967
|
else:
|
|
923
968
|
raise NotAPoolError("No pool NFT found.")
|
|
924
969
|
|
|
970
|
+
@staticmethod
|
|
971
|
+
def _datum_fees(datum: SundaeV3StablePoolDatum) -> list[int]:
|
|
972
|
+
"""The swap fee per offered side: liquidity plus protocol basis points."""
|
|
973
|
+
return [
|
|
974
|
+
lp + protocol
|
|
975
|
+
for lp, protocol in zip(
|
|
976
|
+
datum.lp_fee_basis_points,
|
|
977
|
+
datum.protocol_fee_basis_points,
|
|
978
|
+
)
|
|
979
|
+
]
|
|
980
|
+
|
|
925
981
|
@classmethod
|
|
926
982
|
def post_init(cls, values):
|
|
983
|
+
"""Parse a raw pool UTxO, netting the asset-side protocol fees it holds."""
|
|
927
984
|
super().post_init(values)
|
|
928
985
|
|
|
929
986
|
assets = values["assets"]
|
|
@@ -932,10 +989,7 @@ class SundaeSwapV3StableSwap(AbstractStableSwapPoolState):
|
|
|
932
989
|
assets.root[assets.unit(0)] -= datum.protocol_fees[1]
|
|
933
990
|
assets.root[assets.unit(1)] -= datum.protocol_fees[2]
|
|
934
991
|
|
|
935
|
-
values["fee"] =
|
|
936
|
-
l + p
|
|
937
|
-
for l, p in zip(datum.lp_fee_basis_points, datum.protocol_fee_basis_points)
|
|
938
|
-
]
|
|
992
|
+
values["fee"] = cls._datum_fees(datum)
|
|
939
993
|
|
|
940
994
|
cls.get_batcher_fee()
|
|
941
995
|
|
|
@@ -946,19 +1000,224 @@ class SundaeSwapV3StableSwap(AbstractStableSwapPoolState):
|
|
|
946
1000
|
|
|
947
1001
|
return self._amp
|
|
948
1002
|
|
|
1003
|
+
@property
|
|
1004
|
+
def protocol_fee_basis_points(self) -> tuple[int, int]:
|
|
1005
|
+
"""The protocol's basis points of the swap fee, per offered side."""
|
|
1006
|
+
if self._protocol_bps is None:
|
|
1007
|
+
datum = cast(SundaeV3StablePoolDatum, self.pool_datum)
|
|
1008
|
+
bps = datum.protocol_fee_basis_points
|
|
1009
|
+
self._protocol_bps = (bps[0], bps[1])
|
|
1010
|
+
return self._protocol_bps
|
|
1011
|
+
|
|
1012
|
+
def sum_invariant(self) -> int:
|
|
1013
|
+
"""The invariant ``D`` of the current reserves.
|
|
1014
|
+
|
|
1015
|
+
Computed from the reserves, never read from the datum, so reserves moved
|
|
1016
|
+
past the datum still quote exactly. Zero when a side is empty. Memoised on
|
|
1017
|
+
the reserves, so a move made directly on ``assets`` never serves a stale
|
|
1018
|
+
value.
|
|
1019
|
+
"""
|
|
1020
|
+
key = (self.assets.quantity(0), self.assets.quantity(1), self.amp)
|
|
1021
|
+
if self._d_memo is not None and self._d_memo[0] == key:
|
|
1022
|
+
return self._d_memo[1]
|
|
1023
|
+
d = stableswap_d(
|
|
1024
|
+
self.amp,
|
|
1025
|
+
key[0] * STABLESWAP_PRECISION,
|
|
1026
|
+
key[1] * STABLESWAP_PRECISION,
|
|
1027
|
+
)
|
|
1028
|
+
self._d_memo = (key, d)
|
|
1029
|
+
return d
|
|
1030
|
+
|
|
1031
|
+
def _swap_side(self, unit: str) -> int:
|
|
1032
|
+
"""The reserve index of ``unit``.
|
|
1033
|
+
|
|
1034
|
+
Raises:
|
|
1035
|
+
ValueError: ``unit`` is not one of the pool's two reserves.
|
|
1036
|
+
"""
|
|
1037
|
+
if unit == self.unit_a:
|
|
1038
|
+
return 0
|
|
1039
|
+
if unit == self.unit_b:
|
|
1040
|
+
return 1
|
|
1041
|
+
msg = f"Asset {unit} is invalid for pool {self.unit_a}-{self.unit_b}"
|
|
1042
|
+
raise ValueError(msg)
|
|
1043
|
+
|
|
1044
|
+
def _single(self, asset: Assets) -> tuple[str, int, int]:
|
|
1045
|
+
"""The unit, reserve index and quantity of a one-asset ``asset``.
|
|
1046
|
+
|
|
1047
|
+
Raises:
|
|
1048
|
+
ValueError: ``asset`` is not exactly one of the pool's reserves, or
|
|
1049
|
+
its quantity is negative.
|
|
1050
|
+
"""
|
|
1051
|
+
if len(asset) != 1:
|
|
1052
|
+
msg = "Asset should only have one token."
|
|
1053
|
+
raise ValueError(msg)
|
|
1054
|
+
unit = asset.unit()
|
|
1055
|
+
side = self._swap_side(unit)
|
|
1056
|
+
quantity = asset.quantity()
|
|
1057
|
+
if quantity < 0:
|
|
1058
|
+
msg = f"Quantity of {unit} is negative."
|
|
1059
|
+
raise ValueError(msg)
|
|
1060
|
+
return unit, side, quantity
|
|
1061
|
+
|
|
1062
|
+
def _side_fee(self, side: int) -> int:
|
|
1063
|
+
"""The swap fee, in basis points, of a trade offering reserve ``side``."""
|
|
1064
|
+
fee = self.volume_fee
|
|
1065
|
+
if fee is None:
|
|
1066
|
+
return 0
|
|
1067
|
+
if isinstance(fee, (int, float)):
|
|
1068
|
+
return int(fee)
|
|
1069
|
+
return int(fee[side])
|
|
1070
|
+
|
|
1071
|
+
def _swap(self, side: int, amount: int) -> SundaeV3StableSwapResult:
|
|
1072
|
+
"""The settled swap offering ``amount`` of reserve ``side``.
|
|
1073
|
+
|
|
1074
|
+
All zero for no offer, or when a side is empty.
|
|
1075
|
+
"""
|
|
1076
|
+
reserve_in = self.assets.quantity(side)
|
|
1077
|
+
reserve_out = self.assets.quantity(1 - side)
|
|
1078
|
+
if amount <= 0 or reserve_in <= 0 or reserve_out <= 0:
|
|
1079
|
+
return SundaeV3StableSwapResult(takes=0, gross=0, fee=0, protocol_share=0)
|
|
1080
|
+
fee = self._side_fee(side)
|
|
1081
|
+
quote = stableswap_swap(
|
|
1082
|
+
self.amp,
|
|
1083
|
+
self.sum_invariant(),
|
|
1084
|
+
reserve_in,
|
|
1085
|
+
1,
|
|
1086
|
+
reserve_out,
|
|
1087
|
+
1,
|
|
1088
|
+
amount,
|
|
1089
|
+
(fee, _FEE_BASIS),
|
|
1090
|
+
)
|
|
1091
|
+
protocol = self.protocol_fee_basis_points[side]
|
|
1092
|
+
protocol_share = quote.fee * protocol // fee if fee > 0 else 0
|
|
1093
|
+
return SundaeV3StableSwapResult(
|
|
1094
|
+
takes=quote.takes,
|
|
1095
|
+
gross=quote.gross,
|
|
1096
|
+
fee=quote.fee,
|
|
1097
|
+
protocol_share=protocol_share,
|
|
1098
|
+
)
|
|
1099
|
+
|
|
1100
|
+
def swap_result(self, asset: Assets) -> SundaeV3StableSwapResult:
|
|
1101
|
+
"""The settled swap offering the one-asset ``asset``.
|
|
1102
|
+
|
|
1103
|
+
All zero for no offer, or when a side is empty.
|
|
1104
|
+
|
|
1105
|
+
Raises:
|
|
1106
|
+
ValueError: ``asset`` is not exactly one of the pool's reserves, or
|
|
1107
|
+
its quantity is negative.
|
|
1108
|
+
"""
|
|
1109
|
+
_, side, amount = self._single(asset)
|
|
1110
|
+
return self._swap(side, amount)
|
|
1111
|
+
|
|
949
1112
|
def get_amount_out(
|
|
950
1113
|
self,
|
|
951
1114
|
asset: Assets,
|
|
952
1115
|
precise: bool = True,
|
|
953
1116
|
) -> tuple[Assets, float]:
|
|
954
|
-
|
|
1117
|
+
"""The exact output for the one-asset offer ``asset``.
|
|
1118
|
+
|
|
1119
|
+
The output is the contract's payout, an integer whatever ``precise`` is:
|
|
1120
|
+
zero for no offer, or when a side is empty. The second value is always 0.
|
|
1121
|
+
|
|
1122
|
+
Raises:
|
|
1123
|
+
ValueError: ``asset`` is not exactly one of the pool's reserves, or
|
|
1124
|
+
its quantity is negative.
|
|
1125
|
+
"""
|
|
1126
|
+
_, side, amount = self._single(asset)
|
|
1127
|
+
out_unit = self.unit_b if side == 0 else self.unit_a
|
|
1128
|
+
return Assets(**{out_unit: self._swap(side, amount).takes}), 0
|
|
1129
|
+
|
|
1130
|
+
def max_output(self, out_unit: str) -> int:
|
|
1131
|
+
"""The smallest undeliverable output of ``out_unit``.
|
|
1132
|
+
|
|
1133
|
+
One past what the largest ledger offer of the other reserve buys: the
|
|
1134
|
+
output never decreases as the offer grows. One when a side is empty, as
|
|
1135
|
+
no offer then delivers anything.
|
|
1136
|
+
|
|
1137
|
+
Raises:
|
|
1138
|
+
ValueError: ``out_unit`` is not one of the pool's reserves.
|
|
1139
|
+
"""
|
|
1140
|
+
side = 1 - self._swap_side(out_unit)
|
|
1141
|
+
return self._swap(side, _LEDGER_MAX).takes + 1
|
|
955
1142
|
|
|
956
1143
|
def get_amount_in(
|
|
957
1144
|
self,
|
|
958
1145
|
asset: Assets,
|
|
959
1146
|
precise: bool = True,
|
|
960
1147
|
) -> tuple[Assets, float]:
|
|
961
|
-
|
|
1148
|
+
"""The least offer whose exact output reaches the one-asset ``asset``.
|
|
1149
|
+
|
|
1150
|
+
Zero for no output. The input is an integer whatever ``precise`` is. The
|
|
1151
|
+
second value is always 0.
|
|
1152
|
+
|
|
1153
|
+
Raises:
|
|
1154
|
+
ValueError: ``asset`` is not exactly one of the pool's reserves, or
|
|
1155
|
+
its quantity is negative.
|
|
1156
|
+
InvalidPoolError: no ledger quantity of the other reserve reaches the
|
|
1157
|
+
output (it is at or past :meth:`max_output`), which holds for any
|
|
1158
|
+
positive output when a side is empty.
|
|
1159
|
+
"""
|
|
1160
|
+
_, out_side, want = self._single(asset)
|
|
1161
|
+
side = 1 - out_side
|
|
1162
|
+
in_unit = self.unit_a if side == 0 else self.unit_b
|
|
1163
|
+
if want == 0:
|
|
1164
|
+
return Assets(**{in_unit: 0}), 0
|
|
1165
|
+
reserve_in = self.assets.quantity(side)
|
|
1166
|
+
reserve_out = self.assets.quantity(out_side)
|
|
1167
|
+
offer = None
|
|
1168
|
+
if reserve_in > 0 and reserve_out > 0:
|
|
1169
|
+
offer = self._least_offer(side, want)
|
|
1170
|
+
if offer is None:
|
|
1171
|
+
msg = (
|
|
1172
|
+
f"{type(self).__name__}: no amount of {in_unit} reaches {want} "
|
|
1173
|
+
f"of {asset.unit()}."
|
|
1174
|
+
)
|
|
1175
|
+
raise InvalidPoolError(msg)
|
|
1176
|
+
return Assets(**{in_unit: offer}), 0
|
|
1177
|
+
|
|
1178
|
+
def _least_offer(self, side: int, want: int) -> int | None:
|
|
1179
|
+
"""The least offer of reserve ``side`` whose takes reach ``want``.
|
|
1180
|
+
|
|
1181
|
+
``None`` when no ledger quantity does. The output is released by the curve
|
|
1182
|
+
as ``gross`` and the fee taken from it, so the least ``gross`` netting
|
|
1183
|
+
``want`` is found first. The post-swap out-side reserve must then be at most
|
|
1184
|
+
``Y = (reserve_out - gross) * P``; the curve is symmetric in its two
|
|
1185
|
+
reserves, so the least in-side reserve on or above it at ``Y`` is
|
|
1186
|
+
``stableswap_y(D, Y)``, and the offer is what lifts the in-side reserve
|
|
1187
|
+
there. A final step against the exact quote pins the minimum.
|
|
1188
|
+
"""
|
|
1189
|
+
fee = self._side_fee(side)
|
|
1190
|
+
if fee >= _FEE_BASIS:
|
|
1191
|
+
return None
|
|
1192
|
+
reserve_in = self.assets.quantity(side)
|
|
1193
|
+
reserve_out = self.assets.quantity(1 - side)
|
|
1194
|
+
|
|
1195
|
+
def net(gross: int) -> int:
|
|
1196
|
+
return gross - (gross * fee + _FEE_BASIS - 1) // _FEE_BASIS
|
|
1197
|
+
|
|
1198
|
+
gross = -(-want * _FEE_BASIS // (_FEE_BASIS - fee))
|
|
1199
|
+
while net(gross) < want:
|
|
1200
|
+
gross += 1
|
|
1201
|
+
while gross > 1 and net(gross - 1) >= want:
|
|
1202
|
+
gross -= 1
|
|
1203
|
+
if gross >= reserve_out:
|
|
1204
|
+
return None
|
|
1205
|
+
|
|
1206
|
+
x_min = stableswap_y(
|
|
1207
|
+
self.amp,
|
|
1208
|
+
self.sum_invariant(),
|
|
1209
|
+
(reserve_out - gross) * STABLESWAP_PRECISION,
|
|
1210
|
+
)
|
|
1211
|
+
offer = max(-(-x_min // STABLESWAP_PRECISION) - reserve_in, 1)
|
|
1212
|
+
if offer > _LEDGER_MAX:
|
|
1213
|
+
return None
|
|
1214
|
+
while self._swap(side, offer).takes < want:
|
|
1215
|
+
offer += 1
|
|
1216
|
+
if offer > _LEDGER_MAX:
|
|
1217
|
+
return None
|
|
1218
|
+
while offer > 1 and self._swap(side, offer - 1).takes >= want:
|
|
1219
|
+
offer -= 1
|
|
1220
|
+
return offer
|
|
962
1221
|
|
|
963
1222
|
def swap_datum(
|
|
964
1223
|
self,
|
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
"""Exact SundaeSwap
|
|
1
|
+
"""Exact SundaeSwap stableswap math: the integers the validators admit.
|
|
2
2
|
|
|
3
|
-
The stableswap module
|
|
3
|
+
The V4 stableswap module and the V3 stableswap pool price two reserves on Curve's
|
|
4
|
+
invariant
|
|
4
5
|
|
|
5
6
|
4A(x + y) + D = 4AD + D^3 / (4xy)
|
|
6
7
|
|
|
7
8
|
over reserves scaled by their config rate and :data:`STABLESWAP_PRECISION`
|
|
8
|
-
(``x = reserve * rate * 10**12
|
|
9
|
-
step's declared ``D`` is the largest
|
|
10
|
-
post-swap out-side reserve is the smallest
|
|
11
|
-
``-f`` at the post-swap reserves).
|
|
9
|
+
(``x = reserve * rate * 10**12``; V3 has no rates and uses rate 1). The V4
|
|
10
|
+
validator solves nothing: it checks that a step's declared ``D`` is the largest
|
|
11
|
+
integer with ``f(D) <= 0`` and that its post-swap out-side reserve is the smallest
|
|
12
|
+
integer ``y`` with ``g(y) >= 0`` (``g`` is ``-f`` at the post-swap reserves). The V3
|
|
13
|
+
pool settles on the same two brackets. These functions port the contract's off-chain
|
|
12
14
|
reference: integer Newton iterations, then the one-step fix-up onto each bracket.
|
|
13
15
|
Every value is a Python int and every division has non-negative operands, where
|
|
14
16
|
floor division and Aiken's truncating division agree.
|
|
@@ -101,8 +103,9 @@ class StableSwapQuote:
|
|
|
101
103
|
"""One swap step as the validator pins it.
|
|
102
104
|
|
|
103
105
|
``raw_swap_result`` is the scaled out-side reserve delta, ``gross`` its token
|
|
104
|
-
amount, ``fee`` the ceiled swap fee
|
|
105
|
-
the
|
|
106
|
+
amount, ``fee`` the ceiled swap fee and ``takes`` what the trader receives. On
|
|
107
|
+
V4 the whole fee stays in the reserve; V3 moves its protocol share out (see
|
|
108
|
+
``SundaeV3StableSwapResult``).
|
|
106
109
|
"""
|
|
107
110
|
|
|
108
111
|
raw_swap_result: int
|
|
File without changes
|
|
File without changes
|
{charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/backend/utils.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/dexs/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/dexs/amm/cswap.py
RENAMED
|
File without changes
|
{charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/dexs/amm/dano.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/dexs/amm/vyfi.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/dexs/core/base.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/dexs/ob/axo.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/dexs/ob/djed.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/base.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/fetch.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/math.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/plutus.py
RENAMED
|
File without changes
|
{charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/rates.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/lending/units.py
RENAMED
|
File without changes
|
{charli3_dendrite-1.6.11.dev0 → charli3_dendrite-1.6.12.dev0}/src/charli3_dendrite/utility.py
RENAMED
|
File without changes
|