Skip to content

Instantly share code, notes, and snippets.

View patcito's full-sized avatar

patcito patcito

View GitHub Profile
@patcito
patcito / spot-api-full-changelog.md
Last active April 18, 2026 12:30
Spot API — structural overhaul + enrichment + risk fields (PRs #12-#18)

Spot API — changelog 2026-04-16 → 2026-04-17

Everything that landed on spot-trs-indexor in the last 24 h. Base URL on dev: https://api.opbalance.com/mm/spot. Paths below are as they appear through the ft-api proxy.


1. Structural overhaul (PR #12 — 9c85f96)

@patcito
patcito / spot-api-additions.md
Created April 16, 2026 18:38
Spot API additions — HF, partial/full liquidation prices, on-chain enrichment

Spot API additions — health factor, liquidation prices, on-chain enrichment

Addendum to the main spec. These are new/populated fields on existing endpoints.

Base URL (dev): https://api.opbalance.com/mm/spot


GET /account/positions?address=<>&chainId=<> — 3 new fields

@patcito
patcito / frontend-order-flow.md
Created April 16, 2026 12:33
Frontend leverage order flow — ft-usd2 integration notes

Creating leverage orders from the frontend

How to submit a leverage order from ft-usd2 against the executor. This is a condensed version of the server-authoritative reference script:

📂 Reference e2e (read this first): https://github.com/flyingtulipdotcom/leverage-executor/blob/f4cce0216e5412a70269d39fd699053d46985dbe/examples/e2e-order-flow.ts

It's a bun script that does the full flow against the running executor. Port the signing math from it; the one diff on frontend is that the user signs with their connected wallet (wagmi), not a private key

@patcito
patcito / orderbook-filler-guide.md
Created April 5, 2026 13:19
Flying Tulip Leverage Orderbook API - Filler Guide

Leverage Orderbook API - Filler Guide

Endpoints

Method Path Description
GET /leverage/orders/stream SSE stream — real-time order events
GET /leverage/orders?status=pending Poll pending orders
POST /leverage/orders/{id}/claim Claim an order (30s TTL)
DELETE /leverage/orders/{id}/claim Release a claim
@patcito
patcito / leverage-executor-guide.md
Last active April 5, 2026 12:21
Flying Tulip Leverage Executor - Setup & Test Guide

Flying Tulip Leverage Executor - Setup & Test Guide

Prerequisites

  • Go 1.25+
  • Docker (for PostgreSQL)
  • Foundry (anvil, cast)
  • Python 3 with web3, eth-keys, requests (for scripted testing)

Clone

API Updates (2026-03-30)

1. circuitBreakerLimitRaw — raw integer CB limit

Added to both /mm/lend and /mm/lend/cb endpoints. Use this instead of the float circuitBreakerLimit for MAX button / validation to avoid float rounding mismatches.

/mm/lend/cb

{
  "data": {

API Updates (2026-03-28)

1. Per-chain series in /status/ftusd/dashboard

Series data (price, ftUsdSupply, sftUsdSupply, apy) is now available per chain inside each chains[] entry.

GET /status/ftusd/dashboard?days=360&include_series=true&chain_ids=146

Lending API Updates (2026-03-26)

1. New: GET /mm/lend/cb?chain_id={chainId}&token={tokenAddress}

Lightweight circuit breaker polling endpoint. Use when a withdraw drawer is open to get real-time CB limits without fetching the full /mm/lend payload.

Params:

  • chain_id — chain ID (e.g. 146)
  • token — token contract address (e.g. 0x29219dd400f2Bf60E5a23d13Be72B486D4038894)
@patcito
patcito / gist:e6a455a352aec69b754e32edf13bae2e
Last active March 24, 2026 14:14
Lending Dashboard API - Series & New Fields

Lending Dashboard API Changes

Endpoint: GET /mm/lend

New: chains[].series

Each chain now includes a series object with daily historical data (last 30 days):

{
@patcito
patcito / change.md
Created March 23, 2026 17:34
Frontend Changelog: main → staging

Frontend Changelog (main → staging)

New Features

PUT Dashboard

  • FT Burn Chart — Cumulative FT burned over time with USD values, period selector (1w/1m/3m/6m/1y)
  • FT/Capital Ratio Chart — Shows FT Value / Investment Value ratio over time
  • Dashboard period dropdown and UI fixes
  • stS token added to token config