Take an offer
Buy from an ask or sell to a bid. Units, cash and the fee settle in one instruction.
Taking an offer trades at a price already on the board: you buy from an ask or sell to a bid, and pay the settlement fee. The units and the cash cross in one instruction.
Before you start
- You are admitted, and you didn't post the offer.
- To take an ask: units times price plus the fee, free in your ledger cash.
- To take a bid: the units, free in your position.
In the app
Pick an offer
In Markets, open the instrument. Its Offer board lists bids and asks with price, size and maker; choose one.
Enter the units
The panel reads Buy from this ask or Sell to this bid. Enter units, up to the offer's open size, and press Review trade: it shows both legs and the settlement fee before you sign.
Sign and settle
The trade settles with its signature, and See it on the ledger opens it on the ledger. If any leg is short, the panel shows Failed with the program's error name and nothing moves.
Through the API
const { bids } = await api.book('HALDEN')
const best = bids[0] // highest bid first
if (best) {
const build = await api.buildTakeOffer({ wallet, offerId: best.id, units: '25' })
// build.summary.legs: your units to the maker, the maker's cash to you; build.summary.fee
await send(build, sign)
}curl "$AGORA_API/v1/instruments/HALDEN/book"
curl -X POST "$AGORA_API/v1/build/take-offer" -H 'content-type: application/json' \
-d '{"wallet":"<wallet>","offerId":"<offer id>","units":"25"}'Bids come highest first and asks lowest first. send is the helper from A first settlement.
What it ends in
| You take | You pay | You receive |
|---|---|---|
| An ask | units × price + fee, from free cash | the units, in your free lane |
| A bid | the units, from your free lane | units × price − fee, in free cash |
The maker's side comes out of their lock. The offer's open size falls by your units, and closes at zero. The instrument's last price becomes the offer's price, and the settlement is the kind trade, with every leg and the fee.
If it fails
SelfTrade: you posted this offer.OfferTooSmall: more units than the offer has open. Read the book again: someone may have filled part of it.InsufficientFreeCash: taking an ask, your free cash is short of the cash leg plus the fee.InsufficientFreeUnits: taking a bid, your free units are short.NotAdmitted: the wallet isn't a member.