# Priceoracle API

## poolSize

{% tabs %}
{% tab title="Smart Contract" %}

```python
@constant
def poolSize(contract_address: address) -> uint256
```

{% endtab %}

{% tab title="Web3" %}

```javascript
contract.methods.poolSize(stablecoinswap_address).call()
```

{% endtab %}
{% endtabs %}

| Parameter         | Type    |                          Description |
| ----------------- | ------- | -----------------------------------: |
| contract\_address | address | Address of a stablecoinswap contract |

| Returns |                                                                          |
| ------- | -----------------------------------------------------------------------: |
| uint256 | Total pool size of stablecoinswap contract in USD multiplied by 10\*\*18 |

## supportedTokens

{% tabs %}
{% tab title="Smart Contract" %}

```python
supportedTokens: public(address[5])
```

{% endtab %}

{% tab title="Web3" %}

```
contract.methods.supported_tokens(index).call()
```

{% endtab %}
{% endtabs %}

| Parameter | Type |                         Description |
| --------- | ---- | ----------------------------------: |
| index     | uint | Index of a supported token (0 to 4) |

| Returns |                        |
| ------- | ---------------------: |
| address | Address of ERC20 token |

## normalized\_token\_prices

{% tabs %}
{% tab title="Smart Contract" %}

```python
normalized_token_prices: public(map(address, uint256))
```

{% endtab %}

{% tab title="Web3" %}

```javascript
contract.methods.normalized_token_prices(token_address).call()
```

{% endtab %}
{% endtabs %}

| Parameter | Type    |                     Description |
| --------- | ------- | ------------------------------: |
| address   | address | Address of ERC20 token contract |

| Returns |                                                               |
| ------- | ------------------------------------------------------------: |
| uint256 | Returns normalized price in USD for a token at given address. |

Where:

`normalized_usd_price = usd_price * 10**8 * 10**(18 - token.decimals)`

Example: USD price for USDC = $1.0, token has 6 decimals:

`normalized_usd_price = 100000000000000000000`

USD price for DAI token is the price according to [https://etherscan.io/address/0x787f552bdc17332c98aa360748884513e3cb401a](https://etherscan.io/address/0x787f552bdc17332c98aa360748884513e3cb401a#readContract) and USD price for any other token is always $1.0


---

# 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://docs.stablecoinswap.io/smart-contract-api/priceoracle-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.
