Logo

sundae-v3

@SundaeSwap-finance

• v0.1.0

About this Protocol

Protocol for the user-facing actions of Sundae V3

Parties

The participants involved in this protocol's transactions.

userThe wallet building, funding, and signing the transaction.
orderscriptThe deployed Sundae order script address for the selected network.

Environment

Configuration values required to execute this protocol's transactions.

min_collateral_adaCollateral floor for script-spending txs such as `cancel_order`.integer
order_script_refUTxO carrying the Sundae order reference script./$defs/UtxoRef

Transactions

The transactions defined in this protocol, with their parameters, inputs, and outputs.

submit_swap

Post a pool-targeted swap order. Recommended wallet-facing flow.

Diagram

submit_swapdestination_payment_key_hashdestination_stake_key_hashmax_protocol_feemin_received_amountmin_received_namemin_received_policyoffer_amountoffer_nameoffer_policyorder_adaowner_key_hashpool_ident user orderscript user source order_utxo output 2

Parameters

destination_payment_key_hashBytesPayment key hash for the execution destination.
destination_stake_key_hashBytesStake key hash for the execution destination.
max_protocol_feeIntMaximum ADA protocol fee allowed by the order.
min_received_amountIntMinimum quantity acceptable from execution.
min_received_nameBytesRequested asset name, or empty bytes for ADA.
min_received_policyBytesRequested asset policy id, or empty bytes for ADA.
offer_amountIntOffered asset quantity in on-chain units.
offer_nameBytesOffered asset name, or empty bytes for ADA.
offer_policyBytesOffered asset policy id, or empty bytes for ADA.
order_adaIntLovelace locked on the order UTxO.
owner_key_hashBytesStake key hash used as the order owner.
pool_identBytesTarget Sundae pool identifier.

Inputs

sourceuserwallet

Outputs

orderscriptyesno
usernoyes

submit_withdrawal

Post a pool-targeted withdrawal order. Recommended wallet-facing flow.

Diagram

submit_withdrawaldestination_payment_key_hashdestination_stake_key_hashlp_amountlp_namelp_policymax_protocol_feeorder_adaowner_key_hashpool_ident user orderscript user source order_utxo output 2

Parameters

destination_payment_key_hashBytesPayment key hash for the withdrawal destination.
destination_stake_key_hashBytesStake key hash for the withdrawal destination.
lp_amountIntLP token quantity in on-chain units.
lp_nameBytesLP token asset name.
lp_policyBytesLP token policy id.
max_protocol_feeIntMaximum ADA protocol fee allowed by the order.
order_adaIntLovelace locked on the order UTxO.
owner_key_hashBytesStake key hash used as the order owner.
pool_identBytesTarget Sundae pool identifier.

Inputs

sourceuserwallet

Outputs

orderscriptyesno
usernoyes

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.

Diagram

submit_deposit_any_poolasset_a_amountasset_a_nameasset_a_policyasset_b_amountasset_b_nameasset_b_policydestination_payment_key_hashdestination_stake_key_hashmax_protocol_feeorder_adaowner_key_hash user orderscript user source order_utxo output 2

Parameters

asset_a_amountInt
asset_a_nameBytes
asset_a_policyBytes
asset_b_amountInt
asset_b_nameBytes
asset_b_policyBytes
destination_payment_key_hashBytes
destination_stake_key_hashBytes
max_protocol_feeInt
order_adaInt
owner_key_hashBytes

Inputs

sourceuserwallet

Outputs

orderscriptyesno
usernoyes

cancel_order

Cancel an existing order and return its funds to `User`. `owner_key_hash` should match the order datum owner key hash for simple signature-owned wallet orders.

Diagram

cancel_orderorder_utxoowner_key_hash orderscript user user order_input fee_source output 1

Parameters

order_utxoUtxoRefOrder UTxO to spend with the `Cancel` redeemer.
owner_key_hashBytesStake key hash matching the order owner for simple wallet-owned orders.

Inputs

fee_sourceuserwallet
order_inputorderscriptscript

Outputs

usernono

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`.

Diagram

submit_swap_any_pooldestination_payment_key_hashdestination_stake_key_hashmax_protocol_feemin_received_amountmin_received_namemin_received_policyoffer_amountoffer_nameoffer_policyorder_adaowner_key_hash user orderscript user source order_utxo output 2

Parameters

destination_payment_key_hashBytes
destination_stake_key_hashBytes
max_protocol_feeInt
min_received_amountInt
min_received_nameBytes
min_received_policyBytes
offer_amountInt
offer_nameBytes
offer_policyBytes
order_adaInt
owner_key_hashBytes

Inputs

sourceuserwallet

Outputs

orderscriptyesno
usernoyes

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.

Diagram

submit_withdrawal_any_pooldestination_payment_key_hashdestination_stake_key_hashlp_amountlp_namelp_policymax_protocol_feeorder_adaowner_key_hash user orderscript user source order_utxo output 2

Parameters

destination_payment_key_hashBytes
destination_stake_key_hashBytes
lp_amountInt
lp_nameBytes
lp_policyBytes
max_protocol_feeInt
order_adaInt
owner_key_hashBytes

Inputs

sourceuserwallet

Outputs

orderscriptyesno
usernoyes

submit_deposit

Post a pool-targeted deposit order. Recommended wallet-facing flow.

Diagram

submit_depositasset_a_amountasset_a_nameasset_a_policyasset_b_amountasset_b_nameasset_b_policydestination_payment_key_hashdestination_stake_key_hashmax_protocol_feeorder_adaowner_key_hashpool_ident user orderscript user source order_utxo output 2

Parameters

asset_a_amountIntFirst deposit asset quantity in on-chain units.
asset_a_nameBytesFirst deposit asset name, or empty bytes for ADA.
asset_a_policyBytesFirst deposit asset policy id, or empty bytes for ADA.
asset_b_amountIntSecond deposit asset quantity in on-chain units.
asset_b_nameBytesSecond deposit asset name, or empty bytes for ADA.
asset_b_policyBytesSecond deposit asset policy id, or empty bytes for ADA.
destination_payment_key_hashBytesPayment key hash for the LP destination.
destination_stake_key_hashBytesStake key hash for the LP destination.
max_protocol_feeIntMaximum ADA protocol fee allowed by the order.
order_adaIntLovelace locked on the order UTxO.
owner_key_hashBytesStake key hash used as the order owner.
pool_identBytesTarget Sundae pool identifier.

Inputs

sourceuserwallet

Outputs

orderscriptyesno
usernoyes

Profiles

Pre-configured sets of environment and party values for different deployment targets.

local
min_collateral_ada5000000env
order_script_ref0x0000000000000000000000000000000000000000000000000000000000000000env
preview
orderscriptaddr_test1wr866xg5kkvarzll69xjh0tfvqvu9zvuhht2qve9ehmgp0qfgf3wcparty
min_collateral_ada5000000env
order_script_ref0x92ec2274938de291d3837b7facf9eddfaed57cd6ff97e26af57cb7a9978e3887env
mainnet
orderscriptaddr1w8ax5k9mutg07p2ngscu3chsauktmstq92z9de938j8nqacprc9mwparty
min_collateral_ada5000000env
order_script_ref0xf5f1bdfad3eb4d67d2fc36f36f47fc2938cf6f001689184ab320735a28642cf2env
Back to all Protocols