1. AssetTransfer/Pay (Input):
Sender: user_address
Receiver: pool_address
Index: asset_1_id or asset_2_id
Amount: input_amount
2. AppCall:
a. Mode: Fixed Input
Sender: user_address
Index: tinyman_amm_v2_app_id
OnComplete: NoOp
App Args: [“swap”, “fixed-input”, min_output_amount]
Foreign Assets: [asset_1_id, asset_2_id]
Accounts: [pool_address]
Fee: (2 * min_fee)
b. Mode: Fixed Output
Sender: user_address
Index: tinyman_amm_v2_app_id
OnComplete: NoOp
App Args: [“swap”, “fixed-output”, output_amount]
Foreign Assets: [asset_1_id, asset_2_id]
Accounts: [pool_address]
Fee: (3 * min_fee)
- asset_1_reserves
- asset_2_reserves
- asset_1_protocol_fees
- asset_2_protocol_fees
- asset_1_cumulative_price
- asset_2_cumulative_price
- cumulative_price_update_timestamp
- input_asset_id
- input_amount
- swap_amount
- change
- output_asset_id
- output_amount
- poolers_fee_amount
- protocol_fee_amount
- total_fee_amount
1. AssetTransfer/Pay (Change):
****Change is possible, if the swap mode is fixed-output.
This transaction is issued, If there is a change.
Sender: pool_address
Receiver: user_address
Index: input_asset_id
Amount: (See formula IV.B)
2. AssetTransfer/Pay (Output)
Sender: pool_address
Receiver: user_address
Index: output_asset_id
Amount: (See formula IV)