API reference · OTC
Fill an offer
POST
https://dev.payday.direct/api/v1/otc/fillOne transaction: the buyer pays in SOL, 95% to the seller, 5% to the PAYDAY buy and burn, coins to the buyer. Market offers are priced on chain when it lands and carry your limit (maxPay). The limit comes from the live market price plus 1%, never from the offer's reference: ABOVE_MARKET means the reference sits over the market (it comes down about 3% a minute). If the price moves past the limit (errCode 6016) or within the same block (NO_FILL_PRICE_MOVED, 6022), build the fill again, show the buyer the new pay and ask again.
Needs an API key in Authorization: Bearer or X-API-Key. Authentication
Body
walletstringrequiredThe wallet that signs and pays
listingstringrequiredamountRawstringrequiredRaw units to buy
Responses
200OK
400Refused; nothing to sign
401Missing or invalid key
429Over the limit. Retry-After says when to try again.
Response fields
okbooleantxstringUnsigned v0 transaction, base64. The wallet is its only signer and fee payer
unitsinteger | nullCompute units the test run used
networkFeeLamportsintegerNetwork fee for this transaction
listingstringlist: the new listing's address
rentLamportsintegerDeposits this transaction opens (listing and vault, or your token account); a listing's come back when it closes
rentNotestring | nullpaystringfill: what you pay, fee included. Lamports, as an integer string
feestringfill: the 5% part of pay. Lamports, as an integer string
toSellerstringfill: what the seller gets. Lamports, as an integer string
maxPaystringfill: your limit; the fill fails rather than pay more. Lamports, as an integer string
lockedPriceobject | nullfill, market offers: lamports per token unit as num/den, as of the test run
lockedPrice.numstringlockedPrice.denstringflooredbooleanfill, market offers: the market fell more than 3% under the offer's reference, so it is priced at the reference less 3% until that catches up
amountRawstringfill: the amount this transaction buys. Smallest token units, as an integer string