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
https://gogjpdgluflntcgsarhn.supabase.co/functions/v1/poincare-apiNo authentication. Bigints are decimal strings. CORS is open for GET and POST.
Endpoints
| Method | Path | Returns |
|---|---|---|
GET | /health | Chain, latest block, the PoincareDCA address |
GET | /regime | The regime and a one-line summary |
GET | /regime/history?blocks=3000 | Detector samples and trend onsets (100 to 20,000 blocks) |
GET | /quote?side=buy&amount=100 | Exact-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/:id | One order and the contract's verdict on its next fill |
POST | /dca/plan | Validates an order and previews its first fill |
POST | /dca/tx/create | Unsigned approve + createOrder |
POST | /dca/tx/pause · /resume | Unsigned tx; 409 if already in that state |
POST | /dca/tx/edit | Unsigned editOrder for the remaining budget |
POST | /dca/tx/execute | Unsigned executeSlice; 409 while the fill would be held |
POST | /dca/tx/cancel · /close-expired | Unsigned tx; 409 if closed or not yet expired |
Request bodies
| Route | Fields |
|---|---|
/dca/plan · /dca/tx/create | side, amount (decimal string), slices, intervalSec; optional startTime, deadline, maxSpreadBps, pauseOnTrend, catchUp, maxSlippageBps, limitPrice, recipient; create also takes owner |
/dca/tx/edit | id; optional slices, intervalSec, durationSec, deadline, maxSpreadBps, pauseOnTrend, catchUp, maxSlippageBps, limitPrice (null removes it) |
other /dca/tx/* | { id } |
Example
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
| Status | When |
|---|---|
400 | Bad input. Invalid orders add reason, the contract's own (e.g. "deadline", "interval") |
404 | No such order or route |
409 | The action would revert now: held fill, closed order, not yet expired, already paused |
502 | The upstream RPC failed; retry |
503 | The DCA contract is not configured on this deployment |