Simulation ยท no real tokens move
An OTC desk written in Phil
A maker lists tokens with a desk at a price per token. Round by round a taker buys some, or passes. A listing ends when it sells out, expires, or the maker cancels. With several listings, a book offers the cheapest one first.
Tokens and cash are linear values in the program, so Phil rejects any desk or book that keeps, copies or loses one. Set the terms and run the real program below.
Try
Try
Read the Phil program
Open it in the playground to replay it step by step, or read it as a lesson.
From simulation to a real desk
- 01The swap, written and checked in PhilTwo protocols, three programs, every path ends with each coin in one pair of hands.done
- 02Partial fills, expiry and cancelA listing can be bought in parts, runs out of time, or is cancelled by the maker after a fill.done
- 03Several takers and several listingsTwo listings and two takers through a book that offers the cheaper listing first. The desk code is reused unchanged.done
- 04An on-chain escrow that follows the same scriptPhil cannot deploy to a chain yet. Until it can, the escrow would be a conventional on-chain program held to this specification, and audited before it touches real tokens.not started
- 05Wallets and listings for higher.fun tokensThe part people use: connect, list, fill.not started