> For the complete documentation index, see [llms.txt](https://code-after-sex.gitbook.io/script-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://code-after-sex.gitbook.io/script-documentation/cas-fishing/configuration/the-fish-market.md).

# The fish market

A buyer standing somewhere on the map who takes the catch off the player's hands, with a full RDR2-styled board.

***

## Adding a buyer

One entry in `Config.Market.vendors`. The ped, the blip, the prompt and the screen all come from it, so a second buyer costs a few lines.

```lua
{
  id      = 'lagras',
  label   = 'Lagras Fish Market',
  keeper  = 'Ellis Rooke',
  note    = 'Buys anything out of the bayou. Pays better for the big ones.',
  coords  = vector3(2104.63, -294.17, 41.54),
  heading = 109.6,
  model   = 's_m_m_marketvendor_01',
  scenario = 'WORLD_HUMAN_STAND_WAITING',
  rate    = 1.00,
  blip    = { style = 'BLIP_STYLE_SHOP', name = 'Fish Market' },
}
```

| Field    | Does                                                                    |
| -------- | ----------------------------------------------------------------------- |
| `rate`   | Everything this buyer pays is scaled by it. `1.15` pays 15% more        |
| `note`   | Flavour line under the heading on the board                             |
| `coords` | Where they stand. The ground is measured, so the Z only has to be close |

{% hint style="info" %}
Stand where you want the buyer and type `/marketmove`. The NPC moves there and the exact config line is printed for you to paste.
{% endhint %}

***

## Pricing

```lua
Config.Market = {
  pricePerKg = 0.55,     -- on top of the species base value
  bulkStep   = 0.015,    -- each extra fish in one sale adds this
  bulkCap    = 0.20,     -- up to this much
  demandMin  = 0.80,
  demandMax  = 1.35,
  maxPerRun  = 10,
}
```

A fish is worth its species `value`, plus a rate on its typical weight, times today's demand, times the buyer's `rate`, plus the bulk bonus.

***

## Demand

Every species gets a multiplier that holds for the whole day, shown on the board as a band:

| Band          | Multiplier |
| ------------- | ---------- |
| **In demand** | 1.18+      |
| Wanted        | 1.05+      |
| Steady        | 0.95+      |
| Slow          | 0.86+      |
| Glutted       | below      |

It gives players a reason to check the board before emptying the satchel, and a reason to hold a catch back.

{% hint style="success" %}
Demand is worked out from the day and the species name, not rolled at random, so every player at every buyer sees the same board — and the price shown is the price paid.
{% endhint %}

***

## The board

Keyboard-driven. The mouse cursor is never taken from the player.

| Key       | Does                   |
| --------- | ---------------------- |
| **↑ ↓**   | Move through the catch |
| **Enter** | Sell one species       |
| **← →**   | Quantity               |
| **Shift** | Adjust five at a time  |
| **A**     | Sell everything        |
| **Esc**   | Leave                  |

***

## Selling is server-side

Prices are recomputed on the server for every sale and never taken from the client. The board is rebuilt after each sale, and the fish is **removed before the money is paid** — a failed removal cannot mint cash. Distance to the buyer is checked both when the board is requested and when the sale is made.
