File tree Expand file tree Collapse file tree 2 files changed +11
-5
lines changed Expand file tree Collapse file tree 2 files changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -801,7 +801,7 @@ paths:
801
801
/api/v1/chain/circulating-supply :
802
802
get :
803
803
summary : Get the circulating supply of the native token at the given epoch
804
- description : Calculates circulating supply by subtracting locked amounts from multiple excluded addresses from the total supply
804
+ description : Calculates circulating supply by subtracting locked amounts from multiple excluded addresses from the effective supply
805
805
parameters :
806
806
- in : query
807
807
name : epoch
@@ -1319,7 +1319,7 @@ components:
1319
1319
properties :
1320
1320
circulatingSupply :
1321
1321
type : string
1322
- description : Circulating supply of the native token (total supply minus locked supply)
1322
+ description : Circulating supply of the native token (effective supply minus locked supply)
1323
1323
Parameters :
1324
1324
type : object
1325
1325
required :
Original file line number Diff line number Diff line change @@ -132,9 +132,15 @@ impl ChainService {
132
132
total_locked_amount += locked_amount;
133
133
}
134
134
135
- // Calculate circulating supply = total supply - total locked amount
136
- let total_supply_amount = total_supply. total . clone ( ) ;
137
- let circulating_amount = & total_supply_amount - & total_locked_amount;
135
+ // Calculate circulating supply = effective supply - total locked amount
136
+ let effective_supply_amount =
137
+ total_supply. effective . ok_or_else ( || {
138
+ ChainError :: Unknown (
139
+ "Effective supply not found for native token" . to_string ( ) ,
140
+ )
141
+ } ) ?;
142
+ let circulating_amount =
143
+ & effective_supply_amount - & total_locked_amount;
138
144
139
145
Ok ( CirculatingSupply {
140
146
circulating_supply : circulating_amount. to_string ( ) ,
You can’t perform that action at this time.
0 commit comments