Create a lend offer
/sigmafi/zc/offersapi_keyPost a LendOffer that batchers fill from orders and asks it accepts.
Request body
ZcOfferRequest · application/jsonmarketstringrequiredone ofERGSigUSDcapitalstringrequiredminYieldBpsinteger · int64required▶
curveZcPoint[]Blocks strictly increasing.
blocksinteger · int64requiredBlocks left to maturity.
bpsinteger · int64requiredSimple yield per 262,800 blocks, in bps.
minBlocksinteger · int64maxBlocksinteger · int64floorBpsinteger · int64requiredLeast cover a bond it buys must have.
oracleAgeinteger · int64Default 30.
expiryinteger · int64reserveNanoErgstringThe fee reserve each new bond gets. Default 50000000.
minPricestringDefault 1.
▶
ergobjectAn ERG offer's batcher fee per fill. It must leave more than 0.001 ERG of the capital, and an expiry refund pays it too.
batcherFeeNanoErgstring
▶
tokenobjectA SigUSD offer's refund fee, ERG funding, least fill and reward budget.
refundFeeNanoErgstringergFundingNanoErgstringminFillBpsinteger · int64rewardBudgetNanoErgstring
▶
shareBoundsobjectnullablenull buys no shares.
floorBpsinteger · int64maxExpiryinteger · int64
deliveryobject{ kind: unit }, or{ kind: selective or dutch, openingBps, floorBps, length, expiry, mintFeeNanoErg, pullFeeNanoErg, shareCount }, checked and defaulted as a fractionalize body is.▶
limitsZcLimitsBounds on the rebuilt transaction. For fills, buys, repays, recollateralizations and claims, amounts are in the action's market unit (nanoERG for ERG, fee included; raw units for SigUSD; nanoERG for actions with no market). For posts (orders, offers, asks, lots, fractionalize and wraps),
maxPayis always in nanoERG (box value plus miner fee), since any token capital or collateral is fixed directly by the request body. Outside them the send answers 409.maxPaystringminReceivestring
Responses
200The transaction was sent; `outcome` says whether the node accepted it.ZcResult▶
txIdstringnullableNone while the write is held.
outcomestringThe node's answer.
held: the write reads the box a pending oracle refresh creates, and a miner could reach it before that refresh, so nothing was sent yet. The client tries it again every 30 seconds for 10 minutes, rebuilt and checked againstlimitseach time, and sends it once the refresh confirms.one ofacceptedrejecteduncertainheldreasonstringWhy a write is held.
retriesUntilinteger · int64When a held write stops being tried (ms since the epoch).
boxIdstringnullableThe transaction's first output.
assetIdstringnullableThe bond asset a fill minted.
warningsstring[]
400A malformed field, or terms the contracts refuse.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
404No such box or token, or not this wallet's.ApiError▶
errorintegerrequiredError code
reasonstringrequiredError message explaining the reason of the error
detailstringrequirednullableDetailed error description
409A pending transaction already spends a box this needs, or the rebuilt transaction is outside `limits`. Re-quote and resend.ApiError▶
errorintegerrequiredError code
reasonstringrequiredError message explaining the reason of the error
detailstringrequirednullableDetailed error description
422Valid, but not possible now; the message gives the reason the check lists in `refusals`.ApiError▶
errorintegerrequiredError code
reasonstringrequiredError message explaining the reason of the error
detailstringrequirednullableDetailed error description
503ZC tracking is off or not seeded, or the node, its index or the wallet did not answer. Nothing was sent.ApiError▶
errorintegerrequiredError code
reasonstringrequiredError message explaining the reason of the error
detailstringrequirednullableDetailed error description