Docs
Launch app Vault X Buy $CLEP
Docs · v1.0

One vault on the other side of every perp.

Clepsydra is a perps venue for Solana coins with one counterparty: a shared SOL vault. Traders go long or short on any coin with a pool, up to 25x. Depositors own the vault, so they collect every open fee, every liquidated collateral and the funding that settles on the hour.

The name is Greek for a water clock: a bowl that drains into another bowl at a fixed rate. That is the whole design. Fees and funding pour into the vessel all hour long, and on the hour they drip into the depositors' cups, each cup sized by its share.

Quick start

From an empty wallet to an open position.

  1. Open the app. /app starts on SOL-PERP. Pick another market from Majors, Trending, New or Tiny caps, or paste any Solana contract into the bar at the top.
  2. Connect Phantom if you want every order signed. Without a wallet the app runs as a guest book with 10 SOL to practice with, and the ticket still shows the exact message it would ask you to sign.
  3. Fill the ticket. Long or short, collateral from 0.05 SOL, leverage from 1x to 25x. The ticket shows position size, entry, liquidation price, the 0.1% open fee and the next funding payment before you press anything.
  4. Sign & open. The position lands in the table under the chart with its live PnL. Close it from its row; closing is a signed message too.
NOTEMarks refresh from the deepest pool every 8 seconds. A position whose mark crosses its liquidation price is closed on the next refresh and its collateral goes to the vault.

Try it

Quote a position on any coin with the live mark. This box imports lib/clepsydra.js from this site and calls fetchMarket and quote.

// press Quote

The vault

One pool of SOL, owned pro rata by everyone who poured into it.

The vault is the counterparty to every trade. When a trader opens a 10x long on BONK-PERP, the vault is short the same size. When a trader is liquidated, the collateral stays in the vault. When a trader closes in profit, the vault pays it.

What fills the vessel

  • Open fees. 0.1% of every position's size, paid at open.
  • Liquidations. The whole collateral of a position that crosses its liquidation price.
  • Funding. The hourly payment between longs and shorts, which the vault collects as the other side of both.
  • Trader losses. A position closed at a loss leaves the difference in the vault.

What drains it

Trader profits on close, and funding the vault itself owes when the book leans its way. Depositor withdrawals clear at the next drip.

Your share

Your share is your deposit divided by the vault. Everything the vault earns or loses in an hour is booked to depositors in that ratio when the hour turns. The vault page shows the hour as a bowl draining into your cup.

WARNINGBeing the house is not free money. A run of traders guessing right drains the vessel exactly the way fees fill it. The maintenance margin bounds what any single position can take, not what all of them can take together.

Quoting

Both sides of every market, at the live mark.

The vault posts a bid and an ask on every market. A long fills against the ask, a short against the bid, and both fill at the mark: the USD price of the coin's deepest Solana pool, read from DexScreener. There is no order book to walk, so size does not move your entry.

Entry is the mark at the moment you sign. The ticket shows it, the signed message carries it in the Mark field, and the position stores it. Fills settle against the vault in under a second because there is nothing to match.

Markets

Every Solana coin with a pool over $5K is a market.

TabWhat is in itSource
MajorsSOL-PERP from the SOL/USDC pool, BTC-PERP and ETH-PERP from the wrapped BTC and ETH pools on Solanatokens/v1/solana
TrendingThe most boosted Solana coins right nowtoken-boosts/top/v1
NewCoins whose profiles were published most recently, newest pool firsttoken-profiles/latest/v1
Tiny capsBoosted coins under $2M market cap with at least $5K of liquiditytoken-boosts/latest/v1
Any contractPaste a mint into the bar; the vault quotes its deepest pooltokens/v1/solana

Market names are the coin's symbol plus -PERP. A link straight into a market is /app/?ca=<mint>.

Positions

Collateral in SOL, size in SOL, prices in USD.

FieldMeaning
CollateralSOL you put up. 0.05 to 50 SOL per position.
Leverage1x to 25x, whole numbers.
Sizecollateral × leverage, in SOL. Fees and funding are computed on size.
EntryThe mark when you signed.
PnLsize × (mark ÷ entry − 1) for a long, the negative for a short, plus funding received or paid.
Equitycollateral + PnL. What you get back on close, never below zero.

Liquidation

Maintenance margin is 1%. The liquidation price is on the ticket before you open.

// long
liquidation = entry * (1 - 1 / leverage + 0.01)
// short
liquidation = entry * (1 + 1 / leverage - 0.01)

The move that takes you out

LeverageAdverse moveLong at $100 liquidates atShort at $100 liquidates at
NOTEFunding does not move the liquidation price. It changes your equity, so a position that has paid a lot of funding gives back less on close.

Funding: the drip

Settled on the hour, every hour, UTC.

Funding keeps longs and shorts honest. Clepsydra builds the hourly rate from the market's own last hour: a tenth of the hour's price move, capped at ±0.5%. When the price ran up, longs pay; when it fell, shorts pay. The vault sits between them and keeps what one side pays and the other side is not there to receive.

rate    = clamp(change1h / 100 * 0.1, -0.005, 0.005)
payment = -direction * size * rate   // direction: long = 1, short = -1
// BONK moved +3% in the last hour
fundingRate(3)                // 0.003  (0.3% per hour)
// a 10 SOL long pays 0.03 SOL at the drip, a 10 SOL short receives 0.03 SOL
fundingPayment({ side: "long", size: 10 }, 0.003)   // -0.03

When it settles

At every HH:00:00 UTC. nextDrip() returns the timestamp and the milliseconds left, and the countdown on every page reads it. If the app was closed through several hours, each missed hour settles once when it opens, in order.

Signed messages

Every order, close, deposit and withdrawal is a plain-text message, not a transaction.

Phantom shows the text, you sign it with your wallet's ed25519 key, and the signature travels with the action. Nothing else is ever signed. The first line names the kind of message; each following line is Key: value.

Clepsydra order
Action: open
Market: BONK-PERP
Mint: DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263
Wallet: 7Yk3…your address
Side: long
Collateral: 0.50 SOL
Leverage: 10x
Mark: 0.00003135
Nonce: 9f2c51a07be4d813
Issued: 2026-10-29T18:42:07.311Z
Clepsydra order
Action: close
Market: BONK-PERP
Mint: DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263
Wallet: 7Yk3…your address
Mark: 0.00003201
Nonce: 0c77e2d95a1b4f60
Issued: 2026-10-29T19:05:44.020Z
Clepsydra vault
Action: deposit
Amount: 1.00 SOL
Wallet: 7Yk3…your address
Nonce: 41aa09e3c2d7f518
Issued: 2026-10-29T18:30:00.000Z
FieldRule
Nonce8 random bytes as hex. A message with a nonce already seen is ignored.
IssuedISO 8601, UTC. The fill uses the mark in the message, so a stale message is a stale price.
MarkThe price shown on the ticket when you signed.
WalletBase58 public key, or guest when no wallet is connected.

clepsydra.js

The vault maths, market reads and message formats as one ES module. No dependencies, no build.

import { fetchMarket, quote, fundingRate, nextDrip, formatClock } from "SITE/lib/clepsydra.js";

const bonk = await fetchMarket("DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263");
const q = quote({ side: "long", collateral: 0.5, leverage: 10, mark: bonk.price });

console.log(bonk.market, q.size, q.liquidation);          // BONK-PERP 5 0.0000285…
console.log(fundingRate(bonk.change.h1));                 // hourly rate
console.log("next drip in", formatClock(nextDrip().ms));  // 17:42
<span id="drip"></span>
<script type="module">
  import { nextDrip, formatClock } from "SITE/lib/clepsydra.js";
  setInterval(() => drip.textContent = formatClock(nextDrip().ms), 1000);
</script>
# the module itself
curl -s SITE/lib/clepsydra.js | head -20
# the market read it makes
curl -s https://api.dexscreener.com/tokens/v1/solana/So11111111111111111111111111111111111111112

Exports

ExportReturns
quote({side, collateral, leverage, mark})size, fee, liquidation, distance; throws ClepError
liquidationPrice(entry, leverage, side)number
liquidationDistance(leverage)adverse move as a fraction
pnl(pos, mark){ value, pct, equity } in SOL
fundingRate(change1hPct), fundingPayment(pos, rate)hourly rate; SOL paid (−) or received (+)
nextDrip(now), formatClock(ms){ at, ms }; "mm:ss"
orderMessage(o), vaultMessage(o), parseMessage(text)the texts in Signed messages, and back
fetchMarkets(mints), fetchMarket(mint)market objects from the deepest pool
fetchCandles(pair, {minutes, limit})15-minute candles from GeckoTerminal, oldest first
trending(), newest(), tinyCaps()the app's market tabs
load(), save(s), open, close, mark, drip, deposit, withdrawthe book the app keeps in your browser

Constants

Read live from CONST in the module.

NameValue

Errors

Everything the module throws is a ClepError with a code.

CodeMessage

Limits

What the design does not protect you from.

  • The mark is one pool. A thin pool can be pushed. Markets need $5K of liquidity, which keeps out the emptiest pools and nothing more.
  • Marks are polled. Every 8 seconds. A coin that moves 30% between two reads skips straight past a 25x liquidation price.
  • The house can lose. Depositors carry the traders' combined profit. Fees and liquidations are the edge, not a guarantee.
  • The book lives in your browser. Clearing site data clears your positions. Signatures prove who opened what; they do not store it anywhere else.
  • DexScreener is the oracle. If it does not answer, marks freeze and nothing is liquidated or settled until it does.

$CLEP

The coin of the water clock.

$CLEP does not fill the vault and the vault does not fill it. It sits next to the spout and watches the hour go round.

FAQ

What is the vault?

A shared pool of SOL that takes the other side of every long and short on Clepsydra. Depositors own it pro rata and get its fees, liquidations and funding on the hour.

Which coins can I trade?

SOL, BTC and ETH as majors, and any Solana coin with a pool over $5K. Paste the contract in the app.

Why is funding hourly?

Because the venue is named after a clock and a clock should be on time. Also because memecoins move too fast for an eight-hour funding window to mean anything.

What do I sign?

A plain-text message, shown in full on the ticket and in Phantom. It is never a transaction, so it cannot move anything out of your wallet.

What happens when I am liquidated?

The position closes at the next mark refresh past your liquidation price, and the collateral goes into the vault. At 25x that is a 3% move against you; at 5x it is 19%.

Can I use it without a wallet?

Yes. The app runs as a guest book with 10 SOL to practice with, and shows every message it would have asked you to sign.

clepsydra.js v1.0 · marks from DexScreenerHome · App · Vault · X