> ## Documentation Index
> Fetch the complete documentation index at: https://pond.dflow.net/llms.txt
> Use this file to discover all available pages before exploring further.

# Equity Fills

> Request equity direct fills and escrow fills and read the equity fields in the response

The app calls the [order endpoint](https://pond.dflow.net/resources/trading-api/order/order.md) with an equity mint as `inputMint` or `outputMint`. The response is a direct fill or an escrow fill.

## Equity Request Parameters

| Parameter | Effect |
| - | - |
| `userPublicKey` | Required for a direct fill or an escrow fill. |
| `allowAsyncExec` | Default is `true`. See [Direct Fill or Escrow Fill](#direct-fill-or-escrow-fill). |
| `allowSyncExec` | Default is `true`. See [Direct Fill or Escrow Fill](#direct-fill-or-escrow-fill). |
| `revertWallet` | The wallet that receives the input an escrow fill returns. Defaults to the user. |
| `destinationWallet` | The wallet that receives the output token. |
| `destinationTokenAccount` | A buy that sets this to an account other than the user's associated token account for the output mint returns `400` with code `destination_token_account_not_supported`, unless `allowAsyncExec` is `false`. |
| `outputCloseAuthority` | A buy that sets this returns `400` with code `output_close_authority_not_supported`, unless `allowAsyncExec` is `false`. |
| `platformFeeBps`, `feeAccount` | The platform fee. See [Equity Fees](https://pond.dflow.net/equities/equity-fees.md). |

## Direct Fill or Escrow Fill

The counterparty with the best price decides how a buy settles: a direct fill if it has inventory, otherwise an escrow fill. `executionMode` says which: `sync` for a direct fill, `async` for an escrow fill. A sell is always a direct fill. `allowAsyncExec=false` returns only direct fills. `allowSyncExec=false` returns only escrow fills, so a sell with it returns `400` with code `route_not_found`.

If a request cannot be settled either way, the order endpoint routes it as for any other token, and the response has no equity fields.

## Equity Response Fields

The response is an [`OrderResponse`](https://pond.dflow.net/resources/trading-api/order/order). A direct fill or escrow fill response adds these fields:

| Field | Type |
| - | - |
| `underlyingTicker` | string |
| `scaledUiMultiplier` | number |
| `inAmountScaledUi` | string |
| `outAmountScaledUi` | string |
| `minOutAmountScaledUi` | string |
| `submitEndpointRequired` | boolean |

`submitEndpointRequired` is present, and `true`, only when the response goes to the [submit transaction endpoint](https://pond.dflow.net/equities/submitting.md#direct-fill-submission).

The scaled fields are present only when the equity mint carries the Token-2022 [Scaled UI Amount extension](https://www.solana-program.com/docs/token-2022/extensions#scaled-ui-amount), which stores a multiplier on the mint while token accounts hold the raw amount. A sell adds `inAmountScaledUi`, and a buy adds `outAmountScaledUi` and `minOutAmountScaledUi`. Each scales the matching amount and truncates it:

`outAmountScaledUi = floor(outAmount × scaledUiMultiplier) / 10^decimals`

For a mint with 9 decimals and a `scaledUiMultiplier` of `1.2`:

* `outAmount` is `"2500000000"`.
* `outAmountScaledUi` is `"3"` (`2500000000 × 1.2 / 10^9`), so the app shows 3, not 2.5.

Equity mints can be Token-2022 mints, so the app reads the mint account's owner to choose the token program instead of hard-coding it.
