Under the hood
The tech
Motion is one program on Solana. It holds the margin, runs the curve and pays the winners. The program needs no server of ours.
D4h92sYjETPZZDWMrxwQKvPDAUxubKmiRqqioW6q487J, since 24 November 2026. Its markets are paused for opens. Every address: the trust page.The pieces
| Piece | Where it runs | What it does |
|---|---|---|
| The program | Solana | every rule about money: opening, closing, the band and its rule, funding, liquidation, the cushion, the sweep |
| Your wallet | your device | signs your transactions; nobody else can move your margin |
| The site | motion.trading | builds transactions for your wallet and draws the markets; it trades through our servers |
| The rescue page | one file in your browser | closes a position, adds margin or collects what is waiting for you, through an RPC you choose, with nothing from our servers |
| The indexer | our server | reads the chain and serves charts, history and the API |
| The keeper | our server, or anyone's | sends liquidations, band rule closes and sweeps, and brings each market up to date after a change of settings; every one of these is open to anyone. A second machine watches our keeper and messages the team when it stops |
| The buy and burn | our server | a script that holds the buy and burn wallet's key; once an hour it buys $motion with what that wallet holds, up to a cap, and burns it |
If our site and servers went offline, positions would still be on chain, and closing, adding margin, liquidating and band rule closes would still work for anyone who sends the transaction to the program. The website, which trades through our servers, is the client Motion gives traders. For when it is down there is the rescue page: it closes a position, adds margin or collects what a band rule close set aside, through an RPC address you type in and your own wallet, and asks nothing of our servers once it is open. It is one file, so save a copy and you can open it from your own computer.
What is not there
- No price oracle. The program never reads an outside price. See the price.
- No order book and no matching engine. Every trade is against the market's curve.
- No house wallet. The only SOL in a market is traders' margin and the market's own cushion.
- No points server. Rewards are counted by the program.
Accounts
| Account | One for each | Holds |
|---|---|---|
Config | program | the admin, the pause guardian, the fund's address, and every setting with its limits |
Market | account being traded | the curve, the two edges of its band, depth, the 10 minute average price, both funding indexes and the funding numbers it was last charged at, units and size open on each side, the cushion, what is set aside for owners |
| Market vault | market | SOL only: traders' margin, the cushion, and what a band rule close set aside for an owner. Owned by the program. |
Position | wallet in a market | side, units, size at entry, margin, the liquidation line it opened with, and what is waiting for its owner |
A market is tied to the account's numeric id on its platform, never to its handle, because handles change.
Instructions
| Instruction | Who can send it |
|---|---|
open_position, close_position | the trader |
add_margin, remove_margin | the trader |
close_position_account, returns the rent once a position is flat | the trader |
liquidate | anyone |
band_close, the band rule's close | anyone; the program checks the position is worn under what it must hold at all times |
claim_owed, pays an owner what is waiting for them | anyone; the SOL goes only to the position's owner |
touch_market, brings a market's average price and funding up to now | anyone |
grow_depth | anyone; switched off in this version, it always answers that the rule is not met |
sweep, cushion above its cap to the fund | anyone |
fund_backstop, add SOL to a market's cushion | anyone |
pause_all, pause_market, pause new opens | the guardian or the admin; only the admin resumes |
init_market, update_config, retire_market | the admin |
The math
- Whole numbers only. SOL is counted in lamports, a billionth of a SOL. There is no floating point in the program.
- Every division rounds toward the vault, so rounding can never pay out more than is there.
- The curve is path independent. The order of trades does not change where it ends. When every position has closed, the curve is back where it started, and all profit and loss add up to zero.
The rules that keep a market whole
- The band. Each side may hold at most 1.2% of the curve's units, so the price can never leave two fixed prices. A market keeps the band it was created with. See the band.
- The band rule, first half. To open, to add, and after taking margin out, a position must hold what it would lose if the price went to the far edge of the band, its liquidation line counted on what it is worth at that far edge, and 0.30% of its size. Margin taken out is counted at the line the position opened with.
- The band rule, second half. A position must hold the first two at all times. When funding has worn its margin under them, anybody may close the whole position at the market price. The ordinary closing fee goes to the cushion, 0.0005 SOL to the sender, and the rest is set aside for the owner inside the vault, where only
claim_owedfor that owner can move it. No account the owner controls is part of it, so the owner cannot stop it and an empty wallet cannot make it fail. It is refused in the slot of the position's last open, while the position is under its line, and while the market price stands more than 0.2% on the owner's wrong side of the 10 minute average. So its sender can move the price up to 20 basis points against the owner first and take up to 0.2% of the position's size. See the band rule's close. - What the two halves give. The band holds for every position: with every other position gone the curve is still inside it, and a position's own close moves the price less far than the edge. So a position that holds what it must hold at all times is above its liquidation line at every price inside the band. A position that holds the margin the rule asks for cannot be liquidated by any price move inside the band, however long the price is held there. Funding is what wears that margin down, and then anybody may close the position by the band rule. There are two exceptions: while a market's cushion is empty or short, a loss past another position's margin is charged to the open positions on the other side through the index funding uses, and so are single lamports of rounding from very small partial closes. Our keeper sends that close, and anybody else may. When nobody does for many hours, a held push can liquidate the worn position, and what is lost past a margin is what funding ran up in the meantime; the cushion pays first.
- A liquidation needs both prices. A position is liquidated only when it is under its line at the market price and at the 10 minute average price, its units times the average. The average follows the price by a power of the seconds passed, so it is the same however often the market is touched, and touching a market more often cannot hurry it. It is the last resort: it can only reach a position that funding has worn under what it must hold and that nobody closed by the band rule.
- Funding strictly between traders. The crowded side pays the light side and the market books none of it.
- Funding is charged at the numbers a market last used. Each market keeps its own copy of the funding settings. A change of them counts from the next second and is never charged for time that has passed. One setting does reach back until the first upgrade of the program: a change of the length of the 10 minute average is applied to the time since the market was last touched.
- A position keeps its liquidation line. A change of settings can lower a position's line and raise it again, never above the line it opened with. No order may leave its own position under its line.
- No dust. An order under 0.01 SOL of size is refused. A close or a liquidation that would leave under 0.01 SOL of size takes the whole position.
- A bounty comes only out of what a position has left, never out of the cushion.
- The depth rule is switched off. The program accepts no setting under which it can act, so a market's depth does not change. Turning it on takes an upgrade.
How the rules were tested
Every money rule was written first as a reference model. The engine inside the program is a port of that model, and the two are compared number by number.
| Scripted attacks and random markets run against the model's rules | 2,457 checks, 0 failed |
| Operations replayed through the engine, every number equal to the model's | 48,006 |
| Random stress runs of the engine | 4,800 |
| Checks of the program on a local validator, against the model after every transaction | 3,505, 0 failed |
The attacks try what the rules are there to stop: pushing the price to the far edge of the band and holding it there for up to a day, pushing the price to take more than a position's margin, liquidating a whole side inside one transaction, wearing a margin down with funding and then moving the price across the band, closing a worn position at a price the sender picked, trading with yourself for a gain, and changing settings to liquidate open positions or to charge funding for time that has passed. The tests hold these after every single operation:
- A vault always holds at least its cushion.
- The curve's product never falls below its set value.
- The curve stays inside its band whoever leaves, and the band's two prices never move outward.
- A position that holds what it must hold at all times is not under its line at the market price, on any settings the program allows.
- With funding switched off, no position is liquidated at all. With a keeper sending band rule closes inside the hour at the launch settings, nothing was lost past a margin in 1,000 runs.
- With every position closed, what is left in a vault beyond the cushion is a few lamports of rounding and never negative.
- Wallets, vaults and the fund together neither gain nor lose a lamport.
The rules of 23 November 2026 came out of an independent review by a research team working with AI agents, with no part in the build. See before a market opens.
The coin side
$motion is a Token 2022 coin. The buy and burn reads the coin's token program at run time instead of assuming one. The program's fund pays out SOL only; it never holds the coin. See $motion.