> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stablemint.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Price feed

> Signed, real-time pricing for StableMint tokens.

The Price Feed API provides real-time pricing information for StableMint tokens.

## API Format

```
GET /v1/price/{chain}/{token}
```

### Path Parameters

| Parameter | Type   | Description        | Values           |
| --------- | ------ | ------------------ | ---------------- |
| `chain`   | string | Blockchain network | `etherlink`      |
| `token`   | string | Token symbol       | `usdsm`, `eursm` |

## Response Format

### Example Response

```json theme={null}
{
  "symbol": "USDSM",
  "contractAddress": "0x6bDE51212203aE5d592Cc5180DA2ABBd41c922dE",
  "price": "1.00",
  "priceCurrency": "USD",
  "timestamp": "2025-11-20T09:02:04.972",
  "version": "1.0",
  "signature": "WyAEj75t6D3i5lolnxsvcjF3oIZD0ElB0YbtCnsevvVpz4pofFTx1U0ZNBcZXUx7..."
}
```

<Tip>
  The signature field contains a base64-encoded RSA signature. Full signature examples are shown in the validation section below.
</Tip>

## Signature Validation

The `signature` field in the response is generated from the following payload components concatenated with pipe (`|`) separators:

```
symbol|price|priceCurrency|timestamp|version
```

### JavaScript Validation Example

```javascript theme={null}
const crypto = require('crypto');

function validateSignature(response, publicKey) {
  // Construct the payload string
  const payload = `${response.symbol}|${response.price}|${response.priceCurrency}|${response.timestamp}|${response.version}`;

  // Create verifier
  const verifier = crypto.createVerify('RSA-SHA256');
  verifier.update(payload);

  // Verify signature
  const isValid = verifier.verify(
    publicKey,
    response.signature,
    'base64'
  );

  return isValid;
}

// Example usage
const response = {
  symbol: "EURSM",
  price: "1.00",
  priceCurrency: "EUR",
  timestamp: "2025-11-20T08:43:45.908",
  version: "1.0",
  signature: "cat1nQMbTZL1HrXuLoFSQNIMmf/bLLmdRS/L9fZkUPjHUZ+wHr+UOveX09QO4OIZjFmAQSlRUsJUeQ8DA/MTBb8klrh1YbnoulkrfHWtvKHwurRUY8WH/WhzdaT7bnaymOtRZIugO0utizlPezuVcUgodVOx9MCSW8Bv6wyuQ+LzHSwaE78jhGb6KyPW15avUtRnboGtSsBV/Hpvnly3CXpoFDyREguCoi2v209EG9JufVeIIhPZx3YiNsgsSCq9U2Z+/Wxn1VtkXs7er9jlZ1PnDchYjoMKybGJ9yGpxgpDqja7ps0LtCdbeO+4jubosl+RWo6T/BtdqLUtilB7bg=="
};

const publicKey = `-----BEGIN PUBLIC KEY-----
[PUBLIC KEY HERE]
-----END PUBLIC KEY-----`;

const isValid = validateSignature(response, publicKey);
console.log('Signature valid:', isValid);
```

## Production Environment

Base URL: `https://feed.stablemint.io`

### Public Key

The following public key should be used to validate the payload signature:

```
-----BEGIN PUBLIC KEY-----
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAtoGE5deMyvfEalpKsndv
bn7EWr9XAkQwkIK4X7877bMhk59+STQU5wFDjIRhnwePb2VqmGEFj0ddPDj4jPx7
cBxB0l0tC4bozP7YTbrEyvgGGVIhtGDm+PidQwnfTzJIu6n622zyeA0cakuzVTNK
7c2BELtsdyJoGTohQURZ/4A2hVnryfN3p641sLLwllA7D9Qme5f3JRhigGOI/MbU
UTPfz6GDxrEoyl3w8MNn5nO7h2yWjek0a2oCc9KxW4ENnjL8h2WQjYWMJCVKnvCn
7nA3GuJxMipHIm/ROtVsQ9ISBNGK7KynEpP1saaTApd5aSeYlTPex1IPTMYxxK80
HwIDAQAB
-----END PUBLIC KEY-----
```

### Available Endpoints

**USDSM on Etherlink**

```
GET https://feed.stablemint.io/v1/price/etherlink/usdsm
```

**EURSM on Etherlink**

```
GET https://feed.stablemint.io/v1/price/etherlink/eursm
```

### Example Request

```bash theme={null}
curl https://feed.stablemint.io/v1/price/etherlink/eursm
```

## Staging Environment

Base URL: `https://feed.stablemint.net`

### Public Key

The following public key should be used to validate the payload signature:

```
-----BEGIN PUBLIC KEY-----
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAmRqV2da+VTB8tC6wIr+G
uEtCHrRkkDgG8V+VseT+LYSMz0NKzYVM1ArRQ6Iod0d3A+4D13HanB8Z6bPYHR3a
keGkVAJ5L5n8lIIjoME3ol+PGSl0CpmYrva8Q56kNHgUtNa6lztzoOnaWlYD9bgB
UY3ye1eVBuDg6mF1UFQgAWsIRbR+IvYuN9SVSI/sI0U5vdBc1HwwgF4CHuPJCcnO
mE09SdnSrEA7Uz/JFYydiJ7Dg4vxAhCpNnRW89fSbcBZjRbVTWQPcMWjgz71KcdL
0/lXICCNmro1P2F/yZGqz8xUK8MvnzJFdXIyH9PCzX7NQEnpfxeTxGHeHuoNg5XB
WQIDAQAB
-----END PUBLIC KEY-----
```

### Available Endpoints

**USDSM on Etherlink**

```
GET https://feed.stablemint.net/v1/price/etherlink/usdsm
```

**EURSM on Etherlink**

```
GET https://feed.stablemint.net/v1/price/etherlink/eursm
```

### Example Request

```bash theme={null}
curl https://feed.stablemint.net/v1/price/etherlink/eursm
```
