sundae-v3
@SundaeSwap-finance
• v0.1.0Sundae Tx3 MVP
This directory contains the in-repo Tx3 draft for Sundae's user-facing order flows.
Status
Official MVP user-facing flows:
submit_swapsubmit_depositsubmit_withdrawalcancel_order
These are the flows that have been validated as the practical preview-network path for wallet users.
Recommended integration path
For wallet-facing integrations:
- use the default submit flows, which are pool-targeted
- use the owner's stake key hash for
owner_key_hash - use destination payment + stake key hashes in the order datum
- source
order_script_reffrom the profile env - bind the
OrderScriptparty to the deployed order script address for the selected network - use the generated Python SDK or
scripts/preview_resolve.pyfor preview probing
Secondary / advanced flows still exist in main.tx3:
submit_swap_any_poolsubmit_deposit_any_poolsubmit_withdrawal_any_pool
These untargeted variants are useful for experimentation, but the default submit flows are the recommended public surface.
Local regression workflow
Run the local regression checks:
cd tx3
./scripts/run_regressions.sh
This runs:
trix checktrix build -p localtrix build -p previewtrix codegen -p previewtrix inspect tirchecks for every MVP tx- generated Python SDK import checks
preview_resolve.py --help
These are deterministic compile/codegen/TIR regressions. The real end-to-end behavior is documented in the preview examples below.
Preview resolve helper
Use the preview helper with a Demeter TRP key:
cd tx3
python scripts/preview_resolve.py --help
Supported tx kinds:
swapdepositwithdrawalcancel
For submit flows, the default variant is the recommended pool-targeted path. Use --variant any-pool only for advanced untargeted probing.
Known-good preview examples
Default swap
python scripts/preview_resolve.py \
--api-key "$DEMETER_TRP_API_KEY" \
--tx-kind swap \
--pool-ident 35a34996f515c5a28c8df9eada81f03f4f2756d92e7f73cde1f4e593 \
--offer d8906ca5c7ba124a0407a32dab37b2c82b13b3dcd9111e42940dcea4.0014df105553444d \
--offer-amount 1000000 \
--receive ada \
--min-received 1 \
--order-ada 3000000 \
--max-protocol-fee 600000
Default deposit
python scripts/preview_resolve.py \
--api-key "$DEMETER_TRP_API_KEY" \
--tx-kind deposit \
--pool-ident 35a34996f515c5a28c8df9eada81f03f4f2756d92e7f73cde1f4e593 \
--asset-a ada \
--asset-a-amount 5000000 \
--asset-b d8906ca5c7ba124a0407a32dab37b2c82b13b3dcd9111e42940dcea4.0014df105553444d \
--asset-b-amount 1000000 \
--order-ada 3000000 \
--max-protocol-fee 600000
Default withdrawal
python scripts/preview_resolve.py \
--api-key "$DEMETER_TRP_API_KEY" \
--tx-kind withdrawal \
--pool-ident 35a34996f515c5a28c8df9eada81f03f4f2756d92e7f73cde1f4e593 \
--lp-asset 44a1eb2d9f58add4eb1932bd0048e6a1947e85e3fe4f32956a110414.0014df1035a34996f515c5a28c8df9eada81f03f4f2756d92e7f73cde1f4e593 \
--lp-amount 1000 \
--order-ada 3000000 \
--max-protocol-fee 600000
Cancel order
python scripts/preview_resolve.py \
--api-key "$DEMETER_TRP_API_KEY" \
--tx-kind cancel \
--order-utxo <tx_hash>#<index> \
--order-script-ref 92ec2274938de291d3837b7facf9eddfaed57cd6ff97e26af57cb7a9978e3887#0
See also:
deployments.mdfor preview/mainnet script hashes, addresses, and reference UTxOs
Example arg files
See:
args-submit-swap.jsonargs-submit-deposit.jsonargs-submit-withdrawal.jsonargs-cancel-order.jsonargs-submit-swap-any-pool.jsonargs-submit-deposit-any-pool.jsonargs-submit-withdrawal-any-pool.json
Transactions
submit_swap
Post a pool-targeted swap order to the Sundae order script. This is the recommended wallet-facing swap flow.
submit_swap_any_pool
Post an untargeted swap order to the Sundae order script. For wallet-facing integrations, prefer `submit_swap`. Notes: - `order_ada` should cover the order's non-offer ADA, including min-UTxO needs and enough room for `max_protocol_fee`. - `owner_key_hash` should be the owner's stake credential hash for wallet orders. - For ADA offers, pass empty policy/name and the amount in `offer_amount`.
submit_withdrawal_any_pool
Post an untargeted withdrawal order to the Sundae order script. For wallet-facing integrations, prefer `submit_withdrawal`. Notes: - `order_ada` should cover min-UTxO needs and enough room for `max_protocol_fee`. - `owner_key_hash` should be the owner's stake credential hash for wallet orders. - `lp_policy` / `lp_name` identify the LP asset being withdrawn.
submit_withdrawal
Post a pool-targeted withdrawal order to the Sundae order script. This is the recommended wallet-facing withdrawal flow.
submit_deposit
Post a pool-targeted deposit order to the Sundae order script. This is the recommended wallet-facing deposit flow.
cancel_order
Cancel an existing order. Notes: - `owner_key_hash` should match the order datum owner key hash for simple signature-owned wallet orders. - The returned funds are paid back to `User`.
submit_deposit_any_pool
Post an untargeted deposit order to the Sundae order script. For wallet-facing integrations, prefer `submit_deposit`. Notes: - `order_ada` should cover the order's non-deposit ADA, including min-UTxO needs and enough room for `max_protocol_fee`. - `owner_key_hash` should be the owner's stake credential hash for wallet orders. - If one side of the deposit is ADA, pass empty policy/name for that side.
sundae-v3
Published by
@SundaeSwap-finance