Logo

vyfi

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

VyFi DEX - AMM order submission protocol

Parties

The participants involved in this protocol's transactions.

orderscriptPer-pool order script address; supplied dynamically per transaction.
userThe end user submitting the AMM order.

Environment

Configuration values required to execute this protocol's transactions.

process_feeProcess fee charged by VyFi batchers, in lovelace (typically 1.9 ADA).integer

Transactions

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

remove_liquidity

Remove liquidity from a pool by burning LP tokens.

Diagram

remove_liquiditylp_amountlp_namelp_policymin_out_adamin_out_tokenorder_adauser_creds user orderscript user source output 1 output 2

Parameters

lp_amountIntAmount of LP tokens to burn.
lp_nameBytesLP token asset name.
lp_policyBytesLP token policy ID.
min_out_adaIntMinimum ADA (lovelace) to receive back.
min_out_tokenIntMinimum token B to receive back.
order_adaIntADA to attach to the order UTxO (min UTxO + process fee).
user_credsBytesUser credentials: payment_cred (28 bytes) || stake_cred (28 bytes).

Inputs

sourceuserwallet

Outputs

orderscriptyesno
usernono

swap_a_to_b

Swap ADA for the pool's token (A → B) by posting an order to the script address.

Diagram

swap_a_to_bmin_outswap_amountuser_creds user orderscript user source output 1 output 2

Parameters

min_outIntMinimum amount of token B to receive.
swap_amountIntAmount of ADA (lovelace) to swap.
user_credsBytesUser credentials: payment_cred (28 bytes) || stake_cred (28 bytes).

Inputs

sourceuserwallet

Outputs

orderscriptyesno
usernono

swap_b_to_a

Swap the pool's token for ADA (B → A) by posting an order to the script address.

Diagram

swap_b_to_amin_outorder_adatoken_amounttoken_nametoken_policyuser_creds user orderscript user source output 1 output 2

Parameters

min_outIntMinimum amount of ADA (lovelace) to receive.
order_adaIntADA to attach to the order UTxO (min UTxO + process fee).
token_amountIntAmount of token B to swap.
token_nameBytesToken B asset name.
token_policyBytesToken B policy ID.
user_credsBytesUser credentials: payment_cred (28 bytes) || stake_cred (28 bytes).

Inputs

sourceuserwallet

Outputs

orderscriptyesno
usernono

add_liquidity

Add liquidity to a pool by depositing ADA and the paired token.

Diagram

add_liquidityada_amountdesired_lptoken_amounttoken_nametoken_policyuser_creds user orderscript user source output 1 output 2

Parameters

ada_amountIntAmount of ADA (lovelace) to deposit.
desired_lpIntMinimum LP tokens to receive.
token_amountIntAmount of token B to deposit.
token_nameBytesToken B asset name.
token_policyBytesToken B policy ID.
user_credsBytesUser credentials: payment_cred (28 bytes) || stake_cred (28 bytes).

Inputs

sourceuserwallet

Outputs

orderscriptyesno
usernono

Profiles

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

mainnet
process_fee1900000env
Back to all Protocols