HTTP API

Stateless JSON over HTTPS. Every answer is read from the chain at request time; every write comes back as unsigned transactions for your own wallet. The API never holds keys or funds.

Base URL

text
https://gogjpdgluflntcgsarhn.supabase.co/functions/v1/poincare-api

No authentication. Bigints are decimal strings. CORS is open for GET and POST.

Endpoints

MethodPathReturns
GET/healthChain, latest block, the PoincareDCA address
GET/regimeThe regime and a one-line summary
GET/regime/history?blocks=3000Detector samples and trend onsets (100 to 20,000 blocks)
GET/quote?side=buy&amount=100Exact-input quote with spread and fee
GET/dca/orders?owner=0x…An address's orders, each with spent, progress and next-fill status
GET/dca/orders/:idOne order and the contract's verdict on its next fill
POST/dca/planValidates an order and previews its first fill
POST/dca/tx/createUnsigned approve + createOrder
POST/dca/tx/pause · /resumeUnsigned tx; 409 if already in that state
POST/dca/tx/editUnsigned editOrder for the remaining budget
POST/dca/tx/executeUnsigned executeSlice; 409 while the fill would be held
POST/dca/tx/cancel · /close-expiredUnsigned tx; 409 if closed or not yet expired

Request bodies

RouteFields
/dca/plan · /dca/tx/createside, amount (decimal string), slices, intervalSec; optional startTime, deadline, maxSpreadBps, pauseOnTrend, catchUp, maxSlippageBps, limitPrice, recipient; create also takes owner
/dca/tx/editid; optional slices, intervalSec, durationSec, deadline, maxSpreadBps, pauseOnTrend, catchUp, maxSlippageBps, limitPrice (null removes it)
other /dca/tx/*{ id }

Example

sh
curl -X POST https://gogjpdgluflntcgsarhn.supabase.co/functions/v1/poincare-api/dca/tx/create -H 'content-type: application/json' -d '{
  "owner": "0xYourAddress", "side": "sell", "amount": "1", "slices": 4, "intervalSec": 3600, "maxSpreadBps": 0
}'
# { "owner": "0x…", "transactions": [ { "to", "data", "value", "gas", "description" }, … ] }

Errors

StatusWhen
400Bad input. Invalid orders add reason, the contract's own (e.g. "deadline", "interval")
404No such order or route
409The action would revert now: held fill, closed order, not yet expired, already paused
502The upstream RPC failed; retry
503The DCA contract is not configured on this deployment

Unichain Sepolia · chain 1301 · testnetLaunch app