Night Agents
The 24/7 trading agents of Solana.
2,158 words · 10 min
1. The hours nobody covers
Equities on Solana trade every hour of every day. Price discovery does not. The New York session ends on Friday afternoon, the Chainlink equity feeds go quiet with it, and for the next sixty or so hours the only price for a stock token is whatever the on-chain pools say. News lands on Saturday night, pools dislocate, spreads widen, and on Monday morning the open closes the gap in a few seconds, usually against whoever was still standing in the pool.
Night Agents is built for exactly those hours. It is a book that never closes, run by agents that work out of accounts their owners open for gas, with two venues built for the weekend: a market on the Monday gap and a liquidity vault that earns the weekend spread and steps out before the bell.
2. Agent accounts
An account is a smart account, opened by a wallet for the cost of one transaction. Night Agents issues no NFT: there is nothing to mint, nothing to reveal, no supply and no allowlist. Opening one gives you two things.
A vault. The account is the vault: a contract your wallet owns, where the money and the positions live. Its address is known before you sign, because the factory deploys it with CREATE2 over your address and your running count, so the second account a wallet opens is as predictable as the first. Hand the account to another wallet and the vault, its contents and its history go with it, in a transfer that takes two steps and clears everything the old owner had set up.
A slot for a bot. The vault trades only through a guard written into the account. You can fill the slot with one of the house strategies, run by the agent's own runtime, or with your own bot: register a policy that says which agent address may act, on which contracts, with which caps and until when, and sign actions from your own infrastructure. The policy follows Solana policy, so any wallet or auditor can read exactly what your agent is allowed to do. Either way the guard is the floor: approved tokens only, canonical pools only, caps per trade and per day, no fills far from the reference price, a cooldown, a drawdown brake, a pause. Withdrawals are never subject to the policy. Only the owner can withdraw.
There is no ceiling on how many accounts exist and none on how many one wallet opens. Each carries its own strategy id, chosen when it is opened and switchable by the owner at any time, and each keeps its own line in the track record, keyed by its address.
Changing hands
Ownership moves in two steps: the owner names a wallet, that wallet accepts. Nothing moves in between, and the moment it completes the account clears itself out: the agent key is cleared, the agent path is paused, the policy on the facade is revoked, and every approval the account still held for the router, Permit2 and the pool manager is zeroed. The new owner inherits the vault and the record, and nothing else.
3. The clock and the reference price
An agent that never closes needs a price it can trust at three in the morning on a Sunday. The Chainlink feeds print on deviation during the New York session and are silent otherwise. Over the weekend of the fifth of September the NVDA feed's last print was on Friday at 17:46 UTC, hours before the close, and its next print landed at the Monday open. There is no "closing price" on the feed.
Night Agents therefore has a clock and a reference price.
The MarketClock knows the session: regular hours, extended hours, weekend, holiday, and the pre-open stretch before a Monday bell. It is a schedule behind the timelock, adjusted at each daylight saving change.
The ReferencePrice is the one price every guard here uses. During the session it is the feed. When the feed is silent it is the last print, used as an anchor, checked against a time-weighted average of the canonical pool that anyone can refresh with a permissionless poke. If the anchor is too old for the session, the pool average stands alone. Each session has its own slippage band: tight in regular hours, wider on weekends. An agent never refuses a trade because of the calendar. A token pauses only when neither the feed nor the pool can vouch for its price, and it resumes on the next print or poke.
4. Weekend Street
The gap market
One market per stock per weekend, with two sides: the Monday open print lands above the Friday reference print, or it does not. The reference is the last feed round at or before the Friday close boundary. The settlement print is the first feed round at or after the Monday open boundary. Both are proven on chain from the feed's own round history: the contract checks the round before and after each boundary, so nobody, including the agent, can pick a convenient print. Ties settle on the "not above" side. If no settlement round appears by the deadline the market voids and refunds everyone.
Bets are in USDG and close before the open. Winners split the losing pot after the agent's fee, which goes to the splitter like every other fee. Because the reference can sit hours before the actual close, the market page says what it is: open print versus last print. Bettors price the Friday afternoon drift into it.
The weekend liquidity vault
A pooled vault per stock pool, holding USDG and the stock token. Deposits are open all week. The agent's keeper places the vault's balance as concentrated liquidity on the canonical pool, centred on the reference price, in a band no narrower than the liquidity policy allows, and only when the pool is trading close to the reference. It earns the fees and spread that weekend and after-hours traders pay. Before every Monday open the position is pulled: the pre-open pull is permissionless, so even if the keeper is down anyone can take the vault out of the pool before the gap closes against it. That single rule is the difference between earning the weekend spread and paying for it.
Agent accounts can deposit into the vault under their policy. So can anyone else.
5. Baskets
A basket is one ERC-20 token that holds a theme: a list of stock tokens and target weights. Buy it with USDG in one transaction and the zap buys every leg on the canonical pools and mints your shares. Sell it and the zap sells every leg. Redeem in kind and you receive every constituent pro rata.
Shares are a claim on live balances, never on a fixed number of tokens. Stock tokens on this chain grow through the issuer's multiplier when dividends accrue, and a basket built on fixed balances would drift from what it actually holds. Rebalancing is done by the keeper, only when a constituent has drifted past the policy's threshold, only by a bounded share of the basket per move, through USDG on canonical routes, and never faster than the policy's interval. The basket's creator earns a small ongoing fee through slow share inflation. The agent's fee on zaps and rebalances goes to the splitter. If the issuer pauses a constituent the basket freezes: no minting, no rebalancing, redemption in kind only.
6. Money in, money out
Night Agents launches its coin, $NIGHT, on the Pons launchpad paired with USDG, which is the only pair token the factory approves and is also the currency the vaults trade in, so the creator fees arrive in the same currency as every other fee. The splitter claims them and cuts them two ways: half to the agent's wallet, half to whoever has $NIGHT staked. Gap market fees, weekend vault fees, basket fees and the agent's own fill fee enter the same splitter and follow the same split. One pipe, one rule, easy to audit.
The fill fee is the agent's own: ten basis points of the USDG leg of every fill an account makes, taken by the guard on the way through and forwarded to the splitter in the same transaction. The house bot and a bring-your-own agent pay the same. It has a hard ceiling of thirty basis points in the contract and a setter that can only lower it, and a withdrawal carries none of it.
Staked $NIGHT
One asset, not two. The coin carries the fee share, so there is no second market to make and no floor price to defend: $NIGHT staked in AgentStake takes the fee.
Night Agents does not choose the currency it earns in. It does choose the one it pays the stakers in, and that is SOL. Their half is converted inside the harvest, on the canonical native-SOL/USDG pool, against a floor taken from the Chainlink SOL / USD feed rather than from whoever sent the transaction, and the result is deposited into AgentStake, a contract with no owner that holds nothing but SOL and the staked coin. The arithmetic is an accumulator: a deposit moves one number, and what a staker can take is their balance against that number, less what they have taken already. Every division rounds towards the pot, a few wei at a time, so the pot never owes more than it holds.
There is no door and no round. Any amount staked earns from the next deposit, in proportion, for as long as it stays. A deposit that lands while nothing is staked is not lost and not redirected: it waits in the pot and rides in with the next one.
Leaving takes two steps and a day. A request settles what the stake has earned, moves the amount out of the earning balance and starts a 24 hour clock; the cooling amount earns nothing from that second, and a second request restarts the clock for the whole of it. The harvest interval is shorter than the cooldown, so a stake that arrives in front of a payout and leaves straight after it has already stopped earning for a full day.
Claiming is permissionless, because a claim has one destination and no other: the staker's own address. Whoever sends the transaction pays the gas and can redirect nothing. The keeper sends it.
The agent's half funds the build, the external audit and the keeper's gas; gas refuels from fee balances through a capped, whitelisted path that a compromised keeper host cannot widen.
Night Agents promises no return. It publishes a track record: every account's net asset value is checkpointed on chain against its baseline, and every agent action leaves a hash-chained audit entry. Read it, then decide.
7. Governance and safety
Registries, policies and the clock sit behind a timelock. A guardian can pause the agent, a single account, or a single token the issuer has frozen, instantly. Treasury owner powers sit behind a cold multisig. The agent key of a house bot is a fresh address that has never been delegated, checked on every run, and it can never receive funds. AgentStake answers to nobody at all: no owner, no pause, no parameters, and no way for anyone to take the coin out but the staker who put it in.
Invariants shipped with tests: the agent key never receives funds; withdrawals are never policy-gated; a trade never executes outside the reference band for its session; no approval survives a change of owner; the stake pot holds at least what it owes after any sequence of stakes, deposits, requests and claims; a gap market settles only on rounds whose timestamps prove their position; a basket's shares always map to its live balances after a rebase.
8. What comes later
Short-dated yes or no markets during the session, on the same settlement rails as the gap market. A covered-call vault, once a cash-settled option market exists on the chain to write into. Attested runtimes for holders who want their strategy private. On-chain perpetuals if a venue settles positions in contracts a vault can hold.
9. Contracts
| Contract | Role |
|---|---|
| AgentAccountFactory | Where an account comes from: CREATE2 by owner and index, free and unlimited |
| AgentAccount | The vault: trade and liquidity guard, two-step ownership, Solana policy doors, fill fee |
| StrategyRegistry, LpPolicyRegistry | Where the guard reads its rules, and where the fill fee is set |
| PolicyFacade | The Solana policy surface: policies, signed actions, the audit chain |
| AgentStake | The fee share: staked $NIGHT earns SOL, with a 24 hour cooldown on the way out |
| UsdgFeeSplitter | The one pipe every fee passes through: the agent's half, the stakers' half, converted |
| TrackRecordV3 | Net asset value, baseline, checkpoints, keyed by account address |
| MarketClock, ReferencePrice | The session and the price every guard trusts |
| GapMarket | Weekend markets on the Monday open |
| WeekendVault | The weekend liquidity vault, one per pool |
| BasketFactory, Basket, BasketZap | Baskets |
| Treasury, GasGuard, TimelockController | Money and governance |