Deploy Smart Contract Template AMM Pool
The AMM template is one of the smart contract templates currently live on the SatoshiNet public testnet. It validates AMM logic under the SatoshiNet smart contract framework with whole-network consensus execution, canonical Result TX, and contract state root.
Note: The AMM in PWA Market or DEX is an L2 market Channel Contract capability, not the smart contract template AMM discussed here. The template AMM in this page can only be accessed from PWA Tools -> Smart Contracts.
Current Status
Contract type
Template Contract
Template
AMM
Environment
SatoshiNet public testnet
Mainnet status
Not open yet
Fee asset
Test GAS
Interaction entry
PWA Tools -> Smart Contracts
Basic Flow
The deployer selects the trading asset.
Select the AMM template in PWA
Tools -> Smart Contracts.Set initial asset amount, initial sats amount, and constant K.
Deploy the AMM template contract.
Add initial liquidity to the contract so that asset pool, sats pool, and
asset * sats >= Ksatisfy ready conditions.Invoke
swapto buy or sell.Invoke
addliqorremoveliqto adjust liquidity.The block producer generates canonical Result TX.
Wallet, Explorer, and Indexer show pool state, trade result, and LP share.
Deployment Parameters
AMM template deployment should at least include:
Asset name
Pool trading asset, using SatoshiNet asset name format
Initial asset amount
Initial asset amount entering the pool
Initial sats amount
Initial satoshi amount entering the pool
K
Initial constant-product constraint
Before testnet deployment, check:
The wallet has test GAS.
The target asset is available on SatoshiNet.
Initial asset and initial sats can enter the contract address.
Initial K matches liquidity size.
The deployer understands that testnet may restart or roll back.
Invocation Interfaces
Current core actions of the AMM template:
swap
Buy or sell
refund
Withdraw refundable assets
addliq
Add liquidity
removeliq
Remove liquidity
Input amount is determined by the funding output transferred to the contract address in the Call TX. Invocation parameters should only express direction, minimum acceptable output, slippage constraint, deadline, or other values that cannot be inferred from funding output.
Verification Checklist
Whether Deploy TX created the AMM contract address.
Whether initial liquidity entered the contract address.
Whether the contract entered ready state.
Whether swap invocation generated the expected Result TX.
Whether Result TX sent output asset to the user.
Whether LP share and pool balance changed after adding or removing liquidity.
Whether Explorer / Indexer / wallet display is consistent.
Risk Boundary
The current AMM template contract is testnet-only.
Pool price is determined by test assets and test liquidity and does not represent real market price.
Testnet confirmation, indexing, and Result TX display may be delayed.
Without Result TX or state evidence, page balance should not be treated as final result.
Page Status: In Development
Last updated