> For the complete documentation index, see [llms.txt](https://hypotenuse-1.gitbook.io/prism/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hypotenuse-1.gitbook.io/prism/getting-started/user-profile-and-auction-api.md).

# 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="/files/DEhaJLl7Xtl6KgPfKdYT" %}

<figure><img src="/files/zDhSxspaUtyIyFMOwEjn" 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="/files/RHNoyil6BFAtDDLDYqKN" 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>
