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
  • Trigger Orders & Recurring Orders
  • 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

Bootstrap Pool

Setup a Pool for a pair of assets. The Pool account should be a LogicSig contract account.

Transaction Group

0. Pay - pay fees from Pooler to Pool

  • fees to cover Tx 1,2,3,4

  • Signed by Pooler

{
  "txn": {
    "type": "pay",
    "rcv": "{POOL_ADDRESS}",
    "snd": "{POOLER_ADDRESS",
    "amt": 960000,
    "fee": 1000,
    "note": "",
    ...
  },
  "sig": "{POOLER_SIG}",
}
  1. App Call - OptIn call to Validator App with args ['bootstrap', asset1ID, asset2ID]

  • signed by Pool LogicSig

{
  "txn": {
    "type": "appl",
    "snd": "{POOL_ADDRESS}",
    "apid": {VALIDATOR_APP_ID},
    "apan": 1, // OnComplete: OptIn
    "apaa": ['Ym9vdHN0cmFw', '{ASSET1_ID}', '{ASSET2_ID}'], // ['bootstrap', asset1ID, asset2ID]
    "apas": [{ASSET1_ID}, {ASSET2_ID}], // or just [{ASSET1_ID}] if asset 2 is Algo
    "fee": 1000,
    ...
  },
  "lsig": "{POOL_LOGICSIG}",
}

2. AssetConfig - create asset for liquidity token

  • signed by Pool LogicSig

{
  "txn": {
    "type": "acfg"
    "snd": "{POOL_ADDRESS}",
    "fee": 1000,
    "apar": {
      "an": "Tinyman Pool USDC-ALGO",
      "un": "TM1POOL"
      "au": "https://tinyman.org",
      "t": 18446744073709551615, // 0xFFFFFFFFFFFFFFFF
      "dc": 6,
    },
    ...
  },
  "lsig": "{POOL_LOGICSIG}",
}

3. Asset OptIn - Pool opt in to Asset 1

  • signed by Pool LogicSig

{
  "txn": {
    "type": "axfer",
    "arcv": "{POOL_ADDRESS}",
    "snd": "{POOL_ADDRESS}",
    "fee": 1000,
    "xaid": {ASSET_1_ID},
    ...
  },
  "lsig": "{POOL_LOGICSIG}",
}

4. (Optional) Asset OptIn - Pool opt in to Asset 2

  • Only if Asset 2 is not Algo

  • signed by Pool LogicSig

{
  "txn": {
    "type": "axfer",
    "snd": "{POOL_ADDRESS}",
    "arcv": "{POOL_ADDRESS}",
    "fee": 1000,
    "xaid": {ASSET_2_ID},
    ...
  },
  "lsig": "{POOL_LOGICSIG}",
}

Validator App State Changes

Global State

None

Pool Account Local State

  • a1: {int} // ASSET1_ID

  • a2: {int} // ASSET2_ID

PreviousTransaction SpecificationsNextOptIn

Last updated 2 years ago

Was this helpful?