Concepts
Fees and offers
What a request costs, who sets it, and where each part of the fee goes.
A request costs one fee: the price of the offer it uses. The operator sets that price and the mint it is charged in. The fee waits in escrow from the request until the receipt is final or void.
Beside the fee, the requester pays the rent of the receipt account that request creates, and the rent of the escrow's token account the first time a mint is used on the network.
Offers
An offer is one operator's terms for one model. It is an account at seeds ["offer", operator_authority, model]:
| Field | Meaning |
|---|---|
operator | The operator that will answer. |
model | The model it answers. |
mint | The SPL token the price is charged in. |
price | The fee per request, in the mint's base units. |
active | Whether the offer takes requests. |
An operator creates or changes an offer with set_offer (price, active, and the mint passed as an account). The mint is the operator's choice per offer: any mint of the SPL Token program works, and an operator serving agents that pay in USDC prices in USDC.
GET /v1/offers?model= lists a model's offers sorted by price, live ones first. An offer is live when its operator answered within the last 10 minutes or holds no unanswered request past its deadline.
Choosing an offer
A request names its operator, so asking means picking an offer:
- On
/ask, the cheapest live offer for the model is preselected and the others are listed with price and mint. laplace.ask(model, input)takes the cheapest live offer. Pass{ offer }to name one.laplace ask <model> <input…>does the same, with--offer <key>to name one.
Where the fee goes
| Instruction | The fee |
|---|---|
request | The offer's price moves from the requester's token account into the fee escrow: the token account of the escrow authority (seeds ["escrow"]) for that mint. The receipt records mint and fee. |
finalize | The fee leaves escrow. protocol_share_bps of it goes to the protocol's fee recipient, and the rest goes to the answerer, in the same instruction. |
cancel_request | The whole fee returns to the requester. The receipt is void. |
request fails with OfferInactive when the offer is off and with MintMismatch when the mint passed in differs from the offer's.
The fee follows the answer that stands. When a challenger wins a dispute, their output is the receipt's answer and the fee is paid to them at finalize.
The protocol share
protocol_share_bps is a field of the Config account, in basis points of each finalized fee. GET /v1/network returns the current value as protocol.shareBps. The protocol's part is rounded down, so the answerer keeps the remainder.
What the protocol's share does is told on Network, with the LAPLACE token.
When no answer arrives
A request sets answer_deadline to the moment it lands plus answer_deadline_secs from Config. The named operator can answer until then; later, answer fails with AnswerDeadlinePassed. Once the deadline has passed with no answer, the requester sends cancel_request and receives the full fee. Before the deadline it fails with AnswerDeadlineOpen.
In the app this is the Cancel and refund button on the receipt. In the SDK it is laplace.cancel(receipt).
Pricing an answer
Two figures describe what a requester buys, and both are on the model:
- the bond, the SOL an answerer loses if the answer is wrong,
- the window, the seconds anyone has to show it is.
A requester whose own program acts on the receipt compares the bond with what rides on the answer. Bonds and windows covers both figures; Bond and offers covers setting a price as an operator.