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

# getInflationGovernor

> Возвращает текущие параметры инфляционного управляющего

## Параметры

Этот метод не принимает никаких параметров.

## Ответ

<ResponseField name="result" type="object">
  <Expandable title="Поля результата">
    <ResponseField name="initial" type="number">
      Начальный процент инфляции с момента времени 0
    </ResponseField>

    <ResponseField name="terminal" type="number">
      Конечный процент инфляции
    </ResponseField>

    <ResponseField name="taper" type="number">
      Ежегодный темп снижения инфляции
    </ResponseField>

    <ResponseField name="foundation" type="number">
      Процент от общей инфляции, выделяемый фонду
    </ResponseField>

    <ResponseField name="foundationTerm" type="number">
      Продолжительность инфляции фонда в годах
    </ResponseField>
  </Expandable>
</ResponseField>

## Примеры кода

### Базовый запрос

```bash theme={null}
curl https://fra.rpc.orbitflare.com?api_key=YOUR-API-KEY -X POST -H "Content-Type: application/json" -d '{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "getInflationGovernor"
}'
```

### Использование web3.js

```typescript theme={null}
import { Connection } from '@solana/web3.js';

const connection = new Connection('https://fra.rpc.orbitflare.com?api_key=YOUR-API-KEY');

// Get inflation governor parameters
const inflationGovernor = await connection.getInflationGovernor();
console.log('Initial inflation:', inflationGovernor.initial);
console.log('Terminal inflation:', inflationGovernor.terminal);
console.log('Taper rate:', inflationGovernor.taper);
console.log('Foundation percentage:', inflationGovernor.foundation);
console.log('Foundation term:', inflationGovernor.foundationTerm);

// Calculate current inflation rate
async function calculateCurrentInflation() {
  const inflationGovernor = await connection.getInflationGovernor();
  const epochInfo = await connection.getEpochInfo();
  
  const yearsSinceGenesis = epochInfo.absoluteSlot / (432000 * 365); // Approximate years
  const currentInflation = Math.max(
    inflationGovernor.terminal,
    inflationGovernor.initial - (inflationGovernor.taper * yearsSinceGenesis)
  );
  
  return {
    currentInflation,
    yearsSinceGenesis,
    initialInflation: inflationGovernor.initial,
    terminalInflation: inflationGovernor.terminal,
    taperRate: inflationGovernor.taper
  };
}
```

## Примечания

1. Возвращает параметры, управляющие инфляцией в сети Solana
2. Инфляция снижается со временем согласно скорости уменьшения
3. Инфляция фонда отделена от инфляции валидаторов
4. Ответ приходит немедленно, так как читается из текущего состояния
5. Эти параметры устанавливаются управлением и могут изменяться

## Рекомендации

1. Используйте этот метод для понимания расписания инфляции сети
2. Кэшируйте результаты там, где это уместно, для снижения нагрузки на RPC
3. Учитывайте влияние инфляции на вознаграждения за стейкинг
4. Отслеживайте изменения в параметрах инфляции
5. Используйте совместно с другими методами, связанными с инфляцией

## Распространённые ошибки

| Код    | Сообщение                         | Решение                                                   |
| ------ | --------------------------------- | --------------------------------------------------------- |
| -32601 | Method not found                  | Убедитесь, что вы подключены к узлу Solana RPC            |
| -32007 | Inflation information unavailable | Узел может выполнять начальную загрузку или синхронизацию |

## Сценарии использования

1. **Анализ инфляции**
   ```typescript theme={null}
   interface InflationMetrics {
     currentInflation: number;
     yearsSinceGenesis: number;
     initialInflation: number;
     terminalInflation: number;
     taperRate: number;
     foundationPercentage: number;
     foundationTerm: number;
     validatorInflation: number;
     foundationInflation: number;
   }

   async function analyzeInflation(): Promise<InflationMetrics> {
     const inflationGovernor = await connection.getInflationGovernor();
     const epochInfo = await connection.getEpochInfo();
     
     const yearsSinceGenesis = epochInfo.absoluteSlot / (432000 * 365);
     const currentInflation = Math.max(
       inflationGovernor.terminal,
       inflationGovernor.initial - (inflationGovernor.taper * yearsSinceGenesis)
     );
     
     const foundationInflation = yearsSinceGenesis < inflationGovernor.foundationTerm
       ? currentInflation * inflationGovernor.foundation
       : 0;
     
     return {
       currentInflation,
       yearsSinceGenesis,
       initialInflation: inflationGovernor.initial,
       terminalInflation: inflationGovernor.terminal,
       taperRate: inflationGovernor.taper,
       foundationPercentage: inflationGovernor.foundation,
       foundationTerm: inflationGovernor.foundationTerm,
       validatorInflation: currentInflation - foundationInflation,
       foundationInflation
     };
   }
   ```

2. **Прогнозирование вознаграждений за стейкинг**
   ```typescript theme={null}
   interface StakingProjection {
     currentAPY: number;
     futureAPY: number[];
     years: number[];
   }

   async function projectStakingRewards(
     totalStaked: number,
     totalSupply: number,
     years: number = 10
   ): Promise<StakingProjection> {
     const inflationGovernor = await connection.getInflationGovernor();
     const epochInfo = await connection.getEpochInfo();
     
     const currentYear = epochInfo.absoluteSlot / (432000 * 365);
     const yearsArray = Array.from({ length: years }, (_, i) => i);
     
     const futureAPY = yearsArray.map(year => {
       const inflation = Math.max(
         inflationGovernor.terminal,
         inflationGovernor.initial - (inflationGovernor.taper * (currentYear + year))
       );
       
       const foundationInflation = (currentYear + year) < inflationGovernor.foundationTerm
         ? inflation * inflationGovernor.foundation
         : 0;
       
       const validatorInflation = inflation - foundationInflation;
       return (validatorInflation * totalSupply) / totalStaked;
     });
     
     return {
       currentAPY: futureAPY[0],
       futureAPY,
       years: yearsArray
     };
   }
   ```

3. **Мониторинг инфляции**
   ```typescript theme={null}
   interface InflationAlert {
     type: 'high' | 'low' | 'change';
     message: string;
     currentInflation: number;
     expectedInflation: number;
     difference: number;
   }

   async function monitorInflation(
     threshold: number = 0.01
   ): Promise<InflationAlert[]> {
     const inflationGovernor = await connection.getInflationGovernor();
     const epochInfo = await connection.getEpochInfo();
     
     const yearsSinceGenesis = epochInfo.absoluteSlot / (432000 * 365);
     const expectedInflation = Math.max(
       inflationGovernor.terminal,
       inflationGovernor.initial - (inflationGovernor.taper * yearsSinceGenesis)
     );
     
     const currentInflation = await connection.getInflationRate();
     const difference = Math.abs(currentInflation - expectedInflation);
     
     const alerts: InflationAlert[] = [];
     
     if (difference > threshold) {
       alerts.push({
         type: 'change',
         message: `Inflation differs from expected by ${difference.toFixed(4)}`,
         currentInflation,
         expectedInflation,
         difference
       });
     }
     
     if (currentInflation > inflationGovernor.initial) {
       alerts.push({
         type: 'high',
         message: `Inflation is above initial rate`,
         currentInflation,
         expectedInflation,
         difference
       });
     }
     
     if (currentInflation < inflationGovernor.terminal) {
       alerts.push({
         type: 'low',
         message: `Inflation is below terminal rate`,
         currentInflation,
         expectedInflation,
         difference
       });
     }
     
     return alerts;
   }
   ```
