Runs live, versioned Python application objects on one VM, with a suite of apps: projects, notes, tasks, files and more.

0 downloads

Download zip
Clone
Clone with git
git clone https://gitstable.com/git/askrobots/dbbasic-object-server.git
HTTPS
https://gitstable.com/git/askrobots/dbbasic-object-server.git
SSH
ssh://git@gitstable.com:2222/askrobots/dbbasic-object-server.git

Cloning needs no sign-in. Pushing over HTTPS asks for your username and an access token. SSH needs your key under SSH keys.

danq9 signup: the person chooses the password and name on the confirm page 83c7aa6 2 weeks, 5 days ago History
rates.json · 3.8 KB · 34 lines
1{
2 "name": "rates",
3 "title": "Conversion Rates",
4 "version": 1,
5 "storage": "append",
6 "description": "What one denomination was worth in another, at a moment, according to a named source. Append-only, because a rate is a historical observation and not a settable value: if a source restates, that is a NEW row with a later fetched_at, never an edit to what we recorded at the time (docs/logic-decisions.md #3 and #8 -- rates come from outside, so they get the same evidence posture as bank statements). Rates exist for two jobs and no others: supplying the rate a transaction STAMPS on itself when it happens (#1 -- history is never re-derived from today's price), and revaluing balances at a period end. They are deliberately not a tick database: store what you stamp, plus the closes and averages a period needs. `kind` matters more than most systems admit -- accounting standards use different rates for different purposes (the transaction rate when it happened, the closing rate for revaluing monetary balances, an average rate for translating a period's activity, and the historical rate that non-monetary items keep forever), and a system that offers only one number quietly picks the wrong one somewhere. The rate itself is stored as an exact decimal STRING rather than integer minor units, because unlike money it is a measurement with significant figures, not a count of things -- what must be exact is the converted result, which object_money.convert() produces as whole minor units with the rounding made explicit.",
7 "fields": [
8 {"name": "id"},
9 {"name": "base_code", "type": "text", "required": true, "label": "Base",
10 "help": "The denomination being priced (BTC in 'BTC/USD = 67432.10')."},
11 {"name": "quote_code", "type": "text", "required": true, "label": "Quote",
12 "help": "The denomination it is priced in (USD in 'BTC/USD = 67432.10')."},
13 {"name": "rate", "type": "text", "required": true, "label": "Rate",
14 "help": "How many quote units one base unit is worth, as an exact decimal string with as many digits as the source gave. Never a float."},
15 {"name": "as_of", "type": "datetime", "required": true, "label": "As Of",
16 "help": "The moment this rate describes -- not when it was fetched. A lookup never uses a rate dated after the transaction it is valuing."},
17 {"name": "kind", "type": "enum", "default": "spot", "label": "Kind",
18 "enum": ["spot", "close", "average", "historical"],
19 "help": "spot: the price at a moment (what a transaction stamps). close: an official end-of-period price (what revaluation uses). average: a period average (what translating a period's activity uses). historical: a rate deliberately frozen to an original transaction, for items that are never revalued."},
20 {"name": "period", "type": "text", "label": "Period",
21 "help": "For close/average rates, the period they belong to: 2026-07 or 2026-07-24. Blank for spot."},
22 {"name": "source", "type": "text", "required": true, "label": "Source",
23 "help": "Who said so (coinbase, ecb, manual). Part of the rate's identity: two sources disagreeing is normal and must not be silently averaged."},
24 {"name": "fetched_at", "type": "datetime", "label": "Fetched",
25 "help": "When we recorded it, as distinct from the moment it describes. A restatement is a new row with a later fetched_at."},
26 {"name": "owner_id", "type": "text", "label": "Owner"},
27 {"name": "created_at", "type": "datetime", "read_only": true, "label": "Created"}
28 ],
29 "search": {"fields": ["base_code", "quote_code", "source"]},
30 "forms": {"default": {"fields": ["base_code", "quote_code", "rate", "as_of", "kind", "period", "source"]}},
31 "views": {"list_mode": "table",
32 "list_fields": ["base_code", "quote_code", "rate", "as_of", "kind", "source"],
33 "filter_fields": ["base_code", "quote_code", "kind", "source"]}
34}