Skip to content

futarchy CLI is out of sync with live API (buy/sell payload types, missing /v1/me/activity support) #35

Description

@adriana-arauzo

Summary

The current futarchy CLI is out of sync with the live API in a couple of important ways:

  1. futarchy buy sends budget as a JSON number, but the API currently expects a string.
  2. futarchy sell appears to have the same mismatch (amount is modeled as a float in the CLI, but the API schema expects a string).
  3. The API now exposes GET /v1/me/activity, but the CLI has no command for account activity/history, so users cannot inspect their own trade history from the tool.
  4. futarchy me only shows balance + locks/positions, which made it look like there was no trade history even when activity existed.

Reproduction

1. buy fails with 422

Using the currently installed CLI:

futarchy buy 45 no 1

Result:

Error: HTTP 422: [{'type': 'string_type', 'loc': ['body', 'budget'], 'msg': 'Input should be a valid string', 'input': 1.0}]

The OpenAPI schema currently publishes:

  • BuyRequest.budget: string
  • SellRequest.amount: string

but the CLI implementation parses these as float and passes them through as numeric JSON values.

2. Account history exists in the API, but not in the CLI

The API publishes:

GET /v1/me/activity

with description:

Get authenticated user's account activity with cursor pagination.

This endpoint returns the exact data users need to understand past trades, refunds, settlements, and credits. Example activity observed in production included:

  • initial credits
  • bought YES/NO
  • resolved market loss
  • void refund for YES/NO

However, the CLI currently exposes only:

  • markets
  • market
  • login
  • logout
  • update
  • me
  • buy
  • sell

There is no activity or history command, and me does not mention prior transactions.

Why this matters

  • buy is effectively broken against the live API unless users bypass the CLI and call the API directly.
  • sell is likely broken for the same reason.
  • Users cannot audit what happened to their funds from the CLI, especially after market resolution / void events.
  • This makes the CLI feel unreliable even when the backend has the right data.

Suggested fixes

  • Serialize budget and amount as strings before POSTing to the API.
  • Add a futarchy activity (or history) command backed by GET /v1/me/activity.
  • Consider surfacing a short note in futarchy me when recent account activity exists, or link users to the new history command.
  • Add a CLI/API compatibility test so schema drift like this is caught earlier.

Extra context

I confirmed this against the live API on 2026-03-17:

  • GET /openapi.json includes /v1/me/activity
  • BuyRequest.budget is string
  • SellRequest.amount is string
  • the CLI still posts numeric values for buy/sell

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions