Skip to content

Commit 490ace8

Browse files
committed
feat: remove product fee and dao contributor
1 parent 2beaa7f commit 490ace8

File tree

69 files changed

+1571
-6515
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+1571
-6515
lines changed

OpenApi.yml

Lines changed: 111 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,47 @@ components:
7878
- peginLiquidityAmount
7979
- pegoutLiquidityAmount
8080
type: object
81+
BtcAssetAllocationDTO:
82+
properties:
83+
available:
84+
description: BTC available for new pegout quotes
85+
example: "43200000"
86+
reservedForUsers:
87+
description: BTC reserved for users (accepted pegout quotes)
88+
example: "4500000"
89+
waitingForRefund:
90+
description: BTC waiting to be refunded to the LP
91+
example: "19800000"
92+
type: object
93+
BtcAssetLocationDTO:
94+
properties:
95+
btcWallet:
96+
description: BTC in the LP's Bitcoin wallet
97+
example: "50000000"
98+
federation:
99+
description: BTC in the federation (rebalancing or waiting for refund)
100+
example: "5000000"
101+
lbc:
102+
description: BTC represented as RBTC locked in the Liquidity Bridge Contract
103+
example: "5300000"
104+
rskWallet:
105+
description: BTC represented as RBTC in the RSK wallet (waiting for rebalancing)
106+
example: "6500000"
107+
type: object
108+
BtcAssetReportDTO:
109+
properties:
110+
allocation:
111+
$ref: '#/components/schemas/BtcAssetAllocationDTO'
112+
description: BTC allocation by usage/purpose
113+
type: object
114+
location:
115+
$ref: '#/components/schemas/BtcAssetLocationDTO'
116+
description: BTC distribution across different locations
117+
type: object
118+
total:
119+
description: Total BTC assets under LP control
120+
example: "67500000"
121+
type: object
81122
ChangeStatusRequest:
82123
properties:
83124
status:
@@ -123,6 +164,17 @@ components:
123164
$ref: '#/components/schemas/GeneralConfigurationDTO'
124165
type: object
125166
type: object
167+
GetAssetsReportResponse:
168+
properties:
169+
btcAssetReport:
170+
$ref: '#/components/schemas/BtcAssetReportDTO'
171+
description: Detailed BTC asset report
172+
type: object
173+
rbtcAssetReport:
174+
$ref: '#/components/schemas/RbtcAssetReportDTO'
175+
description: Detailed RBTC asset report
176+
type: object
177+
type: object
126178
GetCollateralResponse:
127179
properties:
128180
collateral:
@@ -322,7 +374,7 @@ components:
322374
gasFee:
323375
$ref: '#/components/schemas/'
324376
description: Fee to pay for the gas of every call done during the pegin
325-
(call on behalf of the user and call to the dao fee collector)
377+
(call on behalf of the user)
326378
gasLimit:
327379
description: The gas limit
328380
type: integer
@@ -346,9 +398,6 @@ components:
346398
$ref: '#/components/schemas/'
347399
description: The penalty fee that the LP pays if it fails to deliver the
348400
service
349-
productFeeAmount:
350-
$ref: '#/components/schemas/'
351-
description: The DAO Fee amount
352401
rskRefundAddr:
353402
description: A User RSK refund address
354403
type: string
@@ -379,7 +428,6 @@ components:
379428
- confirmations
380429
- callOnRegister
381430
- gasFee
382-
- productFeeAmount
383431
type: object
384432
PeginQuoteRequest:
385433
properties:
@@ -491,8 +539,7 @@ components:
491539
gasFee:
492540
$ref: '#/components/schemas/'
493541
description: Fee to pay for the gas of every call done during the pegout
494-
(call on behalf of the user in Bitcoin network and call to the dao fee
495-
collector in Rootstock)
542+
(call on behalf of the user in Bitcoin network)
496543
lbcAddress:
497544
type: string
498545
liquidityProviderRskAddress:
@@ -503,9 +550,6 @@ components:
503550
type: integer
504551
penaltyFee:
505552
$ref: '#/components/schemas/'
506-
productFeeAmount:
507-
$ref: '#/components/schemas/'
508-
description: The DAO fee amount
509553
rskRefundAddress:
510554
type: string
511555
transferConfirmations:
@@ -533,7 +577,6 @@ components:
533577
- expireDate
534578
- expireBlocks
535579
- gasFee
536-
- productFeeAmount
537580
type: object
538581
PegoutQuoteRequest:
539582
properties:
@@ -612,6 +655,44 @@ components:
612655
- pegin
613656
- pegout
614657
type: object
658+
RbtcAssetAllocationDTO:
659+
properties:
660+
available:
661+
description: RBTC available for new pegin quotes
662+
example: "12000000000000000000"
663+
reservedForUsers:
664+
description: RBTC reserved for users (accepted pegin quotes)
665+
example: "3000000000000000000"
666+
waitingForRefund:
667+
description: RBTC waiting to be refunded to the LP
668+
example: "2000000000000000000"
669+
type: object
670+
RbtcAssetLocationDTO:
671+
properties:
672+
federation:
673+
description: RBTC in the federation (waiting for refund)
674+
example: "2000000000000000000"
675+
lbc:
676+
description: RBTC locked in the Liquidity Bridge Contract
677+
example: "5000000000000000000"
678+
rskWallet:
679+
description: RBTC in the LP's RSK wallet
680+
example: "10000000000000000000"
681+
type: object
682+
RbtcAssetReportDTO:
683+
properties:
684+
allocation:
685+
$ref: '#/components/schemas/RbtcAssetAllocationDTO'
686+
description: RBTC allocation by usage/purpose
687+
type: object
688+
location:
689+
$ref: '#/components/schemas/RbtcAssetLocationDTO'
690+
description: RBTC distribution across different locations
691+
type: object
692+
total:
693+
description: Total RBTC assets under LP control
694+
example: "17000000000000000000"
695+
type: object
615696
RecommendedOperationDTO:
616697
properties:
617698
estimatedCallFee:
@@ -622,18 +703,13 @@ components:
622703
description: Estimated gas fee if a quote is created with the recommended
623704
amount
624705
example: "100000"
625-
estimatedProductFee:
626-
description: Estimated product fee if a quote is created with the recommended
627-
amount
628-
example: "100000"
629706
recommendedQuoteValue:
630707
description: Recommended quote value for the input amount
631708
example: "100000"
632709
required:
633710
- recommendedQuoteValue
634711
- estimatedCallFee
635712
- estimatedGasFee
636-
- estimatedProductFee
637713
type: object
638714
RetainedPeginQuoteDTO:
639715
properties:
@@ -761,36 +837,6 @@ components:
761837
rsk:
762838
type: string
763839
type: object
764-
SummaryDataDTO:
765-
properties:
766-
acceptedQuotesCount:
767-
type: integer
768-
lpEarnings:
769-
$ref: '#/components/schemas/'
770-
paidQuotesAmount:
771-
$ref: '#/components/schemas/'
772-
paidQuotesCount:
773-
type: integer
774-
refundedQuotesCount:
775-
type: integer
776-
totalAcceptedQuotedAmount:
777-
$ref: '#/components/schemas/'
778-
totalFeesCollected:
779-
$ref: '#/components/schemas/'
780-
totalPenaltyAmount:
781-
$ref: '#/components/schemas/'
782-
totalQuotesCount:
783-
type: integer
784-
type: object
785-
SummaryResultDTO:
786-
properties:
787-
peginSummary:
788-
$ref: '#/components/schemas/SummaryDataDTO'
789-
type: object
790-
pegoutSummary:
791-
$ref: '#/components/schemas/SummaryDataDTO'
792-
type: object
793-
type: object
794840
TrustedAccountRequest:
795841
properties:
796842
address:
@@ -884,18 +930,13 @@ components:
884930
description: Estimated gas fee if a quote is created with the recommended
885931
amount
886932
example: "100000"
887-
estimatedProductFee:
888-
description: Estimated product fee if a quote is created with the recommended
889-
amount
890-
example: "100000"
891933
recommendedQuoteValue:
892934
description: Recommended quote value for the input amount
893935
example: "100000"
894936
required:
895937
- recommendedQuoteValue
896938
- estimatedCallFee
897939
- estimatedGasFee
898-
- estimatedProductFee
899940
type: object
900941
pkg.TrustedAccountRequest:
901942
properties:
@@ -1387,10 +1428,15 @@ paths:
13871428
summary: Withdraw PegIn Collateral
13881429
/reports/assets:
13891430
get:
1390-
description: ' Get the asset information for the LPS.'
1431+
description: ' Get the asset information for the LPS including BTC and RBTC
1432+
balances, locations, and allocations.'
13911433
responses:
13921434
"200":
1393-
description: ""
1435+
content:
1436+
application/json:
1437+
schema:
1438+
$ref: '#/components/schemas/GetAssetsReportResponse'
1439+
description: Detailed asset report with BTC and RBTC information
13941440
summary: Get asset Reports
13951441
/reports/pegin:
13961442
get:
@@ -1478,32 +1524,33 @@ paths:
14781524
summary: Get revenue Reports
14791525
/reports/summaries:
14801526
get:
1481-
description: ' Returns financial data for a given period'
1527+
description: ' Get the summary data for the specified period including total
1528+
quotes, accepted, paid, and refunded statistics.'
14821529
parameters:
1483-
- description: Start date in YYYY-MM-DD format
1530+
- description: Start date for the report. Supports YYYY-MM-DD (expands to full
1531+
day) or ISO 8601 format (YYYY-MM-DDTHH:mm:ssZ)
14841532
in: query
14851533
name: startDate
14861534
required: true
14871535
schema:
1488-
description: Start date in YYYY-MM-DD format
1536+
description: Start date for the report. Supports YYYY-MM-DD (expands to
1537+
full day) or ISO 8601 format (YYYY-MM-DDTHH:mm:ssZ)
14891538
format: string
14901539
type: string
1491-
- description: End date in YYYY-MM-DD format
1540+
- description: End date for the report. Supports YYYY-MM-DD (expands to end
1541+
of day) or ISO 8601 format (YYYY-MM-DDTHH:mm:ssZ)
14921542
in: query
14931543
name: endDate
14941544
required: true
14951545
schema:
1496-
description: End date in YYYY-MM-DD format
1546+
description: End date for the report. Supports YYYY-MM-DD (expands to end
1547+
of day) or ISO 8601 format (YYYY-MM-DDTHH:mm:ssZ)
14971548
format: string
14981549
type: string
14991550
responses:
15001551
"200":
1501-
content:
1502-
application/json:
1503-
schema:
1504-
$ref: '#/components/schemas/SummaryResultDTO'
1505-
description: Financial data for the given period
1506-
summary: Summaries
1552+
description: ""
1553+
summary: Get summaries Reports
15071554
/reports/transactions:
15081555
get:
15091556
description: ' Get a paginated list of individual transactions of a specific

cmd/utils/register_pegin/input-example.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@
1818
"lpCallTime": 7200,
1919
"confirmations": 10,
2020
"callOnRegister": false,
21-
"gasFee": 0,
22-
"productFeeAmount": 0
21+
"gasFee": 0
2322
},
2423
"signature": "7290e2c28751d7e4ba2ea5fe5f8b1d3a0bfcd55089fddc0e74fe6809afb8195622801d2dd8267ea3cc4088f5e4b133e0e22dcc403ee0f838efbb277f493c8cde1b",
2524
"btcTxHash": "e57767cefb13bb962e9729d99adbb7147f6054af6e8f4d7c4cd47e74cf9ccaa4"

cmd/utils/register_pegin/register_pegin_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ func TestExecuteRegisterPegIn(t *testing.T) {
6060
Confirmations: 6,
6161
CallOnRegister: false,
6262
GasFee: entities.NewWei(1),
63-
ProductFeeAmount: entities.NewWei(0),
6463
},
6564
Signature: []byte{0x01, 0x02, 0x03},
6665
BtcTxHash: "bitcoinTxHash",
@@ -244,7 +243,7 @@ func TestParseRegisterPegInScriptInput(t *testing.T) {
244243
ContractAddress: "0x79568c2989232dCa1840087D73d403602364c0D4",
245244
Data: "", GasLimit: 46000, Value: entities.NewWei(600000000000000000),
246245
Nonce: 8941842587185974000, AgreementTimestamp: 1732101992, TimeForDeposit: 3600, LpCallTime: 7200,
247-
Confirmations: 10, CallOnRegister: false, GasFee: entities.NewWei(0), ProductFeeAmount: entities.NewWei(0),
246+
Confirmations: 10, CallOnRegister: false, GasFee: entities.NewWei(0),
248247
}, result.Quote)
249248
})
250249
}

docker-compose/docker-compose.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@ services:
9595
- ERP_KEYS
9696
- USE_SEGWIT_FEDERATION
9797
- ACCOUNT_NUM
98-
- DAO_FEE_COLLECTOR_ADDRESS
9998
- KEY_SECRET
10099
- PASSWORD_SECRET
101100
- BTC_NETWORK

docker-compose/local/docker-compose.lps.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ services:
3131
- ERP_KEYS
3232
- USE_SEGWIT_FEDERATION
3333
- ACCOUNT_NUM
34-
- DAO_FEE_COLLECTOR_ADDRESS
3534
- KEY_SECRET
3635
- PASSWORD_SECRET
3736
- BTC_NETWORK

docker-compose/mainnet/docker-compose.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ services:
4747
- ERP_KEYS
4848
- USE_SEGWIT_FEDERATION
4949
- ACCOUNT_NUM
50-
- DAO_FEE_COLLECTOR_ADDRESS
5150
- KEY_SECRET
5251
- PASSWORD_SECRET
5352
- BTC_NETWORK

docs/Environment.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ These are the environment variables required by the liquidity provider server (L
2626
| `ERP_KEYS` | Keys that are used as a secondary multisig that would be allowed to spend UTXOs after a year they were created. |`0216c23b2ea8e4f11c3f9e22711addb1d16a93964796913830856b568cc3ea21d3`,`0275562901dd8faae20de0a4166362a4f82188db77dbed4ca887422ea1ec185f14`,`034db69f2112f4fb1bb6141bf6e2bd6631f0484d0bd95b16767902c9fe219d4a6f` | YES |
2727
| `USE_SEGWIT_FEDERATION` | Wether to generate the federation address as a P2SH-P2WSH or not | true | NO |
2828
| `ACCOUNT_NUM` | The keystore account number to use. If not provided default value will be 0. | `0` | NO |
29-
| `DAO_FEE_COLLECTOR_ADDRESS` | Address of the DAO fee collector. | `0x86B6534687A176A476C16083a373fB9Fe4FAb449` | YES |
3029
| `KEY_SECRET` | Name of the secret of AWS secrets manager that contains the encrypted json of the liquidity provider RSK account. Only required if `SECRET_SRC` is `aws`. | `FlyoverTestEnv/LPS-KEY` | NO |
3130
| `PASSWORD_SECRET` | Name of the secret of AWS secrets manager that contains the password of the encrypted json of the liquidity provider RSK account. Only required if `SECRET_SRC` is `aws`. | `FlyoverTestEnv/LPS-PASSWORD` | NO |
3231
| `KEYSTORE_FILE` | Name of the file that contains the encrypted json of the liquidity provider RSK account. Only required if `SECRET_SRC` is `env`. | `geth_keystore/UTC--2024-01-29T16-36-09.688642000Z--9d93929a9099be4355fc2389fbf253982f9df47c` | NO |

docs/Operating-LP.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,6 @@ This fee covers the gas costs for all transactions performed by the Liquidity Pr
4545
* Call Fee:
4646
A fee paid to the Liquidity Provider who facilitates the transaction. This fee is configurable and can vary based on the LP's chosen settings.
4747

48-
* Product Fee:
49-
This is a DAO fee that is collected by the protocol. It's calculated based on a percentage of the transaction value and is configured at the protocol level.
50-
5148
## Security
5249
See the [minimum security requirements](https://github.com/rsksmart/liquidity-provider-server/blob/master/docs/LP-Management.md#minimum-security-requirements).
5350

docs/diagrams/PegIn.mmd

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ sequenceDiagram
55
participant lps as Liquidity Provider Server
66
participant btc as Bitcoin Network
77
participant rsk as Rootstock Network
8-
participant feeCollector as DAO Fee Collector
98
participant bridge as Rootstock Bridge
109

1110
activate usr
@@ -22,11 +21,6 @@ sequenceDiagram
2221
rsk-->>-lps: gasEstimation
2322
lps->>+rsk: gasPrice()
2423
rsk-->>-lps: gasPrice
25-
lps->>+feeCollector: getFeePercentage()
26-
feeCollector-->>-lps: feePercentage
27-
alt is not zero
28-
lps->>lps: Add product fee
29-
end
3024
lps->>+bridge: getFederationAddress()
3125
bridge-->>-lps: federationAddress
3226
lps->>+lbc: hashQuote(quote)

0 commit comments

Comments
 (0)