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
  • Transaction Group:
  • Validator App State Changes

Was this helpful?

  1. V1 Integration
  2. Transaction Specifications

Redeem Protocol Fees

Transfer collected protocol fees to the CREATOR account.

Note: The CREATOR must opt-in to the liquidity assets separately before receiving them.

Transaction Group:

0. Pay - pay fees in Algo from User to Pool

  • fees to cover Tx 1,2

  • Signed by User

{
  "txn": {
    "type": "pay",
    "rcv": "{POOL_ADDRESS}",
    "snd": "{USER_ADDRESS",
    "amt": 2000,
    ...
  },
  "sig": "{USER_SIG}",
}
  1. App Call - NoOp call to Validator App with args ['fees']

  • Signed by Pool LogicSig

{
  "txn": {
    "type": "appl",
    "snd": "{POOL_ADDRESS}",
    "apid": {VALIDATOR_APP_ID},
    "apan": 0, // OnComplete: NoOp
    "apaa": ['ZmVlcw=='], // ['fees']
    "apas": [{ASSET1_ID}, {ASSET2_ID}, {LIQUIDITY_ASSET_ID}], // or just [{ASSET1_ID}, {LIQUIDITY_ASSET_ID}] if asset 2 is Algo
    ...
  },
  "lsig": "{POOL_LOGICSIG}",
}

2. AssetTransfer - Transfer of liquidity asset from Pool to CREATOR account

  • Signed by Pool LogicSig

{
  "txn": {
    "type": "axfer",
    "arcv": "{CREATOR_ADDRESS}",
    "snd": "{POOL_ADDRESS}",
    "xaid": {LIQUIDITY_ASSET_ID},
    "aamt": {ASSET_AMOUNT},
    ...
  },
  "lsig": "{POOL_LOGICSIG}",
}

Validator App State Changes

Global State

None

Pool Account Local State

  • o{LIQUIDITY_ASSET_ID}: {int} // total outstanding unredeemed liquidity asset amount

  • p: {int} // unclaimed protocol fee liquidity asset amount

Creator Local State

None

PreviousCreate Validator AppNextOfficial SDKs

Last updated 2 years ago

Was this helpful?