mirror of
https://github.com/Reckless-Satoshi/robosats.git
synced 2024-08-16 23:30:29 +03:00
Add programatic order size limit to new coordinators
This commit is contained in:
parent
5f602ab8f8
commit
4b7b940f62
@ -1,4 +1,4 @@
|
|||||||
_RoboSats Federation Basis v0.6.0~2_
|
_RoboSats Federation Basis v0.6.0~3_
|
||||||
|
|
||||||
## Introduction
|
## Introduction
|
||||||
RoboSats is a Free and Open Source project, anyone can spin up a new RoboSats backend instance. This is in fact ideal, given that the more backend instances there are, the more decentralized RoboSats becomes and the harder it is to stop. However, this decentralization creates some challenges:
|
RoboSats is a Free and Open Source project, anyone can spin up a new RoboSats backend instance. This is in fact ideal, given that the more backend instances there are, the more decentralized RoboSats becomes and the harder it is to stop. However, this decentralization creates some challenges:
|
||||||
@ -96,6 +96,16 @@ Some of these badges can be objectively measured and awarded. Other badges rely
|
|||||||
|
|
||||||
We also envision more badges in the future, for example milestones by number of trades coordinated (200, 1K, 5K, 25K, 100K, etc).
|
We also envision more badges in the future, for example milestones by number of trades coordinated (200, 1K, 5K, 25K, 100K, etc).
|
||||||
|
|
||||||
|
## New coordinator limits.
|
||||||
|
The RoboSats client app limits the size of order tha robots can place on newly joined coordinators. This way new coordinators can show their worth with smaller orders before handling all order sizes. The client allows orders of up to 250K Sats for completely new coordinators. The client will increase the size limite by 30% every 2016 blocks (that is, 2 weeks, same as the difficulty adjustment). After 6 months, a coordinator will be considered "mature" and able to host any order size. Coordinator that gained the "Founder" badge by joining before the v0.6.0 release are considered "mature".
|
||||||
|
|
||||||
|
## New Coordinator Order Size Limits
|
||||||
|
The RoboSats client application imposes limits on the order size that robots can place on newly established coordinators. This mechanism allows new coordinators to demonstrate their capabilities with progressively larger orders.
|
||||||
|
|
||||||
|
New coordinators are initially restricted to hosting orders of up to 250,000 Sats. Over time, the order size limit increases. Specifically, the limit grows by 30% every 2016 blocks (2 weeks), the same cadence of the Bitcoin mining difficulty adjustment.
|
||||||
|
|
||||||
|
After six months, or approximately 12,288 blocks, a coordinator reaches maturity and the app grants it the ability to handle orders of any size. Notably, coordinators that earned the "Founder" badge upon joining prior to the v0.6.0 release are considered mature and can process any order size immediately.
|
||||||
|
|
||||||
## Timeline
|
## Timeline
|
||||||
|
|
||||||
In a sense the RoboSats federation is already online. New coordinators can gradually join. Eventually, the RoboSats "Experimental" coordinator that is run by the development team will be phased out. The RoboSats Federated client app can be used already in `robotestagw3dcxmd66r4rgksb4nmmr43fh77bzn2ia2eucduyeafnyd.onion`. You can also run a pre-release of the v0.6.0 selfhosted client.
|
In a sense the RoboSats federation is already online. New coordinators can gradually join. Eventually, the RoboSats "Experimental" coordinator that is run by the development team will be phased out. The RoboSats Federated client app can be used already in `robotestagw3dcxmd66r4rgksb4nmmr43fh77bzn2ia2eucduyeafnyd.onion`. You can also run a pre-release of the v0.6.0 selfhosted client.
|
||||||
|
@ -126,6 +126,11 @@ const MakerForm = ({
|
|||||||
let minAmountLimit: number = limitList[index].min_amount * (1 + premium / 100);
|
let minAmountLimit: number = limitList[index].min_amount * (1 + premium / 100);
|
||||||
let maxAmountLimit: number = limitList[index].max_amount * (1 + premium / 100);
|
let maxAmountLimit: number = limitList[index].max_amount * (1 + premium / 100);
|
||||||
|
|
||||||
|
const coordinatorSizeLimit =
|
||||||
|
(federation.getCoordinator(maker.coordinator).size_limit / 100000000) *
|
||||||
|
limitList[index].price;
|
||||||
|
maxAmountLimit = Math.min(coordinatorSizeLimit, maxAmountLimit);
|
||||||
|
|
||||||
// apply thresholds to ensure good request
|
// apply thresholds to ensure good request
|
||||||
minAmountLimit = minAmountLimit * amountSafeThresholds[0];
|
minAmountLimit = minAmountLimit * amountSafeThresholds[0];
|
||||||
maxAmountLimit = maxAmountLimit * amountSafeThresholds[1];
|
maxAmountLimit = maxAmountLimit * amountSafeThresholds[1];
|
||||||
@ -134,7 +139,11 @@ const MakerForm = ({
|
|||||||
|
|
||||||
const updateSatoshisLimits = function (limitList: LimitList): void {
|
const updateSatoshisLimits = function (limitList: LimitList): void {
|
||||||
const minAmount: number = limitList[1000].min_amount * 100000000;
|
const minAmount: number = limitList[1000].min_amount * 100000000;
|
||||||
const maxAmount: number = limitList[1000].max_amount * 100000000;
|
let maxAmount: number = limitList[1000].max_amount * 100000000;
|
||||||
|
maxAmount = Math.min(
|
||||||
|
federation.getCoordinator(maker.coordinator).size_limit / 100000000,
|
||||||
|
maxAmount,
|
||||||
|
);
|
||||||
setSatoshisLimits([minAmount, maxAmount]);
|
setSatoshisLimits([minAmount, maxAmount]);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -74,15 +74,34 @@ export interface Origins {
|
|||||||
i2p: Origin | undefined;
|
i2p: Origin | undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function calculateSizeLimit(inputDate: Date): number {
|
||||||
|
const now = new Date();
|
||||||
|
const numDifficultyAdjustments = Math.ceil(
|
||||||
|
(now.getTime() - inputDate.getTime()) / (1000 * 60 * 60 * 24 * 14),
|
||||||
|
);
|
||||||
|
|
||||||
|
let value = 250000;
|
||||||
|
for (let i = 1; i < numDifficultyAdjustments; i++) {
|
||||||
|
value *= 1.3;
|
||||||
|
if (i >= 12) {
|
||||||
|
// after 12 difficulty adjustments (6 weeks) limit becomes 21 BTC (mature coordinator)
|
||||||
|
return 21 * 100000000;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
export class Coordinator {
|
export class Coordinator {
|
||||||
constructor(value: any) {
|
constructor(value: any) {
|
||||||
|
const established = new Date(value.established);
|
||||||
this.longAlias = value.longAlias;
|
this.longAlias = value.longAlias;
|
||||||
this.shortAlias = value.shortAlias;
|
this.shortAlias = value.shortAlias;
|
||||||
this.description = value.description;
|
this.description = value.description;
|
||||||
this.motto = value.motto;
|
this.motto = value.motto;
|
||||||
this.color = value.color;
|
this.color = value.color;
|
||||||
this.size_limit = value.size_limit;
|
this.size_limit = value.badges.isFounder ? 21 * 100000000 : calculateSizeLimit(established);
|
||||||
this.established = value.established;
|
this.established = established;
|
||||||
this.policies = value.policies;
|
this.policies = value.policies;
|
||||||
this.contact = value.contact;
|
this.contact = value.contact;
|
||||||
this.badges = value.badges;
|
this.badges = value.badges;
|
||||||
@ -102,7 +121,7 @@ export class Coordinator {
|
|||||||
public motto: string;
|
public motto: string;
|
||||||
public color: string;
|
public color: string;
|
||||||
public size_limit: number;
|
public size_limit: number;
|
||||||
public established: string;
|
public established: Date;
|
||||||
public policies: Record<string, string> = {};
|
public policies: Record<string, string> = {};
|
||||||
public contact: Contact | undefined;
|
public contact: Contact | undefined;
|
||||||
public badges: Badges;
|
public badges: Badges;
|
||||||
|
@ -6,7 +6,6 @@
|
|||||||
"motto": "Original Robohost. P2P FTW!",
|
"motto": "Original Robohost. P2P FTW!",
|
||||||
"color": "#1976d2",
|
"color": "#1976d2",
|
||||||
"established": "2022-03-01",
|
"established": "2022-03-01",
|
||||||
"size_limit": 0,
|
|
||||||
"contact": {
|
"contact": {
|
||||||
"email": "robosats@protonmail.com",
|
"email": "robosats@protonmail.com",
|
||||||
"telegram": "robosats",
|
"telegram": "robosats",
|
||||||
@ -50,7 +49,6 @@
|
|||||||
"motto": "Privacy and Integrity: Temple of Sats, where Bitcoin's essence thrives.",
|
"motto": "Privacy and Integrity: Temple of Sats, where Bitcoin's essence thrives.",
|
||||||
"color": "#000",
|
"color": "#000",
|
||||||
"established": "2023-12-02",
|
"established": "2023-12-02",
|
||||||
"size_limit": 0,
|
|
||||||
"contact": {
|
"contact": {
|
||||||
"email": "cosmos178ftmm4edlahqzj376gwgqzd9re5x0x9h0tfsc@keplr.xyz",
|
"email": "cosmos178ftmm4edlahqzj376gwgqzd9re5x0x9h0tfsc@keplr.xyz",
|
||||||
"telegram": "venividivici_fr",
|
"telegram": "venividivici_fr",
|
||||||
@ -95,7 +93,6 @@
|
|||||||
"motto": "btc = ɔʇq",
|
"motto": "btc = ɔʇq",
|
||||||
"color": "#329239",
|
"color": "#329239",
|
||||||
"established": "2023-12-02",
|
"established": "2023-12-02",
|
||||||
"size_limit": 0,
|
|
||||||
"contact": {
|
"contact": {
|
||||||
"email": "info@satstralia.com",
|
"email": "info@satstralia.com",
|
||||||
"telegram": "satstralia",
|
"telegram": "satstralia",
|
||||||
@ -141,7 +138,6 @@
|
|||||||
"motto": "TheBigLake: The Lake of Economic Freedom.",
|
"motto": "TheBigLake: The Lake of Economic Freedom.",
|
||||||
"color": "#000D28",
|
"color": "#000D28",
|
||||||
"established": "2023-12-30",
|
"established": "2023-12-30",
|
||||||
"size_limit": 0,
|
|
||||||
"contact": {
|
"contact": {
|
||||||
"email": "gabbygator184@proton.me",
|
"email": "gabbygator184@proton.me",
|
||||||
"telegram": "gabbygator184",
|
"telegram": "gabbygator184",
|
||||||
|
Loading…
Reference in New Issue
Block a user