Logo

fluid-aquarium

UnofficialPreliminary, reverse-engineered version published by the tx3 team for testing and exploration. It is not endorsed by the original protocol authors. Do not use in mainnet. • v0.1.0

About this Protocol

Babel fees and scheduled transactions on Cardano by FluidTokens

Parties

The participants involved in this protocol's transactions.

tankscriptTank validator at an enterprise address (no staking cred) used for the ref script.
batcherBatcher / Aquarium node operator that executes scheduled txs and babel fees.
tankuseraddrTank spend validator address that holds tank UTxOs.
oraclescriptOracle reward (stake) address used for withdrawal-based oracle validation.
rewardsaddrRewards treasury address that receives batcher rewards.
userThe user creating/managing a tank.

Environment

Configuration values required to execute this protocol's transactions.

fldt_nameFLDT token asset name (CIP-68 user token)./$defs/Bytes
fldt_policyFLDT token policy id (CIP-68 user token)./$defs/Bytes
oracle_contract_refOracle contract reference UTxO (stable deployment artifact)./$defs/UtxoRef
oracle_feed_refOracle price feed reference UTxO (stable deployment artifact)./$defs/UtxoRef
oracle_script_hashOracle contract script hash for withdrawal-based oracle validation./$defs/Bytes
params_nft_nameParameters NFT asset name used to identify the params UTxO./$defs/Bytes
params_policyParameters contract script hash for NFT identification./$defs/Bytes
params_refParameters contract NFT UTxO used as a reference input./$defs/UtxoRef
staker_policyStaker contract script hash for node staking./$defs/Bytes
tank_refUTxO carrying the tank contract reference script./$defs/UtxoRef

Transactions

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

execute_scheduled

Execute a scheduled tank, paying the destination and collecting the batcher reward.

Diagram

execute_scheduledbatcher_addr_cborbatcher_signer_hashdest_adaref_params_idxref_staking_idxreward_adastaker_reftank_utxo batcher batcher rewardsaddr user batcher_input tank_input output 3 output 2 output 1

Parameters

batcher_addr_cborBytesBatcher address as CBOR-encoded PlutusAddress (passed through to redeemer).
batcher_signer_hashBytesBatcher's signer key hash required on the tx.
dest_adaIntADA (lovelace) delivered to the scheduled destination.
ref_params_idxIntIndex of the params ref input within reference inputs (sorted).
ref_staking_idxIntIndex of the staker ref input within reference inputs (sorted).
reward_adaIntADA (lovelace) reward paid to the batcher / rewards treasury.
staker_refUtxoRefUTxO reference of the batcher's staker registration.
tank_utxoUtxoRefUTxO reference of the scheduled tank to execute.

Inputs

tank_inputscript
batcher_inputbatcherwallet

Outputs

usernono
rewardsaddrnono
batchernono

consume_oracle

Consume a babel-fee tank using an oracle price feed to pay the user's fees in tokens.

Diagram

consume_oracledest_adainput_tank_idxoracle_denominatororacle_idxoracle_priceoracle_provider_idxoracle_provider_reforacle_valid_fromoracle_valid_topaying_token_idxpayment_adapayment_token_namepayment_token_policypayment_token_qtyref_params_idxtank_return_adatank_utxo user tankuseraddr user user_input tank_input output 1 output 2 output 3 output 4

Parameters

dest_adaIntADA (lovelace) delivered to the user's destination output.
input_tank_idxIntIndex of the tank input within tx inputs (sorted).
oracle_denominatorIntOracle-quoted price denominator.
oracle_idxIntIndex of the oracle reference input within reference inputs (sorted).
oracle_priceIntOracle-quoted price numerator.
oracle_provider_idxIntCharli3 oracle provider index within the price feed.
oracle_provider_refUtxoRefUTxO reference of the oracle provider data (e.g. Charli3).
oracle_valid_fromIntLower bound (slot) of the oracle price validity window.
oracle_valid_toIntUpper bound (slot) of the oracle price validity window.
paying_token_idxIntIndex of the paying token within the tank's allowed_tokens list.
payment_adaIntADA (lovelace) paid alongside tokens to the tank owner.
payment_token_nameBytesAsset name of the token used to pay the tank owner.
payment_token_policyBytesPolicy id of the token used to pay the tank owner.
payment_token_qtyIntQuantity of the payment token delivered to the tank owner.
ref_params_idxIntIndex of the params reference input within reference inputs (sorted).
tank_return_adaIntADA (lovelace) returned to the tank UTxO.
tank_utxoUtxoRefUTxO reference of the tank being consumed.

Inputs

tank_inputscript
user_inputuserwallet

Outputs

tankuseraddryesno
usernono
usernono
usernono

stake_fldt

Stake FLDT and mint the staker NFT that registers the caller as an Aquarium node.

Diagram

stake_fldtsigner_hashstake_amountstaker_nft_namestaker_redeemer_cbor user tankuseraddr user source output 1 output 2

Parameters

signer_hashBytesRequired signer key hash on the tx.
stake_amountIntQuantity of FLDT tokens to stake.
staker_nft_nameBytesStaker NFT asset name (typically the bot's stake key hash).
staker_redeemer_cborBytesCBOR-encoded StakerRedeemer used for the mint.

Inputs

sourceuserwallet

Outputs

tankuseraddrnono
usernono

create_babel_tank

Create a babel-fee tank by locking ADA at the tank script with an accepted-tokens datum.

Diagram

create_babel_tankempty_bytesowner_payment_hashowner_stake_hashtank_ada user tankuseraddr user source output 1 output 2

Parameters

empty_bytesBytesEmpty byte string placeholder used for unset policy/name fields.
owner_payment_hashBytesTank owner's payment key hash (28 bytes).
owner_stake_hashBytesTank owner's stake key hash (28 bytes).
tank_adaIntADA (lovelace) to deposit into the new tank.

Inputs

sourceuserwallet

Outputs

tankuseraddryesno
usernono

create_scheduled_tank

Create a scheduled-transaction tank that will pay a destination after a future execution time.

Diagram

create_scheduled_tankempty_bytesexecution_timeowner_payment_hashowner_stake_hashreward_adascheduled_adatank_ada user tankuseraddr user source output 1 output 2

Parameters

empty_bytesBytesEmpty byte string placeholder used for unset policy/name fields.
execution_timeIntPOSIX-time slot at which the scheduled tx becomes executable.
owner_payment_hashBytesTank owner's payment key hash (28 bytes).
owner_stake_hashBytesTank owner's stake key hash (28 bytes).
reward_adaIntADA (lovelace) reward paid to the batcher that executes the tx.
scheduled_adaIntADA (lovelace) to send to the destination when executed.
tank_adaIntADA (lovelace) to deposit into the new tank.

Inputs

sourceuserwallet

Outputs

tankuseraddryesno
usernono

withdraw_tank

Withdraw the full balance of a tank back to its owner.

Diagram

withdraw_tanktank_utxo user user owner_proof tank_input output 1

Parameters

tank_utxoUtxoRefUTxO reference of the tank to withdraw.

Inputs

tank_inputscript
owner_proofuserwallet

Outputs

usernono

Profiles

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

mainnet
tankscriptaddr1w8uhynz89x08gh95758e6dkthtwdlplqzk5an8vj0hzwsesq3894wparty
oraclescriptstake17ywndcktrttztyywx7zwhz7wa6at2v066neeq7g7rpxdgzqdv8vq6party
rewardsaddraddr1z82egrwz4k0r7s65f7cz52pypus4vqnq8f63jky9x2mjc56lfhq9y589598hgu6nwqf5440e2p477trfuz72995ktu7sx5rxemparty
batcheraddr1q94pdst75jp2p7juf3hl0mk8nsa27uxrhyc9ya64ercy5tdvq0yl4h4tcndgdtd5j3eqp6sezqu4s8xxh779axr5c5eq77jk26party
fldt_name0014df10464c4454env
fldt_policy577f0b1342f8f8f4aed3388b80a8535812950c7a892495c0ecdf0f1eenv
oracle_contract_reffef0fcfc38cace7e8aac85ddc6fad895ca4e7e80a0c01a5836094e387d38f591#0env
oracle_feed_ref7f3bb225b601685e5212935db87b509f7c00fcbb05c36126eb16be1e98aedcc2#0env
oracle_script_hash1d36e2cb1ad625908e3784eb8bceeebab531fad4f390791e184cd408env
params_nft_name706172616d6574657273env
params_policyf0e403df77b2bfee7c0799ef927b3763165033cbe38bddc802934883env
params_refb79f33b820dd572394cf93e8a4ad1a67ee2d46dbf69ac6ceca33de0d6ff56476#0env
staker_policybae773ecdbabb746d2dcd7d1630a5761180b19766803b8a65fa52901env
tank_ref354ffe7958d62a8a2bf0b0bd97a06694d59dc49b6d02f1ab40165a3955257168#0env
Back to all Protocols