Trading
Silvana supports two trading flows:- RFQ (Request for Quote) is a request that a firm quotes from liquidity providers (LPs), accepts one, and then settles. Best when you want fast execution and an explicit quote.
- Limit orders (CLOB) are bids/offers on the order book and get filled when the market trades at your price. Best when you want price control and are willing to wait.
Example for
CBTC/CC with quantity = 0.10 and price = 1000 (CC per CBTC):- Buy: receive
0.10 CBTC, pay100 CC - Sell: deliver
0.10 CBTC, receive100 CC
Buy via CLI
If your goal is simply to purchase an asset without building against the gRPC API yet, the fastest path is the Silvana Book agent CLI. Throughout this page, commands usecloud-agent. If you haven’t installed it into your PATH, use target/release/cloud-agent instead.
The CLI purchase flow uses RFQ under the hood and can chunk a large buy into multiple settlements until the full amount is filled.
Prerequisites
The following links are necessary for developers to access the protocol, library interface, and reference implementation:
- Build the CLI:
- Onboard once (writes/updates your
.env):
Step 1. Pick a market
You’ll need amarket\_id (example: CBTC-CC). Obtain it via OrderbookService.GetMarkets (or from your environment).
Step 2. Sanity-check balances
Step 3. Add a purchase via RFQ fill loop
--price-limit \<PRICE\>: maximum price per 1 base (quote per base)--min-settlement \<AMT\>: minimum chunk size per settlement--max-settlement \<AMT\>: cap chunk size per settlement--interval \<SECS\>: retry interval between RFQ rounds
Sell via CLI
Use this when you want to sell the base asset on a market (e.g., sell CBTC for CC on CBTC-CC) without wiring up the gRPC API. Like the buy loop, this uses RFQ and can split a large sell into multiple settlements, retrying until the full amount is filled.Buy via RFQ
Step 1. Choose a market
CallOrderbookService.GetMarkets and select market_id.
Step 2. Request quotes
CallOrderbookService.RequestQuotes with:
market_iddirection = "buy"quantity(base quantity you want to buy)
Step 3. Review quotes
For each quote, check:price(quote per base)quote_quantity(total quote you will pay)valid_until(expiry)- optional deadlines:
allocate_before_secs,settle_before_secs - fee estimates:
estimated_total_fee
Step 4. Accept a quote
- Call
OrderbookService.AcceptQuote(rfq_id, quote_id). - Save
proposal_id(used to track settlement).
Step 5. Track settlement
Subscribe:OrderbookService.SubscribeSettlements, or Poll: SettlementService.GetSettlementStatus(settlement_id = proposal_id) for authoritative step-by-step state.
Sell via RFQ
Same as RFQ buy, but withdirection = "sell" and quantity equal to the base amount you want to sell.
- Choose a market (
GetMarkets→market_id) - Request quotes (
direction = "sell",quantity= base to sell) - Review quotes (
price,quote_quantity,valid_until, deadlines, fee estimate) - Accept a quote (
AcceptQuote→ saveproposal_id) - Track settlement (
SubscribeSettlementsorGetSettlementStatus)
Buy via limit order (CLOB)
Step 1. Read the book
CallOrderbookService.GetOrderbookDepth and/or OrderbookService.GetMarketData.
Step 2. Submit a bid
CallOrderbookService.SubmitOrder with:
order_type = ORDER_TYPE_BIDpriceandquantity(base)- optional
time_in_forceandexpires_at
Step 3. Monitor fills
SubmitOrderbookService.SubscribeOrders or OrderbookService.GetOrders.
Step 4. Cancel if needed
UseOrderbookService.CancelOrder(order_id).
Step 5. Track settlement for matched fills
UseOrderbookService.SubscribeSettlements or SettlementService.GetSettlementStatus.
Sell via limit order (CLOB)
Same as limit buy, but submitorder_type = ORDER_TYPE_OFFER in Step 2.
How to know a trade is complete
A trade is complete when its settlement proposal is settled (not just “accepted” or “in progress”).
- Orderbook view:
SubscribeSettlements/GetSettlementProposals - Settlement view (authoritative):
SettlementService.GetSettlementStatus