Create an order
/sigmafi/ordersapi_keyLock collateral in an order asking to borrow ERG or one token, repaid by a fixed height or a number of blocks after a lender fills it. Do not send batchingFee on creation: the lender chooses and funds the reserve when filling. Cancel it with POST /sigmafi/orders/{boxId}/cancel while it is unfilled.
Request body
SFOrderRequest · application/jsoncollateralNanoErgsstringrequired▶
collateralTokensSFTokenAmount[]tokenIdstringrequiredamountstringrequiredBase units.
principalNanoErgsstring▶
principalTokenSFTokenAmounttokenIdstringrequiredamountstringrequiredBase units.
repaymentstringrequiredmaturityHeightinteger · int64At least 3 blocks above the current height.
durationBlocksinteger · int6430 – …batchingFeestringRejected on order creation. The lender selects this reserve in SFFillRequest instead.
liquidationstringdefault"MaturityLiquidation"
Responses
200The transaction was sent; `outcome` says whether the node accepted it.SFResult▶
txIdstringrequiredoutcomestringrequiredone ofacceptedrejecteduncertainboxIdstringThe output that matters: the new order or bond, the vault box a repayment or liquidation pays, or the first box a cancel or claim returns to this wallet.
assetIdstringThe bond asset a fill minted.
warningsstring[]What to know about the sent transaction: vault boxes a claim left locked for good, or a repayment sent with two blocks or fewer left to be mined in.
400A malformed field, or terms no contract or shipped client accepts.ApiError▶
errorintegerrequiredError code
reasonstringrequiredError message explaining the reason of the error
detailstringrequirednullableDetailed error description
403Missing or wrong api_key.ApiError▶
errorintegerrequiredError code
reasonstringrequiredError message explaining the reason of the error
detailstringrequirednullableDetailed error description
422Valid, but not possible now: the box's terms are refused, maturity has passed or not come, the wallet cannot cover it, or no wallet box can authorize a cancel.ApiError▶
errorintegerrequiredError code
reasonstringrequiredError message explaining the reason of the error
detailstringrequirednullableDetailed error description
503Node, wallet or transaction engine unavailable, or the request ran out of time. The message says whether anything was sent. When it says the outcome is unknown, check `GET /sigmafi/portfolio` before retrying.ApiError▶
errorintegerrequiredError code
reasonstringrequiredError message explaining the reason of the error
detailstringrequirednullableDetailed error description