Docs / Capability guide

PricingModule extension

Apply a net-price adjustment within the auction's pricing limits.

All capabilities · Related guide · Agent prompt for this capability

When to use this example

Use a PricingModule when an agreed pricing policy needs to adjust net CPM after the auction's initial pricing step. A small arithmetic example helps verify rounding and price boundaries before applying your own terms.

What the example gives you

The starter multiplies net CPM by a configured factor, rounds to four decimal places and preserves gross CPM. For the default factor, 2.0000 becomes 1.9000. It does not perform currency conversion or settle fees.

Before you start

Go for local tests. Host installation also requires a supported kind, reachable gRPC address, matching descriptor/entitlement and an installed stack product. Read the packaged README for policy configuration.

Run the example

Download extension-sidecar

Extract the archive and follow README.md for setup, commands, and expected results. Start with go run . -kind pricing_module -addr 127.0.0.1:50051. Local tests use sample data.

Follow the archive's service configuration and deployment steps before registering or installing it in Riptide. The prerequisites above describe the access and connectivity it needs.

Connect it to your application

  1. Run go test -race ./... in the downloaded starter, then start -kind pricing_module. Read the corresponding fixture and configure the policy before testing live requests.

  2. PricingModule uses ExtensionService Describe, Health and Invoke with method ApplyPricing. Apply your pricing rule within the host’s limits. Preserve currency and use decimal arithmetic to validate nonnegative net and gross prices.

  3. Run the gRPC smoke tests, then install using the stack-product workflow. Verify timeout and fallback behavior and remove the activation to test rollback.

Check the result

The descriptor matches the selected kind, gRPC calls return the documented result, and malformed/unsupported requests fail explicitly. A host timeout skips the extension within the request budget.

API operations