# Manifests

You don't need CaviarNine to interact with any smart contract. All you need is the manifest and to submit it the Radix network. An easy way to submit is already supplied by Radix via their dashboard: <https://console.radixdlt.com/transaction-manifest>

## Price Condition Information:

Please note that any price sent to a CaviarNine Order Book can have a maximum of 5 significant figures.

```
Decimal("{PRICE}") - This must be a number with maximum 5 significant figures
```

## Place a single limit order:

Simple manifest to place a single order

```
CALL_METHOD
    Address("{ACCOUNT}")
    "withdraw"
    Address("{TOKEN}")
    Decimal("{AMOUNT}")
;
TAKE_ALL_FROM_WORKTOP
    Address("{TOKEN}")
    Bucket("tokens")
;

CALL_METHOD
    Address("{ORDER_BOOK_COMPONENT}")
    "limit_order"
    Bucket("tokens")
    Decimal("{PRICE}")
;

CALL_METHOD
    Address("{ACCOUNT}")
    "deposit_batch"
    Expression("ENTIRE_WORKTOP")
;
```

## Place multiple limit orders:

Condition:

```
AMOUNT >= AMOUNT_0 + AMOUNT_1 + AMOUNT_2 ...
```

Manifest example below with 3 limits placed at the same time. The limit of the number of orders you can place at any one time is set by the Radix gas being spent:

```
CALL_METHOD
    Address("{ACCOUNT}")
    "withdraw"
    Address("{TOKEN}")
    Decimal("{AMOUNT}")
;

TAKE_FROM_WORKTOP
    Address("{TOKEN}")
    Decimal("{AMOUNT_0}")
    Bucket("tokens_0")
;
TAKE_FROM_WORKTOP
    Address("{TOKEN}")
    Decimal("{AMOUNT_1}")
    Bucket("tokens_1")
;
TAKE_FROM_WORKTOP
    Address("{TOKEN}")
    Decimal("{AMOUNT_2}")
    Bucket("tokens_2")
;

CALL_METHOD
    Address("{ORDER_BOOK_COMPONENT}")
    "limit_order_batch"
    Array<Tuple>(
        Tuple(
            Bucket("tokens_0"),
            Decimal("{PRICE_0}")
        ),
        Tuple(
            Bucket("tokens_1"),
            Decimal("{PRICE_1}")
        ),
        Tuple(
            Bucket("tokens_2"),
            Decimal("{PRICE_2}")
        ),
    )
;

CALL_METHOD
    Address("{ACCOUNT}")
    "deposit_batch"
    Expression("ENTIRE_WORKTOP")
;
```

## Claim or Cancel a Single Order:

Cancelling or Claiming is an identical manifest.

* If your order has been 100% filled you will get back you filled tokens
* If your order has been partially filled, you will get back the correct amount of both tokens
* If you order has been traded on, you will get back 100% of the original tokens you put in

To claim/cancel your orders you will need:

<pre><code><strong>ORDER_BOOK_ORDER_RECEIPT - Get this from your wallet
</strong>ORDER_ID - Get this from your wallet
</code></pre>

Manifest below claiming a single order:

```
CALL_METHOD
    Address("{ACCOUNT}")
    "withdraw_non_fungibles"
    Address("{ORDER_BOOK_ORDER_RECEIPT}")
    Array<NonFungibleLocalId>(
        NonFungibleLocalId("{ORDER_ID}"),
    )
;
TAKE_NON_FUNGIBLES_FROM_WORKTOP
    Address("{ORDER_BOOK_ORDER_RECEIPT}")
    Array<NonFungibleLocalId>(
        NonFungibleLocalId("{ORDER_ID}"),
    )
    Bucket("order_receipts")
;

CALL_METHOD
    Address("{ORDER_BOOK_COMPONENT}")
    "claim_orders"
    Bucket("order_receipts")
;

CALL_METHOD
    Address("{ACCOUNT}")
    "deposit_batch"
    Expression("ENTIRE_WORKTOP")
;
```

## Claim or Cancel Multiple Orders:

Please read above manifest also.

If you have multiple orders from the same order book component, you can cell them in one manifest:

```
CALL_METHOD
    Address("{ACCOUNT}")
    "withdraw_non_fungibles"
    Address("{ORDER_BOOK_ORDER_RECEIPT}")
    Array<NonFungibleLocalId>(
        NonFungibleLocalId("{ORDER_ID_01}"),
        NonFungibleLocalId("{ORDER_ID_02}"),
        NonFungibleLocalId("{ORDER_ID_03}"),
    )
;
TAKE_NON_FUNGIBLES_FROM_WORKTOP
    Address("{ORDER_BOOK_ORDER_RECEIPT}")
    Array<NonFungibleLocalId>(
        NonFungibleLocalId("{ORDER_ID_01}"),
        NonFungibleLocalId("{ORDER_ID_02}"),
        NonFungibleLocalId("{ORDER_ID_03}"),
    )
    Bucket("order_receipts")
;

CALL_METHOD
    Address("{ORDER_BOOK_COMPONENT}")
    "claim_orders"
    Bucket("order_receipts")
;

CALL_METHOD
    Address("{ACCOUNT}")
    "deposit_batch"
    Expression("ENTIRE_WORKTOP")
;
```

## Execute a Market Order (trade directly with component)&#x20;

A simple manifest below. Note that the {STOP\_PRICE} is an Enum so Optional

```
CALL_METHOD
    Address("{ACCOUNT}")
    "withdraw"
    Address("{TOKEN}")
    Decimal("{AMOUNT}")
;
TAKE_ALL_FROM_WORKTOP
    Address("{TOKEN}")
    Bucket("tokens")
;

CALL_METHOD
    Address("{ORDER_BOOK_COMPONENT}")
    "market_order"
    Bucket("tokens")
    Enum<1u8>(
        Decimal("{STOP_PRICE}")
    )
;

CALL_METHOD
    Address("{ACCOUNT}")
    "deposit_batch"
    Expression("ENTIRE_WORKTOP")
;
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.caviarnine.com/products-floop/order-book/manifests.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
