Tinyman Docs
Search…
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
1
{
2
"txn": {
3
"type": "pay",
4
"rcv": "{POOL_ADDRESS}",
5
"snd": "{POOLER_ADDRESS",
6
"amt": 960000,
7
"fee": 1000,
8
"note": "",
9
...
10
},
11
"sig": "{POOLER_SIG}",
12
}
Copied!
  1. 1.
    App Call - OptIn call to Validator App with args ['bootstrap', asset1ID, asset2ID]
  • signed by Pool LogicSig
1
{
2
"txn": {
3
"type": "appl",
4
"snd": "{POOL_ADDRESS}",
5
"apid": {VALIDATOR_APP_ID},
6
"apan": 1, // OnComplete: OptIn
7
"apaa": ['Ym9vdHN0cmFw', '{ASSET1_ID}', '{ASSET2_ID}'] // ['bootstrap', asset1ID, asset2ID]
8
"apas": [{ASSET1_ID}, {ASSET1_ID}] // or just [{ASSET1_ID}] if asset 2 is Algo
9
"fee": 1000,
10
...
11
},
12
"lsig": "{POOL_LOGICSIG}",
13
}
Copied!
2. AssetConfig - create asset for liquidity token
  • signed by Pool LogicSig
1
{
2
"txn": {
3
"type": "acfg"
4
"snd": "{POOL_ADDRESS}",
5
"fee": 1000,
6
"apar": {
7
"an": "Tinyman Pool USDC-ALGO",
8
"un": "TM1POOL"
9
"au": "https://tinyman.org",
10
"t": 18446744073709551615, // 0xFFFFFFFFFFFFFFFF
11
"dc": 6,
12
},
13
...
14
},
15
"lsig": "{POOL_LOGICSIG}",
16
}
Copied!
3. Asset OptIn - Pool opt in to Asset 1
  • signed by Pool LogicSig
1
{
2
"txn": {
3
"type": "axfer",
4
"arcv": "{POOL_ADDRESS}",
5
"snd": "{POOL_ADDRESS}",
6
"fee": 1000,
7
"xaid": {ASSET_1_ID},
8
...
9
},
10
"lsig": "{POOL_LOGICSIG}",
11
}
Copied!
4. (Optional) Asset OptIn - Pool opt in to Asset 2
  • Only if Asset 2 is not Algo
  • signed by Pool LogicSig
1
{
2
"txn": {
3
"type": "axfer",
4
"snd": "{POOL_ADDRESS}",
5
"arcv": "{POOL_ADDRESS}",
6
"fee": 1000,
7
"xaid": {ASSET_2_ID},
8
...
9
},
10
"lsig": "{POOL_LOGICSIG}",
11
}
Copied!

Validator App State Changes

Global State

None

Pool Account Local State

  • a1: {int} // ASSET1_ID
  • a2: {int} // ASSET2_ID