Skip to main content
An options position is one contract. CoveredCall pays the holder when the fixing is above the strike. LimitedPut pays the holder when the fixing is below the strike. The read of the oracle output, the read fee, and the dust fold are Option. Both contracts call it. The writer and the holder are fixed in the constructor. arkade.trade runs a live desk that acts as the holder. The settlement price ST is the fixing for expiry, in USD cents. K is strike. Q is collateral. Division truncates. A covered call pays the holder Q * (ST - K) / ST when ST is above K. A limited put pays the holder Q * (K - ST) / ST when ST is below K. The put payment is at most Q. The holder receives no collateral when a covered call finishes at or below K, or a limited put finishes at or above K. settle spends this output as input 0 and the oracle output as input 1. Output 0 continues the oracle output. readFee sats of this output are added to that output. The payouts start at output 1 and sum to the locked value minus readFee. A leg of 330 sats or less folds into the other output. Anyone may submit settle once the emulator clock reaches expiry. writerScript and holderScript are 32-byte witness programs (tweakedPublicKey). Spend outputs use pkScript. serverExitDelay is not a parameter. The client binds it (CSV delays). unilateral is the exit if the operator is unavailable: after that delay, the writer alone signs. The holder gets nothing on that path. close checks the two signatures and does not check the outputs. The two parties can pay any scripts.
option.ark
covered_call.ark
limited_put.ark

Constructor

Both contracts take these parameters. Option holds the checks they share.

Functions

CoveredCall.settle pays collateral * (ST - K) / ST when the fixing is above the strike. LimitedPut.settle pays collateral * (K - ST) / ST when the fixing is below the strike, and at most collateral. close requires both signatures. unilateral is the exit if the operator is unavailable. After serverExitDelay, the writer alone signs and can take the whole output.