Tinyman Docs
  • Tinyman V2 Overview
  • About Tinyman
  • Protocol Specification
    • Pool
      • Pool Creation
      • Adding Liquidity
      • Removing Liquidity
    • Swap
    • Fees
    • Flash Loan
    • Flash Swap
    • Additional Notes
  • FAQ
    • Migration FAQ
  • Fees
  • Permissioned Methods
    • Roles
    • Methods
    • Related Non-Permissioned Methods
  • Formulae
  • Disclaimer
  • Contracts
  • Audits & Security
  • Token and Governance
    • TINY Token Details
    • Governance Details
      • Overview
      • Governance Vault
      • Governance Rewards
      • Governance Process
      • TINY Farming
  • V2 Integration
    • Protocol Methods
      • Bootstrap
      • Add Initial Liquidity
      • Add Subsequent Liquidity
      • Remove Liquidity
      • Swap
      • Flash Loan
      • Flash Swap
    • State Data
    • Oracle Data
    • Calculating Quotes
    • Official SDKs
  • Swap Router
    • Transaction Specification
  • Swap Widget
    • Customization Preferences
    • How to export your Widget
  • Lending Pools
  • Liquid Staking
    • Liquid Staking
  • Tinyman V1
    • Overview
    • Tinyman AMM Basics
      • Creating Pools
      • Slippage & Excess
      • Farming
    • FAQ
    • Fees
    • Design Doc
    • Contracts
    • Tinyman Testnet
    • Disclaimer
    • Audits
    • Security
  • V1 Integration
    • Pool Lookup
    • Transaction Specifications
      • Bootstrap Pool
      • OptIn
      • Swap
      • Mint
      • Burn
      • Redeem
      • Create Validator App
      • Redeem Protocol Fees
    • Official SDKs
    • Community SDKs
  • Tinyman Presentations
  • Known Issues
    • 2021-11-12 - Pool overflow errors
Powered by GitBook
On this page
  • A. Flexible
  • Transactions
  • Side Effects
  • B. Single Asset
  • Transactions
  • Side Effects

Was this helpful?

  1. V2 Integration
  2. Protocol Methods

Add Subsequent Liquidity

A. Flexible

Transactions

1. AssetTransfer:

Sender: user_address Receiver: pool_address Index: asset_1_id Amount: asset_1_amount

2. AssetTransfer/Pay:

Sender: user_address; Receiver: pool_address Index: asset_2_id Amount: asset_2_amount

3. AppCall:

Sender: user_address Index: tinyman_amm_v2_app_id OnComplete: NoOp App Args: [“add_liquidity”, “flexible”, min_output] Foreign Assets: [pool_token_asset_id] Accounts: [pool_address] Fee: (3 * min_fee)

Side Effects

Local State Changes

  1. asset_1_reserves

  2. asset_2_reserves

  3. issued_pool_tokens

  4. asset_1_protocol_fees

  5. asset_2_protocol_fees

  6. asset_1_cumulative_price

  7. asset_2_cumulative_price

  8. cumulative_price_update_timestamp

Logs

  1. input_asset_id

  2. output_asset_id

  3. swap_amount

  4. poolers_fee_amount

  5. protocol_fee_amount

  6. total_fee_amount

Inner Transactions

1. App Call (to increase op code budget):

2. AssetTransfer:

B. Single Asset

Transactions

1. AssetTransfer/Pay:

Sender: user_address Receiver: pool_address Index: asset_id Amount: asset_amount

2.AppCall:

Sender: user_address Index: tinyman_amm_v2_app_id OnComplete: NoOp

Side Effects

Local State Changes

  1. asset_1_reserves

  2. asset_2_reserves

  3. issued_pool_tokens

  4. asset_1_protocol_fees

  5. asset_2_protocol_fees

  6. asset_1_cumulative_price

  7. asset_2_cumulative_price

  8. cumulative_price_update_timestamp

Logs

  1. input_asset_id

  2. output_asset_id

  3. swap_amount

  4. poolers_fee_amount

  5. protocol_fee_amount

  6. total_fee_amount

Inner Transactions

1. App Call (to increase op code budget):

2. AssetTransfer:

PreviousAdd Initial LiquidityNextRemove Liquidity

Last updated 2 years ago

Was this helpful?

It is for increasing the opcode (computational) which is required for internal swap calculations.

Sender: pool_address Receiver: user_address Index: pool_token_asset_id Amount: (See formula for pool token calculation)

It is for increasing the opcode (computational) which is required for internal swap calculations.

Sender: pool_address Receiver: user_address Index: pool_token_asset_id Amount: (See formula for pool token calculation)

budget
budget
II.B
II.B