A liquidity pool on Permaswap can be created permissionlessly by anyone through the factory process.
Factory process id: 5G5_ftQT6f2OsmJ8EZ4-84eRcIMNEmUyH9aQSD85f9I
The lua code example below use aos 2.0+.
The python code use ao.py v0.2.4+
Lua:
Factory = '5G5_ftQT6f2OsmJ8EZ4-84eRcIMNEmUyH9aQSD85f9I'
res = Send({Target=Factory, Action='GetAllPools'}).receive()
res.Data
res.Data contains all pools exists.
Python
import ao, json
factory = '5G5_ftQT6f2OsmJ8EZ4-84eRcIMNEmUyH9aQSD85f9I'
res = ao.dry_run(factory, '', {'Action':'GetAllPools'})
print(json.loads(res['Messages'][0]['Data']))
NodeJS
import { connect } from '@permaweb/aoconnect'
const defaultAOConfig = {
CU_URL: '<https://cu.ao-testnet.xyz>',
MU_URL: '<https://mu.ao-testnet.xyz>',
GATEWAY_URL: '<https://g8way.io:443>'
}
const ao = connect(defaultAOConfig)
const factory = '5G5_ftQT6f2OsmJ8EZ4-84eRcIMNEmUyH9aQSD85f9I'
const res = await ao.dryrun({
process: factory,
tags: [
{ name: 'Action', value: 'GetAllPools' },
]
})
const data = JSON.parse(res.Messages[0]['Data'])
console.log(data)
Lua: