# User Profile & Auction API

## **Service**

A basic greedy auction is performed when matching campaigns strategies from advertisers and user on-chain profiles.

The strategy with the highest bid will win independently of the condition number of matches with user profile properties such as specific chain balance or protocol interacted.

## **Dependencies**

* On-chain user history data from [Debank](https://docs.cloud.debank.com/en/debank-connect/api/user-social-data) api.
* [Infura](https://www.infura.io/) nodes, for debiting advertisers and crediting publishers on each auction.

## **Sequence**

WIP: add auction seq diagram here ...

## **Performance Test using** [**K6**](https://grafana.com/docs/k6/latest/)

**Scenario #1 on EC2 Aws / Grafana**

Complete auction flow, stress test including Infura and Debank apis

* Bartio Network Congestion gas price at 70 gwei

\
\- Complete Grafana[ report link](https://prismprotocol.grafana.net/goto/L7LjU5dHg?orgId=1) or Pfd file bellow:

{% file src="<https://2713473552-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDqeVX4h920HNCXWhIjVJ%2Fuploads%2Fsf5dsAb9IfCCp6WO8viD%2Fprism-ads-api-loadTest-report.pdf?alt=media&token=95d4d5b6-1d6b-4f87-b8e5-1388fa2a8342>" %}

<figure><img src="https://2713473552-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDqeVX4h920HNCXWhIjVJ%2Fuploads%2FjXGpwvUsm7NADYGQTPro%2FScreenshot%202025-01-23%20at%2011.53.26%E2%80%AFAM.png?alt=media&#x26;token=96534d72-d073-4b09-82ec-044d7d8453dd" alt=""><figcaption></figcaption></figure>

* 50 campaigns with 10 conditions each
* chains \[arb,eth,bsc] with random sample of 100 addresses
* 880 auction requests = 233 winners and settlement reqs on queue
* 10 concurrent users for 1.5 min
* response time avg 1.5sec
* interval between req: 0 sec

**Scenario #2 on Local**

Complete auction flow, stress test including Infura and Debank

<figure><img src="https://2713473552-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDqeVX4h920HNCXWhIjVJ%2Fuploads%2FmsdtNsDJLttII68C7MDk%2FScreenshot%202025-01-23%20at%2010.15.15%E2%80%AFAM.png?alt=media&#x26;token=39def993-bd4a-4ba2-b01a-ebb86673b296" alt=""><figcaption></figcaption></figure>

* 836 reqs in 1m30s
* Req response time: avg 730ms
* 214 Auction Winners from Sample of 100 addresses \[arb,ath,bsc]
* Interval between req: 0 sec

**Additional Findings**

Separate Settlement micro service was added to the auction to process on-chain settle requests once a day. Prism  is covering the transaction costs of debiting advertisers and crediting publishers during each auction or ad display.<br>


---

# 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://hypotenuse-1.gitbook.io/prism/getting-started/user-profile-and-auction-api.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.
