{
  "openapi": "3.1.0",
  "info": {
    "title": "HedgeLiquid API",
    "version": "1.0.0",
    "description": "HedgeLiquid runs option vaults on Elysium. Deposit HYPE, kHYPE or USDC, the vault sells fully collateralised options in an open on-chain auction each epoch and keeps the premium. Buy the same options to protect HYPE you hold. HedgeLiquid holds no keys and sends no transaction for anyone. It returns quotes read from Elysium and unsigned transactions that the caller signs and sends itself. Audit status of the contracts: Unaudited. The API is open: no key and no account."
  },
  "servers": [
    {
      "url": "https://hedgeliquid.xyz/api/v1"
    }
  ],
  "tags": [
    {
      "name": "Info",
      "description": "What the API is, and the price feed."
    },
    {
      "name": "Vaults",
      "description": "The vaults as the chain has them, and their epochs."
    },
    {
      "name": "Auctions",
      "description": "The descending-price auctions options are sold in."
    },
    {
      "name": "Hedge",
      "description": "Quotes for protecting HYPE or keeping its upside, and the one call that returns the steps to sign."
    },
    {
      "name": "Account",
      "description": "What an address holds."
    },
    {
      "name": "Transactions",
      "description": "Unsigned transactions for every action. The caller signs and sends them."
    }
  ],
  "paths": {
    "/": {
      "get": {
        "operationId": "getIndex",
        "tags": [
          "Info"
        ],
        "summary": "What this API is and where everything lives",
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Answer"
                }
              }
            }
          },
          "400": {
            "description": "Something in the request is missing or malformed. The message says what.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Elysium could not be read (code rpc_unavailable), or the database could not (code database_unavailable). No number is given in its place.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/vaults": {
      "get": {
        "operationId": "getVaults",
        "tags": [
          "Vaults"
        ],
        "summary": "Every vault as the chain has it now",
        "description": "Config, the parameters on chain, the current epoch, the auction, net assets and the share price, read from the chain. Realized premium over settled epochs is added from the keeper's database when it can be reached. Before deployment the answer carries the rules from config and `live: false`.",
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Answer"
                }
              }
            }
          },
          "400": {
            "description": "Something in the request is missing or malformed. The message says what.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Elysium could not be read (code rpc_unavailable), or the database could not (code database_unavailable). No number is given in its place.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/vaults/{id}": {
      "get": {
        "operationId": "getVaultsId",
        "tags": [
          "Vaults"
        ],
        "summary": "One vault",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Answer"
                }
              }
            }
          },
          "400": {
            "description": "Something in the request is missing or malformed. The message says what.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "There is no such vault.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Elysium could not be read (code rpc_unavailable), or the database could not (code database_unavailable). No number is given in its place.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/vaults/{id}/epochs": {
      "get": {
        "operationId": "getVaultsIdEpochs",
        "tags": [
          "Vaults"
        ],
        "summary": "A vault's epochs, newest first",
        "description": "Each epoch as the vault recorded it: strike, options offered and sold, premium, settlement price and payout. Transaction hashes, the fee and the number of fills are added from the keeper's database when it can be reached.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "1 to 100, default 20",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Answer"
                }
              }
            }
          },
          "400": {
            "description": "Something in the request is missing or malformed. The message says what.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "There is no such vault.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Elysium could not be read (code rpc_unavailable), or the database could not (code database_unavailable). No number is given in its place.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/auctions": {
      "get": {
        "operationId": "getAuctions",
        "tags": [
          "Auctions"
        ],
        "summary": "Each vault's auction: live or next",
        "description": "For a live auction: the price now as a share of collateral, the premium of one option, the options left, and when the price reaches its minimum and the auction closes. Otherwise: where the vault stands and the time its epoch ends.",
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Answer"
                }
              }
            }
          },
          "400": {
            "description": "Something in the request is missing or malformed. The message says what.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Elysium could not be read (code rpc_unavailable), or the database could not (code database_unavailable). No number is given in its place.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/auctions/fills": {
      "get": {
        "operationId": "getAuctionsFills",
        "tags": [
          "Auctions"
        ],
        "summary": "Purchases from the auctions, newest first",
        "description": "From the keeper's database, which is written from Fill events and nothing else. Answers 503 with the code database_unavailable when it cannot be reached.",
        "parameters": [
          {
            "name": "vault",
            "in": "query",
            "required": false,
            "description": "only this vault",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "epoch",
            "in": "query",
            "required": false,
            "description": "only this epoch",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "account",
            "in": "query",
            "required": false,
            "description": "only fills this 0x address paid for or received",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "1 to 200, default 50",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "before",
            "in": "query",
            "required": false,
            "description": "only fills before this Unix time",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Answer"
                }
              }
            }
          },
          "400": {
            "description": "Something in the request is missing or malformed. The message says what.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Elysium could not be read (code rpc_unavailable), or the database could not (code database_unavailable). No number is given in its place.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/price": {
      "get": {
        "operationId": "getPrice",
        "tags": [
          "Info"
        ],
        "summary": "The price feed's newest reading and its age",
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Answer"
                }
              }
            }
          },
          "400": {
            "description": "Something in the request is missing or malformed. The message says what.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Elysium could not be read (code rpc_unavailable), or the database could not (code database_unavailable). No number is given in its place.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/positions/{address}": {
      "get": {
        "operationId": "getPositionsAddress",
        "tags": [
          "Account"
        ],
        "summary": "What an address holds",
        "description": "Shares, a queued deposit, shares queued for redemption and assets ready to collect in each vault. The options it holds, with the payout once their epoch is settled. Its open standing orders.",
        "parameters": [
          {
            "name": "address",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Answer"
                }
              }
            }
          },
          "400": {
            "description": "Something in the request is missing or malformed. The message says what.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "There is no such vault.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Elysium could not be read (code rpc_unavailable), or the database could not (code database_unavailable). No number is given in its place.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/quote/protect": {
      "get": {
        "operationId": "getQuoteProtect",
        "tags": [
          "Hedge"
        ],
        "summary": "The cost of protecting HYPE below a strike",
        "description": "A put from cash-weekly. While its auction is live: the strike, the expiry, what the vault says this amount costs right now, the options left and how the price will fall. When no auction is live the answer says so and gives the time of the next epoch boundary, the rule the strike follows, an example cost range worked from the feed price of the moment and labelled as an example, and the standing-order route.",
        "parameters": [
          {
            "name": "amount",
            "in": "query",
            "required": false,
            "description": "how much of the underlying to cover, as a decimal number such as 10. Or amountRaw with 18 decimals",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "address",
            "in": "query",
            "required": false,
            "description": "optional. With it the answer says whether an approval would be needed",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Answer"
                }
              }
            }
          },
          "400": {
            "description": "Something in the request is missing or malformed. The message says what.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Elysium could not be read (code rpc_unavailable), or the database could not (code database_unavailable). No number is given in its place.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/quote/upside": {
      "get": {
        "operationId": "getQuoteUpside",
        "tags": [
          "Hedge"
        ],
        "summary": "The cost of keeping the upside above a strike",
        "description": "A call from a covered-call vault, with the premium in the vault's own asset. While its auction is live: the strike, the expiry, what the vault says this amount costs right now, the options left and how the price will fall. When no auction is live the answer says so and gives the time of the next epoch boundary, the rule the strike follows, an example cost range worked from the feed price of the moment and labelled as an example, and the standing-order route.",
        "parameters": [
          {
            "name": "vault",
            "in": "query",
            "required": false,
            "description": "hype-weekly, hype-daily, khype-weekly. Default hype-weekly",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "amount",
            "in": "query",
            "required": false,
            "description": "how much of the underlying to cover, as a decimal number such as 10. Or amountRaw with 18 decimals",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "address",
            "in": "query",
            "required": false,
            "description": "optional. With it the answer says whether an approval would be needed",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Answer"
                }
              }
            }
          },
          "400": {
            "description": "Something in the request is missing or malformed. The message says what.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Elysium could not be read (code rpc_unavailable), or the database could not (code database_unavailable). No number is given in its place.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/payoff": {
      "get": {
        "operationId": "getPayoff",
        "tags": [
          "Hedge"
        ],
        "summary": "What options pay at a settlement price",
        "description": "Arithmetic only, the same as the vault contract's. It reads no price.",
        "parameters": [
          {
            "name": "kind",
            "in": "query",
            "required": false,
            "description": "put or call (protect and upside are accepted too)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "strike",
            "in": "query",
            "required": false,
            "description": "dollars, as a decimal number. Or strikeRaw with 18 decimals",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "amount",
            "in": "query",
            "required": false,
            "description": "options, as a decimal number. Or amountRaw with 18 decimals",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "price",
            "in": "query",
            "required": false,
            "description": "the settlement price in dollars. Or priceRaw with 18 decimals",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "vault",
            "in": "query",
            "required": false,
            "description": "optional. The vault whose asset the payout is counted in",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Answer"
                }
              }
            }
          },
          "400": {
            "description": "Something in the request is missing or malformed. The message says what.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Elysium could not be read (code rpc_unavailable), or the database could not (code database_unavailable). No number is given in its place.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/tx": {
      "get": {
        "operationId": "getTx",
        "tags": [
          "Transactions"
        ],
        "summary": "The transaction builders and what each one takes",
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Answer"
                }
              }
            }
          },
          "400": {
            "description": "Something in the request is missing or malformed. The message says what.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Elysium could not be read (code rpc_unavailable), or the database could not (code database_unavailable). No number is given in its place.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/quote": {
      "post": {
        "operationId": "postQuote",
        "tags": [
          "Hedge"
        ],
        "summary": "The same quote as the two GET routes, asked with a JSON body",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "description": "\"protect\" or \"upside\""
                  },
                  "amount": {
                    "type": "string",
                    "description": "string, how much of the underlying to cover, as a decimal number. Or amountRaw with 18 decimals"
                  },
                  "vault": {
                    "type": "string",
                    "description": "string, optional, for upside: hype-weekly, hype-daily, khype-weekly"
                  },
                  "address": {
                    "type": "string",
                    "description": "string, optional"
                  }
                },
                "additionalProperties": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Answer"
                }
              }
            }
          },
          "400": {
            "description": "Something in the request is missing or malformed. The message says what.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Elysium could not be read (code rpc_unavailable), or the database could not (code database_unavailable). No number is given in its place.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/hedge": {
      "post": {
        "operationId": "postHedge",
        "tags": [
          "Hedge"
        ],
        "summary": "One call: the steps to sign for a hedge",
        "description": "While the vault's auction is live the steps are an approval, when one is needed, and the purchase, with the most to pay set 1% above the premium read now (the auction price only falls). When no auction is live the steps leave a standing order, and that needs maxCost: without it the answer is 400 with the code limit_required and an example range, because there is no price to buy at and the server will not choose one. With maxCost below the price of a live auction the steps also leave a standing order, which waits for the price to fall to it. Nothing is signed or sent by the server.",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "address": {
                    "type": "string",
                    "description": "string, the 0x address that will sign and send the steps and receive the options"
                  },
                  "kind": {
                    "type": "string",
                    "description": "\"protect\" (a put on HYPE, paid in USDC) or \"upside\" (a call, paid in the vault's asset)"
                  },
                  "amount": {
                    "type": "string",
                    "description": "string, how much of the underlying to cover, as a decimal number. Or amountRaw with 18 decimals"
                  },
                  "maxCost": {
                    "type": "string",
                    "description": "string, the most to pay, as a decimal number of the vault's asset. Or maxCostRaw in the smallest unit. Required when no auction is live"
                  },
                  "vault": {
                    "type": "string",
                    "description": "string, optional, for upside: hype-weekly, hype-daily, khype-weekly. Default hype-weekly"
                  },
                  "slippageBps": {
                    "description": "integer, optional. Room above the premium read now. Default 100",
                    "anyOf": [
                      {
                        "type": "integer"
                      },
                      {
                        "type": "string",
                        "pattern": "^[0-9]+$"
                      }
                    ]
                  },
                  "validUntil": {
                    "description": "integer, optional. Unix time after which a standing order no longer fills. 0, the default, waits until it fills or is cancelled",
                    "anyOf": [
                      {
                        "type": "integer"
                      },
                      {
                        "type": "string",
                        "pattern": "^[0-9]+$"
                      }
                    ]
                  }
                },
                "additionalProperties": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Steps"
                }
              }
            }
          },
          "400": {
            "description": "Something in the request is missing or malformed. The message says what.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The chain would refuse the transaction right now, or the contracts are not deployed (code not_live). The message says why.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Elysium could not be read (code rpc_unavailable), or the database could not (code database_unavailable). No number is given in its place.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/tx/deposit": {
      "post": {
        "operationId": "postTxDeposit",
        "tags": [
          "Transactions"
        ],
        "summary": "Queue a deposit into a vault",
        "description": "Answers with unsigned steps. The transaction can be sent by the owner of the funds. Nothing is signed or sent by the server.",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "vault": {
                    "type": "string",
                    "description": "string, the vault's id (such as cash-weekly) or its address"
                  },
                  "address": {
                    "type": "string",
                    "description": "string, the 0x address that will sign and send the steps"
                  },
                  "amount": {
                    "type": "string",
                    "description": "string, a decimal number of the vault's asset such as \"12.5\". Or send amountRaw: a whole number of the smallest unit"
                  },
                  "receiver": {
                    "type": "string",
                    "description": "string, optional. Who the shares are for. Defaults to address"
                  },
                  "native": {
                    "type": "boolean",
                    "description": "boolean, optional. Pay with native HYPE as the value of the call. Defaults to true for a vault that holds HYPE"
                  }
                },
                "additionalProperties": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Steps"
                }
              }
            }
          },
          "400": {
            "description": "Something in the request is missing or malformed. The message says what.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The chain would refuse the transaction right now, or the contracts are not deployed (code not_live). The message says why.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Elysium could not be read (code rpc_unavailable), or the database could not (code database_unavailable). No number is given in its place.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/tx/withdrawQueued": {
      "post": {
        "operationId": "postTxWithdrawQueued",
        "tags": [
          "Transactions"
        ],
        "summary": "Take back a deposit that is still queued",
        "description": "Answers with unsigned steps. The transaction can be sent by the owner of the funds. Nothing is signed or sent by the server.",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "vault": {
                    "type": "string",
                    "description": "string, the vault's id (such as cash-weekly) or its address"
                  },
                  "amount": {
                    "type": "string",
                    "description": "string, a decimal number of the vault's asset such as \"12.5\". Or send amountRaw: a whole number of the smallest unit"
                  },
                  "unwrap": {
                    "type": "boolean",
                    "description": "boolean, optional. Pay native HYPE instead of WHYPE. Defaults to true for a vault that holds HYPE"
                  }
                },
                "additionalProperties": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Steps"
                }
              }
            }
          },
          "400": {
            "description": "Something in the request is missing or malformed. The message says what.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The chain would refuse the transaction right now, or the contracts are not deployed (code not_live). The message says why.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Elysium could not be read (code rpc_unavailable), or the database could not (code database_unavailable). No number is given in its place.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/tx/requestRedeem": {
      "post": {
        "operationId": "postTxRequestRedeem",
        "tags": [
          "Transactions"
        ],
        "summary": "Queue shares to be redeemed at the end of the current epoch",
        "description": "Answers with unsigned steps. The transaction can be sent by the owner of the funds. Nothing is signed or sent by the server.",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "vault": {
                    "type": "string",
                    "description": "string, the vault's id (such as cash-weekly) or its address"
                  },
                  "shares": {
                    "type": "string",
                    "description": "string, a decimal number of shares such as \"12.5\". Or send sharesRaw: a whole number of the smallest unit"
                  }
                },
                "additionalProperties": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Steps"
                }
              }
            }
          },
          "400": {
            "description": "Something in the request is missing or malformed. The message says what.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The chain would refuse the transaction right now, or the contracts are not deployed (code not_live). The message says why.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Elysium could not be read (code rpc_unavailable), or the database could not (code database_unavailable). No number is given in its place.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/tx/cancelRedeem": {
      "post": {
        "operationId": "postTxCancelRedeem",
        "tags": [
          "Transactions"
        ],
        "summary": "Take back shares that are still queued for redemption",
        "description": "Answers with unsigned steps. The transaction can be sent by the owner of the funds. Nothing is signed or sent by the server.",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "vault": {
                    "type": "string",
                    "description": "string, the vault's id (such as cash-weekly) or its address"
                  },
                  "shares": {
                    "type": "string",
                    "description": "string, a decimal number of shares such as \"12.5\". Or send sharesRaw: a whole number of the smallest unit"
                  }
                },
                "additionalProperties": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Steps"
                }
              }
            }
          },
          "400": {
            "description": "Something in the request is missing or malformed. The message says what.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The chain would refuse the transaction right now, or the contracts are not deployed (code not_live). The message says why.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Elysium could not be read (code rpc_unavailable), or the database could not (code database_unavailable). No number is given in its place.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/tx/completeRedeem": {
      "post": {
        "operationId": "postTxCompleteRedeem",
        "tags": [
          "Transactions"
        ],
        "summary": "Collect the assets of a redemption that a roll has processed",
        "description": "Answers with unsigned steps. The transaction can be sent by the owner of the funds. Nothing is signed or sent by the server.",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "vault": {
                    "type": "string",
                    "description": "string, the vault's id (such as cash-weekly) or its address"
                  },
                  "unwrap": {
                    "type": "boolean",
                    "description": "boolean, optional. Pay native HYPE instead of WHYPE. Defaults to true for a vault that holds HYPE"
                  }
                },
                "additionalProperties": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Steps"
                }
              }
            }
          },
          "400": {
            "description": "Something in the request is missing or malformed. The message says what.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The chain would refuse the transaction right now, or the contracts are not deployed (code not_live). The message says why.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Elysium could not be read (code rpc_unavailable), or the database could not (code database_unavailable). No number is given in its place.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/tx/redeemAtOnce": {
      "post": {
        "operationId": "postTxRedeemAtOnce",
        "tags": [
          "Transactions"
        ],
        "summary": "Redeem shares now, when no option of the current epoch is outstanding",
        "description": "Answers with unsigned steps. The transaction can be sent by the owner of the funds. Nothing is signed or sent by the server.",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "vault": {
                    "type": "string",
                    "description": "string, the vault's id (such as cash-weekly) or its address"
                  },
                  "shares": {
                    "type": "string",
                    "description": "string, a decimal number of shares such as \"12.5\". Or send sharesRaw: a whole number of the smallest unit"
                  },
                  "unwrap": {
                    "type": "boolean",
                    "description": "boolean, optional. Pay native HYPE instead of WHYPE. Defaults to true for a vault that holds HYPE"
                  }
                },
                "additionalProperties": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Steps"
                }
              }
            }
          },
          "400": {
            "description": "Something in the request is missing or malformed. The message says what.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The chain would refuse the transaction right now, or the contracts are not deployed (code not_live). The message says why.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Elysium could not be read (code rpc_unavailable), or the database could not (code database_unavailable). No number is given in its place.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/tx/buy": {
      "post": {
        "operationId": "postTxBuy",
        "tags": [
          "Transactions"
        ],
        "summary": "Buy options from a vault's live auction",
        "description": "Answers with unsigned steps. The transaction can be sent by the owner of the funds. Nothing is signed or sent by the server.",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "vault": {
                    "type": "string",
                    "description": "string, the vault's id (such as cash-weekly) or its address"
                  },
                  "address": {
                    "type": "string",
                    "description": "string, the 0x address that will sign and send the steps"
                  },
                  "amount": {
                    "type": "string",
                    "description": "string, a decimal number of options such as \"12.5\". Or send amountRaw: a whole number of the smallest unit. One option covers one whole unit of the underlying"
                  },
                  "slippageBps": {
                    "description": "integer, optional, 0 to 5000. Room above the premium read now. Defaults to 100",
                    "anyOf": [
                      {
                        "type": "integer"
                      },
                      {
                        "type": "string",
                        "pattern": "^[0-9]+$"
                      }
                    ]
                  },
                  "maxCost": {
                    "type": "string",
                    "description": "string, optional. The most to pay, as a decimal number of the vault's asset. Or maxCostRaw in the smallest unit"
                  },
                  "receiver": {
                    "type": "string",
                    "description": "string, optional. Who receives the options. Defaults to address"
                  },
                  "native": {
                    "type": "boolean",
                    "description": "boolean, optional. Pay with native HYPE as the value of the call. Defaults to true for a vault that holds HYPE"
                  }
                },
                "additionalProperties": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Steps"
                }
              }
            }
          },
          "400": {
            "description": "Something in the request is missing or malformed. The message says what.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The chain would refuse the transaction right now, or the contracts are not deployed (code not_live). The message says why.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Elysium could not be read (code rpc_unavailable), or the database could not (code database_unavailable). No number is given in its place.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/tx/placeOrder": {
      "post": {
        "operationId": "postTxPlaceOrder",
        "tags": [
          "Transactions"
        ],
        "summary": "Leave a standing order that buys from a vault's auction at or below a limit",
        "description": "Answers with unsigned steps. The transaction can be sent by the owner of the funds. Nothing is signed or sent by the server.",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "vault": {
                    "type": "string",
                    "description": "string, the vault's id (such as cash-weekly) or its address"
                  },
                  "address": {
                    "type": "string",
                    "description": "string, the 0x address that will sign and send the steps"
                  },
                  "amount": {
                    "type": "string",
                    "description": "string, a decimal number of options such as \"12.5\". Or send amountRaw: a whole number of the smallest unit. The most to buy"
                  },
                  "budget": {
                    "type": "string",
                    "description": "string, the premium to set aside, as a decimal number of the vault's asset. Or budgetRaw in the smallest unit. It stays yours until the order fills, and what is not spent comes back"
                  },
                  "maxPriceBps": {
                    "description": "integer, the highest price to accept, in basis points of the option's collateral. Or maxPriceWad: the same share with 18 decimals",
                    "anyOf": [
                      {
                        "type": "integer"
                      },
                      {
                        "type": "string",
                        "pattern": "^[0-9]+$"
                      }
                    ]
                  },
                  "validUntil": {
                    "description": "integer, optional. Unix time after which the order no longer fills. 0, the default, waits until it fills or is cancelled",
                    "anyOf": [
                      {
                        "type": "integer"
                      },
                      {
                        "type": "string",
                        "pattern": "^[0-9]+$"
                      }
                    ]
                  },
                  "native": {
                    "type": "boolean",
                    "description": "boolean, optional. Pay with native HYPE as the value of the call. Defaults to true for a vault that holds HYPE"
                  }
                },
                "additionalProperties": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Steps"
                }
              }
            }
          },
          "400": {
            "description": "Something in the request is missing or malformed. The message says what.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The chain would refuse the transaction right now, or the contracts are not deployed (code not_live). The message says why.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Elysium could not be read (code rpc_unavailable), or the database could not (code database_unavailable). No number is given in its place.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/tx/cancelOrder": {
      "post": {
        "operationId": "postTxCancelOrder",
        "tags": [
          "Transactions"
        ],
        "summary": "Cancel a standing order and get its whole budget back",
        "description": "Answers with unsigned steps. The transaction can be sent by the owner of the funds. Nothing is signed or sent by the server.",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "description": "string, the order's id"
                  },
                  "unwrap": {
                    "type": "boolean",
                    "description": "boolean, optional. Pay native HYPE instead of WHYPE when the order's asset is WHYPE. Defaults to true"
                  }
                },
                "additionalProperties": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Steps"
                }
              }
            }
          },
          "400": {
            "description": "Something in the request is missing or malformed. The message says what.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The chain would refuse the transaction right now, or the contracts are not deployed (code not_live). The message says why.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Elysium could not be read (code rpc_unavailable), or the database could not (code database_unavailable). No number is given in its place.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/tx/redeemOptions": {
      "post": {
        "operationId": "postTxRedeemOptions",
        "tags": [
          "Transactions"
        ],
        "summary": "Collect the payout of options of a settled epoch",
        "description": "Answers with unsigned steps. The transaction can be sent by anyone. Nothing is signed or sent by the server.",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "vault": {
                    "type": "string",
                    "description": "string, the vault's id (such as cash-weekly) or its address"
                  },
                  "epoch": {
                    "description": "integer, the epoch the options belong to",
                    "anyOf": [
                      {
                        "type": "integer"
                      },
                      {
                        "type": "string",
                        "pattern": "^[0-9]+$"
                      }
                    ]
                  },
                  "holder": {
                    "type": "string",
                    "description": "string, the 0x address that holds the options. The payout always goes to it"
                  },
                  "unwrap": {
                    "type": "boolean",
                    "description": "boolean, optional. Pay native HYPE instead of WHYPE. Defaults to true for a vault that holds HYPE. Honoured only when the holder sends the transaction itself"
                  }
                },
                "additionalProperties": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Steps"
                }
              }
            }
          },
          "400": {
            "description": "Something in the request is missing or malformed. The message says what.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The chain would refuse the transaction right now, or the contracts are not deployed (code not_live). The message says why.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Elysium could not be read (code rpc_unavailable), or the database could not (code database_unavailable). No number is given in its place.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/tx/roll": {
      "post": {
        "operationId": "postTxRoll",
        "tags": [
          "Transactions"
        ],
        "summary": "End a vault's expired epoch and begin the next",
        "description": "Answers with unsigned steps. The transaction can be sent by anyone. Nothing is signed or sent by the server.",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "vault": {
                    "type": "string",
                    "description": "string, the vault's id (such as cash-weekly) or its address"
                  }
                },
                "additionalProperties": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Steps"
                }
              }
            }
          },
          "400": {
            "description": "Something in the request is missing or malformed. The message says what.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The chain would refuse the transaction right now, or the contracts are not deployed (code not_live). The message says why.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Elysium could not be read (code rpc_unavailable), or the database could not (code database_unavailable). No number is given in its place.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/tx/startAuction": {
      "post": {
        "operationId": "postTxStartAuction",
        "tags": [
          "Transactions"
        ],
        "summary": "Start the current epoch's auction",
        "description": "Answers with unsigned steps. The transaction can be sent by anyone. Nothing is signed or sent by the server.",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "vault": {
                    "type": "string",
                    "description": "string, the vault's id (such as cash-weekly) or its address"
                  }
                },
                "additionalProperties": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Steps"
                }
              }
            }
          },
          "400": {
            "description": "Something in the request is missing or malformed. The message says what.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The chain would refuse the transaction right now, or the contracts are not deployed (code not_live). The message says why.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Elysium could not be read (code rpc_unavailable), or the database could not (code database_unavailable). No number is given in its place.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/tx/settle": {
      "post": {
        "operationId": "postTxSettle",
        "tags": [
          "Transactions"
        ],
        "summary": "Settle a vault's expired epoch",
        "description": "Answers with unsigned steps. The transaction can be sent by anyone. Nothing is signed or sent by the server.",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "vault": {
                    "type": "string",
                    "description": "string, the vault's id (such as cash-weekly) or its address"
                  }
                },
                "additionalProperties": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Steps"
                }
              }
            }
          },
          "400": {
            "description": "Something in the request is missing or malformed. The message says what.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The chain would refuse the transaction right now, or the contracts are not deployed (code not_live). The message says why.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Elysium could not be read (code rpc_unavailable), or the database could not (code database_unavailable). No number is given in its place.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/tx/fix": {
      "post": {
        "operationId": "postTxFix",
        "tags": [
          "Transactions"
        ],
        "summary": "Fix the settlement price of an expiry on a vault's price source",
        "description": "Answers with unsigned steps. The transaction can be sent by anyone. Nothing is signed or sent by the server.",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "vault": {
                    "type": "string",
                    "description": "string, the vault's id (such as cash-weekly) or its address"
                  },
                  "expiry": {
                    "description": "integer, optional. The expiry as Unix time. Defaults to the expiry of the vault's current epoch",
                    "anyOf": [
                      {
                        "type": "integer"
                      },
                      {
                        "type": "string",
                        "pattern": "^[0-9]+$"
                      }
                    ]
                  }
                },
                "additionalProperties": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Steps"
                }
              }
            }
          },
          "400": {
            "description": "Something in the request is missing or malformed. The message says what.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The chain would refuse the transaction right now, or the contracts are not deployed (code not_live). The message says why.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Elysium could not be read (code rpc_unavailable), or the database could not (code database_unavailable). No number is given in its place.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/tx/claimShares": {
      "post": {
        "operationId": "postTxClaimShares",
        "tags": [
          "Transactions"
        ],
        "summary": "Send an account the shares a roll has made from its deposit",
        "description": "Answers with unsigned steps. The transaction can be sent by anyone. Nothing is signed or sent by the server.",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "vault": {
                    "type": "string",
                    "description": "string, the vault's id (such as cash-weekly) or its address"
                  },
                  "account": {
                    "type": "string",
                    "description": "string, the 0x address the shares belong to"
                  }
                },
                "additionalProperties": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Steps"
                }
              }
            }
          },
          "400": {
            "description": "Something in the request is missing or malformed. The message says what.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The chain would refuse the transaction right now, or the contracts are not deployed (code not_live). The message says why.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Elysium could not be read (code rpc_unavailable), or the database could not (code database_unavailable). No number is given in its place.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/tx/completeRedeemFor": {
      "post": {
        "operationId": "postTxCompleteRedeemFor",
        "tags": [
          "Transactions"
        ],
        "summary": "Send an account the assets of its processed redemption",
        "description": "Answers with unsigned steps. The transaction can be sent by anyone. Nothing is signed or sent by the server.",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "vault": {
                    "type": "string",
                    "description": "string, the vault's id (such as cash-weekly) or its address"
                  },
                  "account": {
                    "type": "string",
                    "description": "string, the 0x address the redemption belongs to"
                  }
                },
                "additionalProperties": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Steps"
                }
              }
            }
          },
          "400": {
            "description": "Something in the request is missing or malformed. The message says what.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The chain would refuse the transaction right now, or the contracts are not deployed (code not_live). The message says why.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Elysium could not be read (code rpc_unavailable), or the database could not (code database_unavailable). No number is given in its place.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/tx/collectFees": {
      "post": {
        "operationId": "postTxCollectFees",
        "tags": [
          "Transactions"
        ],
        "summary": "Send a vault's accrued protocol fee to its fee recipient",
        "description": "Answers with unsigned steps. The transaction can be sent by anyone. Nothing is signed or sent by the server.",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "vault": {
                    "type": "string",
                    "description": "string, the vault's id (such as cash-weekly) or its address"
                  }
                },
                "additionalProperties": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Steps"
                }
              }
            }
          },
          "400": {
            "description": "Something in the request is missing or malformed. The message says what.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The chain would refuse the transaction right now, or the contracts are not deployed (code not_live). The message says why.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Elysium could not be read (code rpc_unavailable), or the database could not (code database_unavailable). No number is given in its place.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/tx/recordSpot": {
      "post": {
        "operationId": "postTxRecordSpot",
        "tags": [
          "Transactions"
        ],
        "summary": "Record the oracle's current price in a vault",
        "description": "Answers with unsigned steps. The transaction can be sent by anyone. Nothing is signed or sent by the server.",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "vault": {
                    "type": "string",
                    "description": "string, the vault's id (such as cash-weekly) or its address"
                  }
                },
                "additionalProperties": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Steps"
                }
              }
            }
          },
          "400": {
            "description": "Something in the request is missing or malformed. The message says what.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The chain would refuse the transaction right now, or the contracts are not deployed (code not_live). The message says why.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Elysium could not be read (code rpc_unavailable), or the database could not (code database_unavailable). No number is given in its place.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/tx/fillOrder": {
      "post": {
        "operationId": "postTxFillOrder",
        "tags": [
          "Transactions"
        ],
        "summary": "Fill a standing order from its vault's live auction",
        "description": "Answers with unsigned steps. The transaction can be sent by anyone. Nothing is signed or sent by the server.",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "description": "string, the order's id"
                  }
                },
                "additionalProperties": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Steps"
                }
              }
            }
          },
          "400": {
            "description": "Something in the request is missing or malformed. The message says what.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The chain would refuse the transaction right now, or the contracts are not deployed (code not_live). The message says why.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Elysium could not be read (code rpc_unavailable), or the database could not (code database_unavailable). No number is given in its place.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Answer": {
        "type": "object",
        "description": "Every answer carries the time it was made and where its numbers come from. An amount is a decimal string of the smallest unit, with a `...Display` twin to read. A value that does not exist is null, and \"-\" in its twin.",
        "required": [
          "asOf",
          "source"
        ],
        "properties": {
          "asOf": {
            "type": "integer",
            "description": "Unix seconds."
          },
          "source": {
            "type": "string",
            "enum": [
              "chain",
              "database",
              "config"
            ],
            "description": "chain: read from the contracts just now. database: the keeper's record of chain events. config: the rules the contracts are deployed with, and arithmetic."
          },
          "live": {
            "type": "boolean",
            "description": "False while the contracts are not on Elysium. The answer then carries rules, never balances or prices."
          }
        },
        "additionalProperties": true
      },
      "Step": {
        "type": "object",
        "description": "One unsigned transaction. Sign it with the address that asked and send it yourself.",
        "required": [
          "step",
          "action",
          "chainId",
          "to",
          "data",
          "value",
          "description"
        ],
        "properties": {
          "step": {
            "type": "integer",
            "description": "Its place in the order, from 1."
          },
          "action": {
            "type": "string",
            "description": "approve, or the name of the contract function."
          },
          "chainId": {
            "type": "integer",
            "const": 99901
          },
          "to": {
            "type": "string",
            "pattern": "^0x[0-9a-fA-F]{40}$"
          },
          "data": {
            "type": "string",
            "pattern": "^0x[0-9a-fA-F]*$"
          },
          "value": {
            "type": "string",
            "pattern": "^[0-9]+$",
            "description": "Native HYPE sent with the call, in wei."
          },
          "description": {
            "type": "string"
          }
        }
      },
      "Steps": {
        "type": "object",
        "required": [
          "asOf",
          "source",
          "steps"
        ],
        "properties": {
          "asOf": {
            "type": "integer"
          },
          "source": {
            "type": "string",
            "enum": [
              "chain"
            ]
          },
          "steps": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Step"
            },
            "description": "In the order they must be sent. Send each only after the one before it is in a block."
          },
          "notes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "additionalProperties": true
      },
      "Error": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "object",
            "required": [
              "code",
              "message"
            ],
            "properties": {
              "code": {
                "type": "string",
                "description": "A stable code a program can branch on, such as limit_required, not_live or rpc_unavailable."
              },
              "message": {
                "type": "string",
                "description": "One or two sentences that say what happened and what to do."
              }
            },
            "additionalProperties": true
          }
        }
      }
    }
  }
}