______
_| | port0.sh |
 ̄| | ̄ ̄ ̄ ̄ x父父x
| | ∩ 爻爻爻
___| |_,|_|__ ⌒VV⌒
¨¨¨| |¨゙丁|゚~n xXXx, } :{
____| |_,|_|_,,|:|__ 爻爻爻 } :{
¨¨¨¨¨| |¨゙丁|¨Π¨ ⌒VV⌒ } :{
┌ー‐| |─:| |‐:|:|‐━=/゙| ̄`'i========━ー─‐-- }::[ } :{ _____
___|__,| |_,|_|_,,|:|_ | :| | | }::[ } :{ .|\ _,ニ-
¨¨¨¨|¨¨¨| |¨゙丁|¨Π¨¨ :| :| | | ̄ ̄ ̄|_,|三| x父父x | }::[ } :{ _」 ``''"´,、,、,vivi
|¨¨¨¨| |¨¨:| |¨:|:|¨¨¨¨|/`丶、|丁 ̄ ̄ ̄ |三| '⌒}:[⌒ | }::{ _,.、} :{ ' ´ ┌;';';';';';';';';';';';';'
丕丕 | | | :| |_,,|:|"´ ̄| ̄ ̄¨¨¨ " i ___,,,|..、 --‐‐}:{…¬冖}::{' "´ } :{ |xX爻爻爻爻
|| | ̄ ̄ ̄ ̄| | ̄:| | |:|-‐…|¬ … ─--|:|__xXXx__}:{___}::{.____ } :{ xX爻淡淡淡淡淡
i¨¨¨¨¨¨¨||¨¨¨¨¨¨¨¨¨¨¨¨|二二二二.| |二:| |¨:|:|.:.:.:.:. | ::::::::::::::::: | ̄|______,}:{__}:{匚匚匚}::{匚匚]=} :{xX爻淡淡淡淡淡淡
ー┴ー──:||─────‐〈\.|¨¨¨¨¨¨| |¨¨:| |¨:|:|.:.:.:.:. | ::::::::::::::::: |_|「「「「「「「}:{vviVi}:{从从从}::{从v_从} :{爻淡淡淡淡淡㌻¨
 ̄| ̄| ̄| ̄|| ̄| ̄xi爻爻爻|\\ | ̄| | ̄:| |,_,|:|.:.:.:.:. | :::::::::::::::::::: |x爻爻爻}:{爻爻}:{爻爻爻}::{乂,| ̄;;} :{爻淡淡淡淡㌻
TTTTTTTTTTTTTTTTTTTT|∨ ̄ニ=- _|_|_| ̄|ニT冖冖¬ー┼YYYYY}:{爻淡}:{厂厂√}::{>'| } :{‐‐┴┐ ̄ ̄>''´
────────────‐|.:.:.  ̄ ̄|───‐ 「| ̄ ̄ ̄´""''ー=:}:{_i> ´};;{_,|_,,ノ}_,{ニ=- ┴>''´__
゚。.:.:. .ノ|¨| ´"''ー=ニ,,__.:.:.:.:.:.:.:>''´r─┤__
\j_,,.. -‐… "´ 」 ̄ |  ̄´´"" '' ー|__,|
| ¨二|  ̄¨¨'冖
| ./ /|. . . .
/ / :| : : : : : : : : . . . . . . . . .
| ̄| |: : : : : : : : : : : : : : :: : : : : : : :: : : : : : . . . . . ..
//| | | . . . . . . . : : : : : : : : : : . . . . .
port0.sh
port0.sh is an open-source exchange built on Miden. A constant-product automated market maker holds a pair of fungible assets in a pool, prices them by the product of the two reserves, and lets any account trade, deposit, or withdraw against the pool. Any token can dock.
The name comes from three places. A program that binds to port 0 asks the operating system for any free port. A free port is a harbor where any ship can dock. A free port charges no customs duties: goods land and leave without a tax. The third meaning is the product. The registry accepts a code commitment and lists the pool. There is no customs house.
Components
| Component | Repository | Role |
|---|---|---|
| Contracts | port0_contracts | Pool account component, registry account component, and note scripts |
| SDK | port0_sdk | TypeScript client for quotes, note building, pool reads, and pool operations |
| Indexer | port0_indexer | Reads the registry and pools over node RPC and serves an HTTP API |
| App | port0_app | Static web application to browse pools, trade, provide liquidity, and create pools |
Status
port0.sh runs on Miden testnet 0.17.1. The code is unaudited and no audit report exists. Pools and notes are public network accounts: pool state and XYK notes are visible on chain. Nothing here is financial advice.
Reading order
A reader new to the system starts with the constant-product AMM and accounts and notes. A builder reading the interfaces continues with contracts and the SDK. An operator deploying the stack reads the runbook. The repositories chapter lists the canonical source and every mirror.