Zum Inhalt
HALOWERK

Finopswerk

two reserve lp command ledger

Original initialized two-token reserves and three LP balances plus ordered raw Add(op0), exact-input token0/1 Swap(op1/2) and LP Burn(op3) commands derive every reserve/supply/owner-share/tokenflow state and conservation witness. Supplied initial total includes1000permanently locked shares. Own conditional Uniswap-v2-inspired mathematics: protocolfeeTo-off,0.3%swapfee; full unbalanced rawmint deposits retained, not router refunds. Status0 applied/status1 mathematical refusal leaves state.

POST https://finops.halowerk.com/v1/two-reserve-lp-command-ledger

Eingaben

Felder des veröffentlichten Eingabeschemas
FeldTypPflichtBeschreibung
initial_reserve0integerJa
initial_reserve1_domainarrayJa
initial_owner_sharesarrayJa
commandsarrayJa
reportobjectJa
Vollständiges Eingabeschema anzeigen
{
  "type": "object",
  "properties": {
    "initial_reserve0": {
      "type": "integer",
      "minimum": 1,
      "maximum": 1000000
    },
    "initial_reserve1_domain": {
      "type": "array",
      "items": {
        "type": "integer",
        "minimum": 1,
        "maximum": 1000000
      },
      "minItems": 1,
      "maxItems": 2
    },
    "initial_owner_shares": {
      "type": "array",
      "items": {
        "type": "integer",
        "minimum": 0,
        "maximum": 1000000
      },
      "minItems": 3,
      "maxItems": 3
    },
    "commands": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "op": {
            "type": "integer",
            "minimum": 0,
            "maximum": 3
          },
          "owner": {
            "type": "integer",
            "minimum": 0,
            "maximum": 2
          },
          "a": {
            "type": "integer",
            "minimum": 1,
            "maximum": 1000000
          },
          "b": {
            "type": "integer",
            "minimum": 0,
            "maximum": 1000000
          }
        },
        "required": [
          "op",
          "owner",
          "a",
          "b"
        ],
        "additionalProperties": false
      },
      "minItems": 0,
      "maxItems": 6
    },
    "report": {
      "type": "object",
      "properties": {
        "owner_shares": {
          "type": "array",
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "n": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "pattern": "^(0|-?[1-9][0-9]{0,47})$",
                  "maxLength": 49
                },
                "d": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "pattern": "^[1-9][0-9]{0,47}$",
                  "maxLength": 48
                }
              },
              "required": [
                "n",
                "d"
              ],
              "additionalProperties": false
            },
            "minItems": 3,
            "maxItems": 3
          },
          "minItems": 0,
          "maxItems": 6
        },
        "final_owner_shares": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "n": {
                "type": [
                  "string",
                  "null"
                ],
                "pattern": "^(0|-?[1-9][0-9]{0,47})$",
                "maxLength": 49
              },
              "d": {
                "type": [
                  "string",
                  "null"
                ],
                "pattern": "^[1-9][0-9]{0,47}$",
                "maxLength": 48
              }
            },
            "required": [
              "n",
              "d"
            ],
            "additionalProperties": false
          },
          "minItems": 3,
          "maxItems": 3
        },
        "final_owner_flow": {
          "type": "array",
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "n": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "pattern": "^(0|-?[1-9][0-9]{0,47})$",
                  "maxLength": 49
                },
                "d": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "pattern": "^[1-9][0-9]{0,47}$",
                  "maxLength": 48
                }
              },
              "required": [
                "n",
                "d"
              ],
              "additionalProperties": false
            },
            "minItems": 2,
            "maxItems": 2
          },
          "minItems": 3,
          "maxItems": 3
        },
        "final_reserves": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "n": {
                "type": [
                  "string",
                  "null"
                ],
                "pattern": "^(0|-?[1-9][0-9]{0,47})$",
                "maxLength": 49
              },
              "d": {
                "type": [
                  "string",
                  "null"
                ],
                "pattern": "^[1-9][0-9]{0,47}$",
                "maxLength": 48
              }
            },
            "required": [
              "n",
              "d"
            ],
            "additionalProperties": false
          },
          "minItems": 2,
          "maxItems": 2
        }
      },
      "required": [
        "status",
        "amount0_delta",
        "amount1_delta",
        "minted",
        "burned",
        "reserve0",
        "reserve1",
        "supply",
        "share_conservation",
        "token0_conservation",
        "token1_conservation",
        "owner_shares",
        "final_owner_shares",
        "final_owner_flow",
        "final_reserves",
        "final_supply",
        "locked_shares"
      ],
      "additionalProperties": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "n": {
              "type": [
                "string",
                "null"
              ],
              "pattern": "^(0|-?[1-9][0-9]{0,47})$",
              "maxLength": 49
            },
            "d": {
              "type": [
                "string",
                "null"
              ],
              "pattern": "^[1-9][0-9]{0,47}$",
              "maxLength": 48
            }
          },
          "required": [
            "n",
            "d"
          ],
          "additionalProperties": false
        },
        "minItems": 0,
        "maxItems": 6
      },
      "propertyNames": {
        "enum": [
          "status",
          "amount0_delta",
          "amount1_delta",
          "minted",
          "burned",
          "reserve0",
          "reserve1",
          "supply",
          "share_conservation",
          "token0_conservation",
          "token1_conservation",
          "owner_shares",
          "final_owner_shares",
          "final_owner_flow",
          "final_reserves",
          "final_supply",
          "locked_shares"
        ]
      },
      "patternProperties": {
        "^(final_supply|locked_shares)$": {
          "type": "object",
          "properties": {
            "n": {
              "type": [
                "string",
                "null"
              ],
              "pattern": "^(0|-?[1-9][0-9]{0,47})$",
              "maxLength": 49
            },
            "d": {
              "type": [
                "string",
                "null"
              ],
              "pattern": "^[1-9][0-9]{0,47}$",
              "maxLength": 48
            }
          },
          "required": [
            "n",
            "d"
          ],
          "additionalProperties": false
        }
      }
    }
  },
  "required": [
    "initial_reserve0",
    "initial_reserve1_domain",
    "initial_owner_shares",
    "commands",
    "report"
  ],
  "additionalProperties": false
}

Originalschema öffnen

Veröffentlichtes Eingabebeispiel

{
  "initial_reserve0": 100000,
  "initial_reserve1_domain": [
    100000
  ],
  "initial_owner_shares": [
    99000,
    0,
    0
  ],
  "commands": [],
  "report": {
    "status": [],
    "amount0_delta": [],
    "amount1_delta": [],
    "minted": [],
    "burned": [],
    "reserve0": [],
    "reserve1": [],
    "supply": [],
    "share_conservation": [],
    "token0_conservation": [],
    "token1_conservation": [],
    "owner_shares": [],
    "final_owner_shares": [
      {
        "n": "99000",
        "d": "1"
      },
      {
        "n": "0",
        "d": "1"
      },
      {
        "n": "0",
        "d": "1"
      }
    ],
    "final_owner_flow": [
      [
        {
          "n": "0",
          "d": "1"
        },
        {
          "n": "0",
          "d": "1"
        }
      ],
      [
        {
          "n": "0",
          "d": "1"
        },
        {
          "n": "0",
          "d": "1"
        }
      ],
      [
        {
          "n": "0",
          "d": "1"
        },
        {
          "n": "0",
          "d": "1"
        }
      ]
    ],
    "final_reserves": [
      {
        "n": "100000",
        "d": "1"
      },
      {
        "n": "100000",
        "d": "1"
      }
    ],
    "final_supply": {
      "n": "100000",
      "d": "1"
    },
    "locked_shares": {
      "n": "1000",
      "d": "1"
    }
  }
}

Ergebnis & Dokumentation

Maschinenlesbare Dokumentation dieses Hubs

Quelle dieser Seite: der veröffentlichte HALOWERK-Katalog. Stand: 2026-11-07, 02:42 UTC.

Weitere Endpunkte dieses Hubs

Alle Endpunkte dieses Hubs →